NoSloppy

Dual_Blade_Example

Apr 4th, 2024 (edited)
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.77 KB | None | 0 0
  1. // Example Dual Blade staff saber config file with example blade style for ProffieOS Dual Blade feature.
  2. // Designed for use with saber_BC_buttons.h prop file, but can be used with any controls.
  3. // This is not an Edit Mode or ProffieOS Workbench compatible style. However,
  4. // it does use the "classic" ColorWheel (variation) based ColorChange mode.
  5. // The Main Blade is designated by board orientation, having the USB port of the Proffieboard
  6. // facing away from the blade end (where a typical Single blade saber would be).
  7. // The unique thing about these styles is that the effects show on the blades based on blade angle.
  8. // - Effects shown on the staff blade that's above horizontal: Clash, Blaster Deflection, Lockup.
  9. // - Shown on staff blade that's pointing down: Drag.
  10. // - Shown on blade that is stabbing: Stab.
  11. // - Shown on Main blade only: Melt
  12. // - Shown on both blades regardless of blade angle: Lightning Block, Force Effect, Powersave Dim.
  13.  
  14. #ifdef CONFIG_TOP
  15. // all the usual lines from your config go here. You just need to be sure to add this:
  16. #define BC_DUAL_BLADES
  17. // BLADE # corresponds to the blades list in the BladeConfig section of the config file.
  18. // Defaults are BLADE 1 and BLADE 2 as MAIN and SECOND blades respectively.
  19. // Optionally, you can also manually define custom dual blades if different than position 1 and 2 in the preset and the
  20. // BladeConfig list, for example:
  21. // #define BC_MAIN_BLADE 2
  22. // #define BC_SECOND_BLADE 4
  23.  
  24. #endif
  25.  
  26. #ifdef CONFIG_PROP
  27. #include "../props/saber_BC_buttons.h"
  28. #endif
  29.  
  30. #ifdef CONFIG_PRESETS
  31.  
  32. { "2ndSistr;common", "2ndSistr/tracks/Enter_The_Inquisitor.wav",
  33. // Blade 1 - Main Blade
  34. StylePtr<Layers<
  35. Mix<SwingSpeed<300>,StaticFire<BrownNoiseFlicker<RotateColorsX<Variation,Red>,RandomPerLEDFlicker<RotateColorsX<Variation,Rgb<25,0,0>>,RotateColorsX<Variation,Rgb<60,0,0>>>,300>,RotateColorsX<Variation,Rgb<80,0,0>>,0,6,10,1000,2>,AudioFlicker<RotateColorsX<Variation,Red>,RotateColorsX<Variation,Rgb<128,0,0>>>>,
  36. AlphaL<Layers< // Only show this Alpha Layer group of effects on staff blade that's pointing up.
  37. // Clash - Clash Impact sensitive,
  38. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,
  39. AlphaL<TransitionEffect<
  40. TransitionEffect<
  41. Strobe<Black,Yellow,20,20>,
  42. BrownNoiseFlicker<Rgb<100,200,255>,Black,300>,TrInstant,TrFade<300>,EFFECT_CLASH>,
  43. Rgb<100,200,255>,TrInstant,TrDelayX<Percentage<WavLen<EFFECT_CLASH>,25>>,EFFECT_CLASH>,
  44. Bump<Scale<BladeAngle<>,Int<25000>,Int<8000>>,Scale<ClashImpactF<>,Int<4000>,Int<32768>>>>,TrFadeX<Percentage<WavLen<EFFECT_CLASH>,65>>>,EFFECT_CLASH>,
  45. // Blast
  46. TransitionEffectL<TrConcat<
  47. // Impact Flash
  48. TrInstant,GreenYellow,TrDelay<25>>,EFFECT_BLAST>,
  49. // Waves
  50. BlastL<Rgb<100,200,255>,850,250,351>,
  51. // Impact point afterimage
  52. AlphaL<TransitionEffectL<TrConcat<TrFade<300>,Rgb<70,70,255>,TrFade<300>>,EFFECT_BLAST>,BlastF<700,250,100000>>,
  53. // Impact point
  54. BlastL<Rgb<100,200,255>,300,350,100000>,
  55. // Lockup - BC custom range mid-blade
  56. TransitionEffectL<TrConcat<TrInstant,Strobe<GreenYellow,Black,20,30>,TrFade<200>,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<5000>>,TrJoinR<TrWipe<200>,TrWipeIn<200>,TrFade<300>>>,EFFECT_LOCKUP_END>,
  57. LockupTrL<Layers<
  58. //Random Strobe Flash no dimming
  59. AlphaL<TransitionLoopL<TrConcat<TrDelayX<Scale<SlowNoise<Int<3000>>,Int<30>,Int<800>>>,Mix<SlowNoise<Int<1000>>,Black,Black,White,Black>,TrDelayX<Scale<SlowNoise<Int<1000>>,Int<10>,Int<50>>>>>,Int<32768>>,
  60. // Bottom Layer Bump - random width
  61. AlphaL<Strobe<Rgb<200,200,200>,BrownNoiseFlicker<White,Blue,300>,30,20>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Scale<SlowNoise<Int<3000>>,Int<10000>,Int<18000>>>>,
  62. // Top Layer Bump - fixed width
  63. AlphaL<Strobe<White,BrownNoiseFlicker<White,Black,200>,50,30>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Int<10000>>>>,
  64. // Begin Lockup Transition
  65. TrConcat<TrInstant,AlphaL<Blinking<White,Strobe<BrownNoiseFlicker<Orange,Black,500>,Black,15,30>,60,500>,Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Scale<SlowNoise<Int<3000>>,Int<25000>,Int<32000>>>>,TrFade<500>>,
  66. // End Lockup Transition
  67. TrSmoothFade<900>,SaberBase::LOCKUP_NORMAL>,
  68. TransitionEffectL<TrConcat<TrInstant,AlphaL<Strobe<GreenYellow,Black,20,30>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Int<15000>>>,TrFade<600>>,EFFECT_LOCKUP_BEGIN>,
  69. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,HumpFlickerL<Strobe<AlphaL<White,Int<20000>>,Black,20,30>,30>,TrSmoothFade<225>>,EFFECT_LOCKUP_BEGIN>>,
  70. IsGreaterThan<BladeAngle<>,Int<16384>>>,
  71.  
  72. AlphaL< // Only show this Alpha Layer group of effects on staff blade that's pointing down.
  73. // Non-Responsive Drag - trickle fadeout
  74. LockupTrL<AlphaL<AudioFlicker<BrownNoiseFlicker<Strobe<Black,OrangeRed,20,25>,Yellow,200>,White>,SmoothStep<Int<30000>,Int<2000>>>,TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrFade<150>>,TrColorCycle<1500,-2000,100>,SaberBase::LOCKUP_DRAG>,
  75. IsLessThan<BladeAngle<>,Int<16384>>>,
  76.  
  77. // Force Choke / lightning - WavLen duration sync.
  78. TransitionEffectL<TrConcat<TrSmoothFadeX<Percentage<WavLen<EFFECT_FORCE>,20>>,Strobe<Black,Rgb<80,0,0>,30,30>,TrFadeX<Percentage<WavLen<EFFECT_FORCE>,60>>,StaticFire<Red,Strobe<Black,Cyan,30,30>,0,3,300>,TrFadeX<Percentage<WavLen<EFFECT_FORCE>,20>>>,EFFECT_FORCE>,
  79. // Dim Blade 50% "Power Save" button combo
  80. EffectSequence<EFFECT_POWERSAVE,AlphaL<Black,Int<16384>>,AlphaL<Black,Int<0>>>,
  81. // Lightning Block - Non-responsive. BC custom color (purple hint w/ random strobe flashes because....lightning)
  82. LockupTrL<Layers<
  83. //Random Strobe Flash and ~50% base blade dimming to make LB pop
  84. AlphaL<Black,Int<16000>>,
  85. AlphaL<White,StrobeF<Scale<SlowNoise<Int<1000>>,Int<1>,Int<6>>,Scale<SlowNoise<Int<1000>>,Int<10>,Int<50>>>>,
  86. AlphaL<RandomFlicker<Strobe<Rgb<100,200,255>,Rgb<60,0,255>,50,10>,BrownNoiseFlicker<Rgb<60,0,255>,Black,500>>,LayerFunctions<
  87. Bump<Scale<SlowNoise<Int<2000>>,Int<3000>,Int<16000>>,Scale<BrownNoiseF<Int<10>>,Int<14000>,Int<8000>>>,
  88. Bump<Scale<SlowNoise<Int<2300>>,Int<26000>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<10000>>>,
  89. Bump<Scale<SlowNoise<Int<2300>>,Int<20000>,Int<30000>>,Scale<IsLessThan<SlowNoise<Int<1500>>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<0>>,Int<0>>>>>>,
  90. // Begin Lightning Transition
  91. TrConcat<TrInstant,GreenYellow,TrDelay<25>,BrownNoiseFlicker<Rgb<60,0,255>,Black,500>,TrFade<100>>,
  92. // End Lightning Transition
  93. TrConcat<TrInstant,GreenYellow,TrDelay<25>,BrownNoiseFlicker<Rgb<60,0,255>,Black,500>,TrFade<150>,BrownNoiseFlickerL<AlphaL<Rgb<100,200,255>,Int<16000>>,Int<50>>,TrJoinR<TrWipe<200>,TrWipeIn<200>,TrFade<400>> >,SaberBase::LOCKUP_LIGHTNING_BLOCK>,
  94.  
  95. // Stab - OrangeRed stripes. WavLen duration sync.
  96.  
  97. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrWipeInX<Percentage<WavLen<EFFECT_STAB>,30>>,AlphaL<Stripes<5000,1000,Orange,DarkOrange,Rgb<150,60,0>,Rgb<60,30,0>,Rgb<150,14,0>,OrangeRed>,SmoothStep<Int<20000>,Int<20000>>>,TrJoin<TrSmoothFadeX<Percentage<WavLen<EFFECT_STAB>,90>>,TrWipeX<Percentage<WavLen<EFFECT_STAB>,70>>>>,EFFECT_STAB>,
  98.  
  99. // Melt on Main blade only
  100. // Melt
  101. LockupTrL<
  102. // Based on "Intensity Melt" - Fett263. Remap Fire to travel tip->emitter, Custom Begin and End Transitions)
  103. AlphaL<Remap<Scale<RampF,Int<65536>,Int<0>>,StaticFire<Mix<TwistAngle<>,Rgb16<20393,93,93>,DarkOrange>,Mix<TwistAngle<>,Rgb16<20393,93,93>,Orange>,0,4,5,4000,10>>,
  104. // Melt Shape
  105. SmoothStep<Scale<TwistAngle<>,Int<24000>,Int<29000>>,Int<4000>>>,
  106. // Melt Begin and End transitions
  107. TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrWipeIn<600>,AlphaL<Red,SmoothStep<Scale<TwistAngle<>,Int<24000>,Int<29000>>,Int<2000>>>,TrExtend<3000,TrFade<300>>,AlphaL<Mix<TwistAngle<>,Red,Orange>,SmoothStep<Scale<TwistAngle<>,Int<24000>,Int<29000>>,Int<2000>>>,TrFade<3000>>,TrColorCycle<1500,-2000>,SaberBase::LOCKUP_MELT>,
  108. TransitionEffectL<TrConcat<TrDelayX<Percentage<WavLen<>,50>>,TrFadeX<Percentage<WavLen<>,30>>,AlphaL<AudioFlicker<White,Black>,Bump<Int<0>,Int<6000>>>,TrInstant>,EFFECT_RETRACTION>,
  109. TransitionEffectL<TrConcat<TrInstant,AlphaL<AudioFlicker<White,Black>,Bump<Int<0>,Int<6000>>>,TrFadeX<Percentage<WavLen<>,50>>>,EFFECT_IGNITION>,
  110. InOutTrL<
  111. TrWipeX<BendTimePowInvX<WavLen<EFFECT_IGNITION>,Int<196608>>>,
  112. TrWipeInX<BendTimePowX<WavLen<EFFECT_RETRACTION>,Int<180000>>>>,
  113. OnDemandVolumeLevel,
  114. OnDemandBatteryLevel
  115. >>(),
  116.  
  117. // Blade 2 - Second Blade
  118. StylePtr<Layers<
  119. Mix<SwingSpeed<300>,StaticFire<BrownNoiseFlicker<RotateColorsX<Variation,Red>,RandomPerLEDFlicker<RotateColorsX<Variation,Rgb<25,0,0>>,RotateColorsX<Variation,Rgb<60,0,0>>>,300>,RotateColorsX<Variation,Rgb<80,0,0>>,0,6,10,1000,2>,AudioFlicker<RotateColorsX<Variation,Red>,RotateColorsX<Variation,Rgb<128,0,0>>>>,
  120. AlphaL<Layers< // Only show this Alpha Layer group of effects on staff blade that's pointing up.
  121. // Clash - Clash Impact sensitive,
  122. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,
  123. AlphaL<TransitionEffect<
  124. TransitionEffect<
  125. Strobe<Black,Yellow,20,20>,
  126. BrownNoiseFlicker<Rgb<100,200,255>,Black,300>,TrInstant,TrFade<300>,EFFECT_CLASH>,
  127. Rgb<100,200,255>,TrInstant,TrDelayX<Percentage<WavLen<EFFECT_CLASH>,25>>,EFFECT_CLASH>,
  128. Bump<Scale<BladeAngle<>,Int<25000>,Int<8000>>,Scale<ClashImpactF<>,Int<4000>,Int<32768>>>>,TrFadeX<Percentage<WavLen<EFFECT_CLASH>,65>>>,EFFECT_CLASH>,
  129. // Blast
  130. TransitionEffectL<TrConcat<
  131. // Impact Flash
  132. TrInstant,GreenYellow,TrDelay<25>>,EFFECT_BLAST>,
  133. // Waves
  134. BlastL<Rgb<100,200,255>,850,250,351>,
  135. // Impact point afterimage
  136. AlphaL<TransitionEffectL<TrConcat<TrFade<300>,Rgb<70,70,255>,TrFade<300>>,EFFECT_BLAST>,BlastF<700,250,100000>>,
  137. // Impact point
  138. BlastL<Rgb<100,200,255>,300,350,100000>,
  139. // Lockup - BC custom range mid-blade
  140. TransitionEffectL<TrConcat<TrInstant,Strobe<GreenYellow,Black,20,30>,TrFade<200>,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<5000>>,TrJoinR<TrWipe<200>,TrWipeIn<200>,TrFade<300>>>,EFFECT_LOCKUP_END>,
  141. LockupTrL<Layers<
  142. //Random Strobe Flash no dimming
  143. AlphaL<TransitionLoopL<TrConcat<TrDelayX<Scale<SlowNoise<Int<3000>>,Int<30>,Int<800>>>,Mix<SlowNoise<Int<1000>>,Black,Black,White,Black>,TrDelayX<Scale<SlowNoise<Int<1000>>,Int<10>,Int<50>>>>>,Int<32768>>,
  144. // Bottom Layer Bump - random width
  145. AlphaL<Strobe<Rgb<200,200,200>,BrownNoiseFlicker<White,Blue,300>,30,20>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Scale<SlowNoise<Int<3000>>,Int<10000>,Int<18000>>>>,
  146. // Top Layer Bump - fixed width
  147. AlphaL<Strobe<White,BrownNoiseFlicker<White,Black,200>,50,30>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Int<10000>>>>,
  148. // Begin Lockup Transition
  149. TrConcat<TrInstant,AlphaL<Blinking<White,Strobe<BrownNoiseFlicker<Orange,Black,500>,Black,15,30>,60,500>,Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Scale<SlowNoise<Int<3000>>,Int<25000>,Int<32000>>>>,TrFade<500>>,
  150. // End Lockup Transition
  151. TrSmoothFade<900>,SaberBase::LOCKUP_NORMAL>,
  152. TransitionEffectL<TrConcat<TrInstant,AlphaL<Strobe<GreenYellow,Black,20,30>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Int<15000>>>,TrFade<600>>,EFFECT_LOCKUP_BEGIN>,
  153. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,HumpFlickerL<Strobe<AlphaL<White,Int<20000>>,Black,20,30>,30>,TrSmoothFade<225>>,EFFECT_LOCKUP_BEGIN>>,
  154. IsLessThan<BladeAngle<>,Int<16384>>>,
  155.  
  156.  
  157. AlphaL< // Only show this Alpha Layer group of effects on staff blade that's pointing down.
  158. // Non-Responsive Drag - trickle fadeout
  159. LockupTrL<AlphaL<AudioFlicker<BrownNoiseFlicker<Strobe<Black,OrangeRed,20,25>,Yellow,200>,White>,SmoothStep<Int<30000>,Int<2000>>>,TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrFade<150>>,TrColorCycle<1500,-2000,100>,SaberBase::LOCKUP_DRAG>,
  160. IsGreaterThan<BladeAngle<>,Int<16384>>>,
  161.  
  162. // Force Choke / lightning - WavLen duration sync.
  163. TransitionEffectL<TrConcat<TrSmoothFadeX<Percentage<WavLen<>,20>>,Strobe<Black,Rgb<80,0,0>,30,30>,TrFadeX<Percentage<WavLen<>,60>>,StaticFire<Red,Strobe<Black,Cyan,30,30>,0,3,300>,TrFadeX<Percentage<WavLen<>,20>>>,EFFECT_FORCE>,
  164. // Dim Blade 50% "Power Save" button combo
  165. EffectSequence<EFFECT_POWERSAVE,
  166. AlphaL<Black,Int<16384>>,
  167. AlphaL<Black,Int<0>>>,
  168. // Lightning Block - Non-responsive. BC custom color (purple hint w/ random strobe flashes because....lightning)
  169. LockupTrL<Layers<
  170. //Random Strobe Flash and ~50% base blade dimming to make LB pop
  171. AlphaL<Black,Int<16000>>,
  172. AlphaL<White,StrobeF<Scale<SlowNoise<Int<1000>>,Int<1>,Int<6>>,Scale<SlowNoise<Int<1000>>,Int<10>,Int<50>>>>,
  173. AlphaL<RandomFlicker<Strobe<Rgb<100,200,255>,Rgb<60,0,255>,50,10>,BrownNoiseFlicker<Rgb<60,0,255>,Black,500>>,LayerFunctions<
  174. Bump<Scale<SlowNoise<Int<2000>>,Int<3000>,Int<16000>>,Scale<BrownNoiseF<Int<10>>,Int<14000>,Int<8000>>>,
  175. Bump<Scale<SlowNoise<Int<2300>>,Int<26000>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<10000>>>,
  176. Bump<Scale<SlowNoise<Int<2300>>,Int<20000>,Int<30000>>,Scale<IsLessThan<SlowNoise<Int<1500>>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<0>>,Int<0>>>>>>,
  177. // Begin Lightning Transition
  178. TrConcat<TrInstant,GreenYellow,TrDelay<25>,BrownNoiseFlicker<Rgb<60,0,255>,Black,500>,TrFade<100>>,
  179. // End Lightning Transition
  180. TrConcat<TrInstant,GreenYellow,TrDelay<25>,BrownNoiseFlicker<Rgb<60,0,255>,Black,500>,TrFade<150>,BrownNoiseFlickerL<AlphaL<Rgb<100,200,255>,Int<16000>>,Int<50>>,TrJoinR<TrWipe<200>,TrWipeIn<200>,TrFade<400>> >,SaberBase::LOCKUP_LIGHTNING_BLOCK>,
  181. // Stab - OrangeRed stripes. WavLen duration sync.
  182. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrWipeInX<Percentage<WavLen<EFFECT_STAB>,30>>,AlphaL<Stripes<5000,1000,Orange,DarkOrange,Rgb<150,60,0>,Rgb<60,30,0>,Rgb<150,14,0>,OrangeRed>,SmoothStep<Int<20000>,Int<20000>>>,TrJoin<TrSmoothFadeX<Percentage<WavLen<EFFECT_STAB>,90>>,TrWipeX<Percentage<WavLen<EFFECT_STAB>,70>>>>,EFFECT_STAB>,
  183. // No Melt on Secondary blade... yet
  184. TransitionEffectL<TrConcat<TrDelayX<Percentage<WavLen<>,50>>,TrFadeX<Percentage<WavLen<>,30>>,AlphaL<AudioFlicker<White,Black>,Bump<Int<0>,Int<6000>>>,TrInstant>,EFFECT_RETRACTION>,
  185. TransitionEffectL<TrConcat<TrInstant,AlphaL<AudioFlicker<White,Black>,Bump<Int<0>,Int<6000>>>,TrFadeX<Percentage<WavLen<>,50>>>,EFFECT_IGNITION>,
  186. InOutTrL<
  187. TrWipeX<BendTimePowInvX<WavLen<EFFECT_IGNITION>,Int<196608>>>,
  188. TrWipeInX<BendTimePowX<WavLen<EFFECT_RETRACTION>,Int<180000>>>>,
  189. OnDemandVolumeLevel,
  190. OnDemandBatteryLevel
  191. >>(),
  192. "dual blades\nexample"}
  193. };
  194.  
  195. BladeConfig blades[] = {
  196. { 0,
  197. WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // Main Blade 1
  198. WS281XBladePtr<144, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin4, bladePowerPin5> >(), // Main Blade 2
  199. CONFIGARRAY(preset), "SavedFiles"},
  200. };
  201. #endif
  202.  
  203. #ifdef CONFIG_BUTTONS
  204. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  205. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  206. #endif
  207.  
Advertisement
Add Comment
Please, Sign In to add comment