Accent neopixels don't respond to all styles

I have default and non-default blade styles in my config. My crystal chamber accent neopixels only activate with the default styles.

Post your config and we’ll take a look.

1 Like

#ifdef CONFIG_TOP
#include “proffieboard_v2_config.h”
#define NUM_BLADES 2
#define NUM_BUTTONS 1
#define VOLUME 2750
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 2.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define SA22C_TWIST_ON
#define SA22C_TWIST_OFF
#define SAVE_STATE
#endif

#ifdef CONFIG_PROP
#include “…/props/saber_sa22c_buttons.h”
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {

{ “RgueCmdr”, “tracks/venus.wav”,
StyleFirePtr<BLUE, CYAN, 0>(),
StyleFirePtr<BLUE, CYAN, 1>(), “blue fire”},

{ “SmthGrey”, “tracks/mercury.wav”,
StyleFirePtr<RED, YELLOW, 0>(),
StyleFirePtr<RED, YELLOW, 1>(), “fire”},

{ “TthCrstl”, “tracks/mars.wav”,
StylePtr<InOutHelper<EASYBLADE(OnSpark, WHITE), 300, 800> >(),
StylePtr<InOutHelper<EASYBLADE(OnSpark, WHITE), 300, 800> >(), “green”},

{ “TeensySF”, “tracks/venus.wav”,
StyleNormalPtr<CYAN, WHITE, 300, 800>(),
StyleNormalPtr<CYAN, WHITE, 300, 800>(), “cyan”},

{ “SmthJedi”, “tracks/mars.wav”,
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), “blue”},

{ “SmthFuzz”, “tracks/uranus.wav”,
StyleNormalPtr<RED, WHITE, 300, 800>(),
StyleNormalPtr<RED, WHITE, 300, 800>(), “red”},

{ “TeensySF”, “tracks/mercury.wav”,
StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
StyleNormalPtr<WHITE, RED, 300, 800, RED>(), “white”},

{ “SmthGrey”, “tracks/venus.wav”,
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), “magenta”},

{ “SmthJedi”, “tracks/mars.wav”,
&style_charging,
StyleNormalPtr<BLACK, BLACK, 300, 800>(), “Battery\nLevel”},

{ “Bank04”, “tracks/Ascension.wav”,
StylePtr<Layers<RandomFlicker<RotateColorsX<Variation,Green>,RotateColorsX<Variation,Rgb<0,128,0>>>,TransitionEffectL<TrConcat<TrInstant,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<50>>,TrSmoothFade<600>>,EFFECT_LOCKUP_END>,ResponsiveLockupL<Strobe<White,BrownNoiseFlicker<White,Red,300>,50,1>,TrConcat<TrInstant,White,TrFade<400>>,TrFade<100>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>,Scale<SwingSpeed<100>,Int<10000>,Int<14000>>>,ResponsiveLightningBlockL<Strobe<White,AudioFlicker<White,Blue>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>>,ResponsiveStabL<Red,TrWipeIn<600>,TrWipe<600>>,ResponsiveBlastL<White,Int<400>,Scale<SwingSpeed<200>,Int<100>,Int<400>>,Int<400>>,ResponsiveClashL<White,TrInstant,TrFade<400>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,Red,Orange>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipe<300>,TrWipeIn<500>,Black>,AlphaL<Black,Scale<IsLessThan<BatteryLevel,Int<11000>>,Int<0>,Int<7500>>>>>()},

