Advertisement
NoSloppy

Dual_Blade_Example

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