My Optimization is working great! 84%

Hi all, first time posting here and I’m excited!

I’ve been working on an uber blade style that is designed to use for seemingly “ANY” style that is not one of Fernando’s new interactive styles, so it combines Rotoscope, Unstable, Fallen Order, Energy Blades, and much more… and what I’ve created is working out great! I can design seemingly unlimited styles, including all canon I can think of, plus custom ones, and I’m only at 84% memory so far. I’m wondering if other people on here are doing things in a similar way. I’ll summarize:

I made a blade style with various options on it, then I dissected and commented the whole code to break it apart and organize it so I can easily customize each element. I then put all this in a separate “blade style” .h file that I am reading into my main config with using to keep things clean.

So now to customize it, I go to Fernando’s OS6 Style Library and select some options and blade styles that I want, then I open that up in a text editor to find the specific lines of code that I need, and add them to my uber style where they need to go. I can add or subtract options as needed for PreOn, PostOff, Ignition, Retraction, etc, to really customize what I want to have in there.

Mainly, I love that I am able to combine different blade styles, such as Rotoscope, Unstable, etc into the same overall style, and share common effects like Clash, Blast, and Lockup. I find that the majority of my blades I want to behave the same for those effects anyway, and I can customize and update them and it will update ALL of my blades! Pretty cool.

Below are two examples of my blade style for reference:


Layers<

//////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// BLADE STYLE OPTIONS //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////