{ “Bank08”, “tracks/DarkSide.wav”,
StylePtr<Layers<StyleFire<Red,StripesX<Int<3000>,Scale<TwistAngle<>,Int<-500>,Int<0>>,Red,Yellow,OrangeRed,Yellow,Red,Tomato>,0,3,FireConfig<0,2000,5>,FireConfig<0,2000,5>,FireConfig<0,2000,5>>,TransitionEffectL<TrConcat<TrInstant,AlphaL<Mix<SmoothStep<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Int<10000>,Int<30000>>,Int<10000>>,Int<1000>>,Stripes<1500,2000,White,Rainbow>,Stripes<1500,-2500,White,Rainbow>>,Int<16384>>,TrFade<800>>,EFFECT_LOCKUP_END>,ResponsiveLockupL<Strobe<White,BrownNoiseFlicker<White,Red,300>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Int<10000>,Int<30000>>,Int<10000>>,Int<16000>>>,TrFade<400>>,TrFade<100>,Scale<BladeAngle<0,16000>,Int<10000>,Int<30000>>,Int<10000>,Scale<SwingSpeed<100>,Int<10000>,Int<14000>>>,ResponsiveLightningBlockL<Strobe<White,AudioFlicker<White,Blue>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>>,ResponsiveStabL,ResponsiveBlastWaveL<White,Int<400>,Scale<SwingSpeed<200>,Int<100>,Int<400>>>,ResponsiveClashL<White,TrInstant,TrFade<400>,Scale<BladeAngle<0,16000>,Int<10000>,Int<30000>>,Int<10000>>,TransitionEffectL<TrConcat<TrInstant,Stripes<3000,-3500,RotateColorsX<Variation,White>,RandomPerLEDFlicker<RotateColorsX<Variation,Rgb<60,60,60>>,Black>,BrownNoiseFlicker<RotateColorsX<Variation,White>,RotateColorsX<Variation,Rgb<60,60,60>>,200>,RandomPerLEDFlicker<RotateColorsX<Variation,Rgb<128,128,128>>,RotateColorsX<Variation,Rgb<60,60,60>>>>,TrFade<1200>>,EFFECT_IGNITION>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,Red,Orange>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipeX<Scale<IsLessThan<BladeAngle<>,Int<16000>>,Int<200>,Int<800>>>,TrWipeInSparkTip<White,500>>,TransitionEffectL<TrConcat<TrDelay<1500>,Black,TrFade<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,Bump<Int<0>,Int<6000>>>,TrFade<3000>>,EFFECT_BOOT>,TransitionEffectL<TrConcat<TrInstant,AlphaL<Mix<BatteryLevel,Red,Green>,Bump<Int<0>,Int<6000>>>,TrFade<3000>>,EFFECT_NEWFONT>,AlphaL<Black,Scale<IsLessThan<BatteryLevel,Int<11000>>,Int<0>,Int<7500>>>>>()},

{ “Bank10”, “tracks/TheBoldOne.wav”,
StylePtr<Layers<RandomFlicker<RotateColorsX<Variation,DeepSkyBlue>,RotateColorsX<Variation,Rgb<0,0,128>>>,TransitionEffectL<TrConcat<TrFade<400>,StyleFire<Stripes<2500,-5000,BrownNoiseFlicker<Blue,Black,20>,Rgb<0,0,10>,BrownNoiseFlicker<Black,Rgb<25,25,255>,70>,Rgb<0,0,128>>,Rgb<0,0,80>,0,5,FireConfig<2,3000,0>,FireConfig<2,3000,0>,FireConfig<2,3000,0>,FireConfig<2,3000,0>>,TrDelay<1500>,StyleFire<Stripes<2500,-5000,BrownNoiseFlicker<Blue,Black,20>,Rgb<0,0,10>,BrownNoiseFlicker<Black,Rgb<25,25,255>,70>,Rgb<0,0,128>>,Rgb<0,0,80>,0,5,FireConfig<2,3000,0>,FireConfig<2,3000,0>,FireConfig<2,3000,0>,FireConfig<2,3000,0>>,TrFade<800>>,EFFECT_FORCE>,TransitionEffectL<TrConcat<TrInstant,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<50>>,TrSmoothFade<600>>,EFFECT_LOCKUP_END>,ResponsiveLockupL<Strobe<White,BrownNoiseFlicker<White,Red,300>,50,1>,TrConcat<TrInstant,White,TrFade<400>>,TrFade<100>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>,Scale<SwingSpeed<100>,Int<10000>,Int<14000>>>,ResponsiveLightningBlockL<Strobe<White,AudioFlicker<White,Blue>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>>,ResponsiveStabL,ResponsiveBlastL<White,Int<400>,Scale<SwingSpeed<200>,Int<100>,Int<400>>>,ResponsiveClashL<White,TrInstant,TrFade<400>>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,Red,Orange>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipe<300>,TrWipeIn<500>>>>()},