ColorSelect<IntArg<STYLE_OPTION_ARG,0>,TrInstant,

	// COLOR 0 - AUDIO FLICKER (Original Trilogy) //
	 Mix<HoldPeakF<SwingSpeed<250>,Scale<SwingAcceleration<100>,Int<50>,Int<500>>,Scale<SwingAcceleration<>,Int<20000>,Int<10000>>>,RandomFlicker<StripesX<Int<15000>,Scale<HoldPeakF<SwingSpeed<200>,Scale<SwingAcceleration<100>,Int<50>,Int<300>>,Scale<SwingAcceleration<100>,Int<24000>,Int<16000>>>,Int<-3200>,Int<-200>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<7710>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<19276>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,

	// COLOR 1 - AUDIO FLICKER (Sequel Trilogy)//
	 Mix<HoldPeakF<SwingSpeed<250>,Scale<SwingAcceleration<100>,Int<50>,Int<500>>,Scale<SwingAcceleration<>,Int<20000>,Int<10000>>>,RandomFlicker<StripesX<Int<14000>,Scale<HoldPeakF<SwingSpeed<200>,Scale<SwingAcceleration<100>,Int<50>,Int<300>>,Scale<SwingAcceleration<100>,Int<24000>,Int<16000>>>,Int<-4000>,Int<-400>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<7710>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<19276>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,

	// COLOR 2 - FALLEN ORDER //
	 Stripes<16000,-1000,RgbArg<BASE_COLOR_ARG,Rgb<2,72,255>>,Pulsing<Mix<Int<11565>,Black,RgbArg<BASE_COLOR_ARG,Rgb<2,72,255>>>,RgbArg<BASE_COLOR_ARG,Rgb<2,72,255>>,800>,RgbArg<BASE_COLOR_ARG,Rgb<2,72,255>>>,

	// COLOR 3 - FAST FLICKER (Dual Color) //
	 AudioFlicker<Stripes<14000,-4000,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RgbArg<ALT_COLOR_ARG,Rgb<115,15,240>>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,Mix<Int<16448>,Black,RgbArg<ALT_COLOR_ARG,Rgb<115,15,240>>>>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,

	// COLOR 4 - THE TWINS (Dual Color Gradient) //
	 Mix<SmoothStep<Int<15000>,Int<18000>>,Stripes<22000,-2000,RgbArg<BASE_COLOR_ARG,Rgb<255,36,118>>,Mix<Int<18000>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,36,118>>>,HumpFlicker<Mix<Int<6000>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,36,118>>>,RgbArg<BASE_COLOR_ARG,Rgb<255,36,118>>,20>>,Stripes<20000,-1800,RgbArg<ALT_COLOR_ARG,Rgb<0,135,255>>,Mix<Int<18000>,Black,RgbArg<ALT_COLOR_ARG,Rgb<0,135,255>>>,HumpFlicker<Mix<Int<6000>,Black,RgbArg<ALT_COLOR_ARG,Rgb<0,135,255>>>,RgbArg<ALT_COLOR_ARG,Rgb<0,135,255>>,20>>>,

	// COLOR 5 - THE DUEL RONIN (Hump Flicker) //
	 HumpFlicker<Stripes<20000,-800,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,Mix<Int<12000>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,50>,

	// COLOR 6 - UNSTABLE KYLO //
	 StaticFire<BrownNoiseFlicker<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RandomPerLEDFlicker<Mix<Int<3213>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,Mix<Int<7710>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>,300>,Mix<Int<10280>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,0,6,10,1000,2>,
	
	// COLOR 7 - UNSTABLE UNLEASHED //
	 StaticFire<Stripes<2500,-5000,BrownNoiseFlicker<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,Black,20>,Mix<Int<1285>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,BrownNoiseFlicker<Black,Mix<Int<3212>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,White>,70>,Mix<Int<16384>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>,Mix<Int<10280>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,0,5,2,3000,0>,

	// COLOR 8 - MAGNAGUARD //
	 StaticFire<Strobe<RgbArg<BASE_COLOR_ARG,Rgb<118,0,194>>,Strobe<Rgb<100,100,150>,RandomPerLEDFlicker<RgbArg<BASE_COLOR_ARG,Rgb<118,0,194>>,Black>,50,1>,100,1>,Mix<Int<6425>,Black,RgbArg<BASE_COLOR_ARG,Rgb<118,0,194>>>,0,5,2,1000,5>,

	// COLOR 9 - DARK SABER //
	 Mix<HoldPeakF<SwingSpeed<400>,Scale<SwingAcceleration<>,Int<2000>,Int<4000>>,Int<8000>>,HumpFlicker<RgbArg<BASE_COLOR_ARG,Rgb<100,100,150>>,Stripes<35000,-200,Mix<Int<14000>,Black,RgbArg<BASE_COLOR_ARG,Rgb<100,100,150>>>,Mix<Int<24000>,Black,RgbArg<BASE_COLOR_ARG,Rgb<100,100,150>>>,Mix<Int<28000>,Black,RgbArg<BASE_COLOR_ARG,Rgb<100,100,150>>>>,100>,RgbArg<BASE_COLOR_ARG,Rgb<100,100,150>>>,

	// COLOR 10 - RAINBOW SCROLL / ROLLING RAINBOW UP //
	 AudioFlicker<Stripes<1000,-1200,Magenta,Blue,Cyan,Green,Yellow,Orange,Red>,Mix<Int<12000>,Stripes<1000,-1200,Magenta,Blue,Cyan,Green,Yellow,Orange,Red>,White>>,
	 //Mix<HoldPeakF<SwingSpeed<250>,Scale<SwingAcceleration<100>,Int<50>,Int<500>>,Scale<SwingAcceleration<>,Int<20000>,Int<10000>>>,RandomFlicker<StripesX<Int<15000>,Scale<HoldPeakF<SwingSpeed<200>,Scale<SwingAcceleration<100>,Int<50>,Int<300>>,Scale<SwingAcceleration<100>,Int<24000>,Int<16000>>>,Int<-3200>,Int<-200>>,RotateColorsX<Saw<Int<20>>,Gradient<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RotateColorsX<Int<-4000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,RotateColorsX<Int<-8000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>>,RotateColorsX<Saw<Int<20>>,Gradient<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RotateColorsX<Int<-4000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,RotateColorsX<Int<-8000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>>,Mix<Int<7710>,Black,RotateColorsX<Saw<Int<20>>,Gradient<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RotateColorsX<Int<-4000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,RotateColorsX<Int<-8000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>>>,RotateColorsX<Saw<Int<20>>,Gradient<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RotateColorsX<Int<-4000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,RotateColorsX<Int<-8000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>>,Mix<Int<19276>,Black,RotateColorsX<Saw<Int<20>>,Gradient<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RotateColorsX<Int<-4000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,RotateColorsX<Int<-8000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>>>>,RotateColorsX<Saw<Int<20>>,Gradient<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RotateColorsX<Int<-4000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,RotateColorsX<Int<-8000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>>>,RotateColorsX<Saw<Int<20>>,Gradient<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,RotateColorsX<Int<-4000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,RotateColorsX<Int<-8000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>>>>,

	// COLOR 11 - X-MAS STRIPES //
	 Stripes<1000,-1000,Red,White,Green,White>,

	// COLOR 12 - RED, WHITE, & BLUE //
	 //Pulsing<Stripes<2000,-800,Blue,White,Red>,Mix<Int<16000>,Stripes<2000,-800,Blue,White,Red>,White>,1600>
	 AudioFlicker<Stripes<2000,-800,Blue,Rgb<235,235,235>,Red>,Mix<Int<16000>,Stripes<2000,-800,Blue,Rgb<235,235,235>,Red>,White>>

>,
	//////////////////////////// EMITTER FLARE OPTIONS (Swing Option) ////////////////////////////////
	ColorSelect<IntArg<SWING_OPTION_ARG,0>,TrInstant,

		// FLARE 0 - Disable //
		 AlphaL<Black,Int<0>>,

		// FLARE 1 - Stable Flare //
		 AlphaL<RgbArg<EMITTER_COLOR_ARG,Rgb<255,255,255>>,SmoothStep<IntArg<EMITTER_SIZE_ARG,2000>,Int<-6000>>>,

		// FLARE 2 - Flickering Flare //
		 AlphaL<AudioFlickerL<RgbArg<EMITTER_COLOR_ARG,Rgb<255,255,255>>>,SmoothStep<IntArg<EMITTER_SIZE_ARG,2000>,Int<-6000>>>,

		// FLARE 3 - Unstable Flare //
		 AlphaL<RandomPerLEDFlickerL<RgbArg<EMITTER_COLOR_ARG,Rgb<255,255,255>>>,SmoothStep<Scale<NoisySoundLevel,IntArg<EMITTER_SIZE_ARG,2000>,Sum<IntArg<EMITTER_SIZE_ARG,2000>,Int<6000>>>,Int<-6000>>>

	>,
///////////////////////////////////////////////////////////////////////////////////////////


	//// BLAST ////
		//BLAST - RESPONSIVE CUSTOM //
		 //ResponsiveBlastFadeL<Mix<Int<28000>,RgbArg<BASE_COLOR_ARG,Blue>,Red>,Int<32000>>,ResponsiveBlastFadeL<LemonChiffon,Int<16000>>,ResponsiveBlastFadeL<White,Int<8000>>,
		 MultiTransitionEffectL<TrConcat<TrInstant,AlphaMixL<Bump<Scale<BladeAngle<>,Int<28000>,Int<8000>>,Int<10000>>,RgbArg<BLAST_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<16384>,Black,RgbArg<BLAST_COLOR_ARG,Rgb<255,255,255>>>>,TrFade<300>>,EFFECT_BLAST>,

	//// CLASH ////
		//RESPONSIVE CLASH//
		 //TransitionEffectL<TrConcat<TrInstant,AlphaL<RgbArg<CLASH_COLOR_ARG,Rgb<255,244,157>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,21099>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,21099>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,21099>,Int<-10000>>>,Scale<ClashImpactF<>,Int<12000>,Int<60000>>>>,TrFadeX<Scale<ClashImpactF<>,Int<200>,Int<400>>>>,EFFECT_CLASH>,
	
		//REAL CLASH v1//
		 TransitionEffectL<TrWaveX<Mix<Int<24000>,RgbArg<BASE_COLOR_ARG,Green>,White>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Int<100>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>>,EFFECT_CLASH>,

	//// LOCKUP ////
		//INTENSITY LOCKUP//
		 //LockupTrL<TransitionEffect<AlphaMixL<Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>,BrownNoiseFlickerL<RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,Int<200>>,StripesX<Int<1800>,Scale<NoisySoundLevel,Int<-3500>,Int<-5000>>,Mix<Int<6425>,Black,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>>,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,Mix<Int<12850>,Black,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>>>>,AlphaL<AudioFlicker<RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,Mix<Int<10280>,Black,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Int<13000>>>,TrJoin<TrDelay<8000>,TrInstant>,TrFade<3000>,EFFECT_LOCKUP_BEGIN>,TrConcat<TrJoin<TrDelay<50>,TrInstant>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,AlphaL<RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<ClashImpactF<>,Int<20000>,Int<60000>>>>>,TrFade<300>>,TrConcat<TrInstant,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,
	
		//RESPONSIVE LOCKUP//
		 LockupTrL<AlphaMixL<Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>,Int<64000>>,AudioFlickerL<RgbArg<LOCKUP_COLOR_ARG,White>>,BrownNoiseFlickerL<RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,Int<1000>>>,TrConcat<TrInstant,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,TrFade<400>>,TrConcat<TrInstant,RgbArg<LOCKUP_COLOR_ARG,LemonChiffon>,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,

	//// LIGHTNING BLOCK ////
		LockupTrL<AlphaL<RgbArg<LB_COLOR_ARG,Rgb<85,85,200>>,LayerFunctions<Bump<Scale<SlowNoise<Int<2000>>,Int<3000>,Int<16000>>,Scale<BrownNoiseF<Int<10>>,Int<14000>,Int<8000>>>,Bump<Scale<SlowNoise<Int<2300>>,Int<26000>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<10000>>>,Bump<Scale<SlowNoise<Int<2300>>,Int<20000>,Int<30000>>,Scale<IsLessThan<SlowNoise<Int<1500>>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<0>>,Int<0>>>>>,TrConcat<TrInstant,AlphaL<RgbArg<LB_COLOR_ARG,Rgb<85,85,200>>,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<RgbArg<LB_COLOR_ARG,Rgb<85,85,200>>,Int<16000>>,30>,TrSmoothFade<600>>,SaberBase::LOCKUP_LIGHTNING_BLOCK>,

	//// DRAG ////
		LockupTrL<AlphaL<RandomPerLEDFlickerL<Mix<Int<24000>,RgbArg<BASE_COLOR_ARG,Green>,LemonChiffon>>,SmoothStep<IntArg<DRAG_SIZE_ARG,28921>,Int<3000>>>,TrConcat<TrJoin<TrDelay<4000>,TrWipeIn<200>>,AlphaL<BrownNoiseFlickerL<Mix<Int<24000>,RgbArg<BASE_COLOR_ARG,Green>,LemonChiffon>,Int<300>>,SmoothStep<IntArg<DRAG_SIZE_ARG,28921>,Int<3000>>>,TrFade<4000>>,TrFade<300>,SaberBase::LOCKUP_DRAG>,

	//// MELT ////
		LockupTrL<AlphaL<Remap<Scale<RampF,Int<65536>,Int<0>>,StaticFire<Mix<TwistAngle<>,Mix<Int<16384>,RgbArg<BASE_COLOR_ARG,Green>,Rgb<255,24,0>>,RotateColorsX<Int<3000>,Mix<Int<16384>,RgbArg<BASE_COLOR_ARG,Green>,Rgb<255,24,0>>>>,Mix<TwistAngle<>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>,RotateColorsX<Int<3000>,Mix<Int<12000>,Black,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>>,0,3,5,3000,10>>,SmoothStep<IntArg<MELT_SIZE_ARG,29202>,Int<4000>>>,TrConcat<TrWipeIn<100>,AlphaL<RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,SmoothStep<IntArg<MELT_SIZE_ARG,29202>,Int<4000>>>,TrJoin<TrDelay<4000>,TrFade<300>>,AlphaL<Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>,SmoothStep<IntArg<MELT_SIZE_ARG,29202>,Int<4000>>>,TrFade<4000>>,TrWipe<200>,SaberBase::LOCKUP_MELT>,


	//////////////////////////////////// IGNITION OPTIONS /////////////////////////////////////
	InOutTrL<TrSelect<IntArg<IGNITION_OPTION_ARG,0>,

		// IGNITION 0 - Reg On //
		 TrWipeX<IgnitionTime<300>>,

		// IGNITION 1 - Spark Tip On //
		 TrWipeSparkTipX<RgbArg<IGNITION_COLOR_ARG,Rgb<255,187,108>>,IgnitionTime<300>>,

		// IGNITION 2 - Lightning Flash On //
		 TrConcat<TrWipeInX<Mult<IgnitionTime<300>,Int<6553>>>,RandomBlink<30000,RgbArg<IGNITION_COLOR_ARG,Rgb<255,187,108>>,Black>,TrJoin<TrDelayX<Mult<IgnitionTime<300>,Int<19660>>>,TrWipeInX<Mult<IgnitionTime<230>,Int<6553>>>>,Mix<SmoothStep<Scale<SlowNoise<Int<30000>>,IntArg<EMITTER_SIZE_ARG,1000>,Sum<Int<5000>,IntArg<EMITTER_SIZE_ARG,1000>>>,Int<-3000>>,Black,RgbArg<IGNITION_COLOR_ARG,Rgb<255,187,108>>>,TrWipeX<Mult<IgnitionTime<300>,Int<19660>>>>,

		// IGNITION 3 - Glitch On //
		 TrConcat<TrJoin<TrDelayX<Mult<IgnitionTime<300>,Int<16384>>>,TrWipeX<Mult<IgnitionTime<300>,Int<16384>>>>,Mix<SmoothStep<NoisySoundLevel,Int<-1>>,Black,RgbArg<IGNITION_COLOR_ARG,Rgb<255,97,0>>>,TrWipeX<Mult<IgnitionTime<300>,Int<16384>>>>
		>,

	///////////////////////////////////////////////////////////////////////////////////////////


	////////////////////////////////// RETRACTION OPTIONS /////////////////////////////////////
	TrSelect<IntArg<RETRACTION_OPTION_ARG,0>,

		// RETRACTION 0 - Reg Off //
		 TrWipeInX<RetractionTime<0>>,

		// RETRACTION 1 - Glitch Off //
		 TrConcat<TrJoin<TrDelayX<Mult<RetractionTime<0>,Int<16384>>>,TrWipeInX<Mult<RetractionTime<0>,Int<16384>>>>,Mix<SmoothStep<NoisySoundLevel,Int<-1>>,Black,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>>,TrWipeInX<Mult<RetractionTime<0>,Int<16384>>>>,

		// RETRACTION 2 - Cycle Down //
		 TrColorCycleX<RetractionTime<0>>,

		 // RETRACTION 3 - Spark Tip Off //
		 TrWipeInSparkTipX<RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>,RetractionTime<0>>

	>,Black>,
	////////////////////////////////////////////////////////////////////////////////////////////