{ “Bank12”, “tracks/JFO5.wav”,
StylePtr<Layers<Mix<Scale<BladeAngle<>,Int<32768>,Int<0>>,StyleFire<Gradient<RotateColorsX<Variation,Orange>,RotateColorsX<Variation,OrangeRed>,RotateColorsX<Variation,Red>>,RotateColorsX<Variation,Rgb<60,0,0>>,0,4,FireConfig<0,1500,5>,FireConfig<0,1500,5>,FireConfig<0,1500,5>,FireConfig<0,0,0>>,StyleFire<Gradient<RotateColorsX<Variation,DarkOrange>,RotateColorsX<Variation,Red>,RotateColorsX<Variation,Red>,RotateColorsX<Variation,Red>>,Black,0,2,FireConfig<0,1600,30>,FireConfig<0,1600,30>,FireConfig<0,1600,30>,FireConfig<0,0,0>>>,LockupTrL<Layers<AlphaL<AudioFlickerL,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>>,AlphaL<White,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>>,Int<10000>>>>,TrConcat<TrInstant,White,TrFade<400>>,TrConcat<TrInstant,White,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,ResponsiveLightningBlockL<Strobe<White,AudioFlicker<White,Blue>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>>,ResponsiveStabL<Orange,TrWipeIn<600>,TrWipe<600>>,ResponsiveBlastL<White,Int<400>,Scale<SwingSpeed<200>,Int<100>,Int<400>>,Int<400>>,ResponsiveClashL<White,TrInstant,TrFade<400>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>,Int<20000>>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,Rgb<255,200,0>,DarkOrange>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,AlphaL<Black,SmoothStep<Scale<BladeAngle<0,16000>,Scale<SwingSpeed<400>,Int<10000>,Int<38000>>,Int<38000>>,Int<20000>>>,InOutTrL<TrWipe<300>,TrWipeIn<500>,Black>>>()},

};
BladeConfig blades[] = {
{ 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
WS281XBladePtr<2, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin4, bladePowerPin5> >()
, CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, “pow”);
#endif

Your “default” presets have two styles each, your added presets only have one.
Try adding another style to those presets. (Either duplicate the one for the main blade, or copy one of the existing ones.)

1 Like

If you had the preset’s name/message part in quotes at the end of your added presets the way the default ones have, you would have received an error message when compiling and therefore been alerted to the issue :wink:

1 Like

I didn’t think the config would compile at all with an the number of blades in each preset not matching what is specified in config top section?

A wise Master once explained to me:

" It will compile successfully, but that’s not how it’s really meant to work.

The reason this happens at all is because struct initializations in C++ are allowed to NOT provide all values, and any value not provided is assumed to be NULL.

NULL is an acceptable style pointer and also an acceptable “message”.

So if NUM_BLADES is 4, and you have a preset like

{“font”, “track”, SOMESTYLE}

it is the same as

{“font”, “track”, SOMESTYLE, NULL, NULL, NULL }…the missing styles get filled in with NULL by the compiler, so it doesn’t consider your presets to be a mismatched number compared to NUM_BLADES and # of blades configured."

2 Likes

To my own surprise as well, it does.
When I get home from work tonight I will test my new config.

So this is similar to the way a blade style can have omitted values and use defaults, but can’t “skip over” non-provided arguments. All arguments need to be provided up to the modified argument.
Example.
The full template for Blast<> is:
Blast<BASE_COLOR, BLAST_COLOR, FADEOUT_TIME, WAVE_SIZE, WAVE_SPEED, EFFECT>
So
Blast<Blue,White>
is acceptable while the template uses defaults for fadeout time, wave size, wave speed, and EFFECT.
If you wanted to change the wave size (4th argument) to 150 instead of the default 100 though, you could not “skip” the fadeout time (3rd argument, default is 200) and would need to provide something for that argument place UP TO the changed default argument, such as:

Blast<Blue,White,200,150>
while here we’re still omitting the trailing arguments of wave speed and EFFECT.

So coming back to presets, by adding the “message” at the end, you are creating that “non-skippable” scenario for the missing blade style, and therefore get an error, which would prompt you towards your problem.
Hope that makes sense.

That was it! I just needed to duplicate the style as you suggested, for each one. Works perfectly.
thanks so much for your help.

1 Like