Thoughts? Suggestions?

Thanks for reading!
~Jeff

Cool, just so you’re aware the Combo Builder in the library can do this for you as well:

Ah, that is cool! I didn’t notice that one, thanks. I have everything in my code separated and good to go; I just add a line of code, and voilà new blade style option!

Is there any way to access the code in your library directly? For instance, if I choose the Glitch On Ignition Effect, I could copy that exact line of code (i.e. TrConcat<TrJoin<TrDelayX<Mult<IgnitionTime...) without all the other parts of the blade style? That would save a couple steps.

No, the library doesn’t build the style code until you’ve made all of your selections, then it puts it all together.

Cool! I’d started doing something similar, but I hadn’t gotten that far with it. I had basically put all of the cannon styles in one blade, energy styles in another, and other effects (flame, rainbow, etc) in a separate one. I’m really liking putting them all together though!

Nice! Yeah, once I started putting them all together, my memory started going down and down - very cool. I feel like you can create the vast majority of blades with one style, then have room for different interactive-type styles separately that are coming in the future.

One thing I haven’t played with yet, however, is incorporating the various “Color Types” into this. The code there is pretty long and specific on each one, so that will either take more investigation or perhaps a separate blade style.

Color Types?

Newer options in OS6 - advanced gradients and color shifts:

That Combo Builder linked above handles that for you if you’re wanting to apply color and style modifiers to a group of styles.

Just a note, if you’re not doing already you’ll want to test the styles on your saber. There’s a threshold where the number of options in a single style can impact performance so while you may squeeze a little FLASH memory out, you may find the style acts sluggish for certain options. It varies by how different the layers themselves are, but there’s a point of diminishing returns as you build out styles with 1000s of combinations so I recommend testing as you add more and more to it.

1 Like

Would that sluggishness impact other styles/presets too (even if it’s not the one with all of the options)? I have 6 styles on my saber. 5 of those have a number of options for style, preon, ignition, retraction, etc. The sixth one is a flame blade. For some reason, that one is consistently sluggish when I don’t notice sluggishness in the others. Do I likely just have too many options?

No, only 1 style is loaded at a time. Now if that style has 100s or 1000s of combinations in it then that may explain it.
Another cause of laggy effects is SD speed, run ‘sd test’ in Serial Monitor. A slow or bad SD card will cause effects to lag.
Fire styles in particular require a lot of processing so a slow SD can affect them.

Slow things add up, in particular:

  • having more than 200 pixels in your blade style
  • very complicated styles
  • fire- or sparkle-styles
  • slow SD cards

Depending on available space, you may be able to combat some of this by turning on optimization in Arduino though.

@Jakmar Do you have options in the flame blade? Might be that, or as they’re saying, your SD card perhaps…

I have a “main blade” style that has a lot of options, of which I’ve talked about - been testing that consistently using the actual blade, and it performs without any issue.

I have a separate flame blade style from Fett’s style library, which has no options on it and it performs smoothly.

Thanks to everyone for the input. I ran a few tests. I’m not using options in my fire style. I actually think it might have something to do with the particular font I was using (This one happened to be Banished Prince by GreyScale). I tried using a different font with that same style and didn’t notice the sluggishness I was experiencing. I also ran sdtest, but I’m not sure how to interpret the results:

22:47:20.025 -> Time to open files: Average time: 4611.13 us
22:47:20.025 ->                                                                                                    .
22:47:20.025 ->                                                                                                    :
22:47:20.025 ->                                                                                                    :
22:47:20.025 ->                                                                                                    :
22:47:20.025 ->                                                                                                    :
22:47:20.025 ->                                                     :                                              :
22:47:20.025 ->                                                    ::                                              :
22:47:20.025 ->                                                    ::                                              :
22:47:20.025 ->                                                    ::                                              :
22:47:20.025 ->                                                    ::        .        .         :        .        ::
22:47:20.025 ->                                ::         .:      .::..     :::      .::       ::.      ::.       ::
22:47:20.025 -> x100us              1                   2                   3                   4                   5
22:47:20.025 -> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
22:47:20.025 -> Time to read blocks: Average speed: 1164.90 kb/s, 13.21 simultaneous audio streams.
22:47:20.025 ->                                                                                                     
22:47:20.025 ->         :                                                                                           
22:47:20.025 ->         :                                                                                           
22:47:20.025 ->         :                                                                                           
22:47:20.025 ->         :                                                                                           
22:47:20.025 ->         :                                                                                           
22:47:20.025 ->         :                                                                                           
22:47:20.025 ->         :                                                                                           
22:47:20.025 ->         ::                                                                                          
22:47:20.025 ->         ::                                                                                          
22:47:20.025 ->        :::..    .   ...      .      .                                                               
22:47:20.025 -> x100us              1                   2                   3                   4                   5
22:47:20.025 -> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0

sdtest speeds are not terrible. Time to open files might get a boost if you adhere to this:

PSA: Faster performance of fonts / blade animations.

As blade styles become more complex, combined with some pixel strips having more LEDs in serial, you may find less animation lag and fewer Audio Underflows (pops, clicks, gaps) by optimizing your font folder structure.

Sounds with multiple files should live in subfolders, such as a clsh folder containing clsh01.wav, clsh02.wav etc… while single files, such as lock01.wav should live in the font root.

As per Fredrik Hubinette, the current ProffieOS will perform best if you cater to the way that FAT32 formatting works. "Read up on the FAT32 format. It seems like each block can contain 16 file entries. So, if you have 128 files in one directory, (ProffieOS) has to read on average 4 blocks to find the the file. If you have 16 subdirectories with 16 files each, only 2 blocks have to be read. It may be possible to optimize this by adding most commonly used files (hum) first. Also, ProffieOS might be able to improve on this with some caching. (Future development)

For effects that only have one sound, it should be more efficient to not put them into a sub-directory."

1 Like

Thanks for the reminder! I had started going through my fonts to do that, but I hadn’t finished. I’ll do that too

1 Like