NoSloppy

Untitled

Mar 9th, 2020
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.03 KB | None | 0 0
  1. TEMPLATES SYNTAX SUMMARY:
  2. A compiled list of (mostly) all the style and transition templates in one place for easy reference.
  3.  
  4. As of ProffieOS 2.8:
  5.  
  6. Bump<BUMP_POSITION, BUMP_WIDTH_FRACTION>
  7. // Returns different values for each LED, forming a bump shape.
  8. // If BUMP_POSITION is 0, bump will be at the hilt.
  9. // If BUMP_POSITION is 32768, the bump will be at the tip.
  10. // If BUMP_WIDTH_FRACTION is 1, bump will be extremely narrow.
  11. // If BUMP_WIDTH_FRACTION is 32768, it will fill up most/all of the blade.
  12. // BUMP_POSITION, BUMP_WIDTH_FRACTION: INTEGER
  13. ChangeSlowly<F, SPEED>
  14. // Changes F by no more than SPEED values per second.
  15. // F, SPEED: INTEGER
  16. // return value: INTEGER, same for all LEDs
  17. Ifon<A, B>
  18. // Returns A if saber is on, B otherwise.
  19. // A, B: INTEGER
  20. // return value: INTEGER
  21. InOutFunc<OUT_MILLIS, IN_MILLIS>
  22. // IN_MILLIS, OUT_MILLIS: a number
  23. // RETURN VALUE: FUNCTION
  24. // 0 when off, 32768 when on, takes OUT_MILLIS to go from 0 to 32768
  25. // takes IN_MILLIS to go from 32768 to 0.
  26. Int<N>
  27. // Returns N
  28. // N: a number
  29. // return value: INTEGER
  30. Scale<F, A, B>
  31. // Changes values in range 0 - 32768 to A-B
  32. // F, A, B: INTEGER
  33. // return value: INTEGER
  34. Sin<RPM, LOW, HIGH>
  35. // pulses between LOW - HIGH RPM times per minute
  36. // LOW: INTEGER (defaults to Int<0>)
  37. // HIGH: INTEGER (defaults to Int<32768>)
  38. // RPM: INTEGER
  39. // return value: INTEGER
  40.  
  41.  
  42. Trigger<EFFECT, FADE_IN_MILLIS, SUSTAIN_MILLIS, FADE_OUT_MILLIS>
  43. // Normally returns 0, but when EFFECT occurs, it ramps up to 32768,
  44. // stays there for SUSTAIN_MILLIS, then fades down to zero again.
  45. // EFFECT: BladeEffectType
  46. // FADE_IN_MILLIS: INTEGER
  47. // SUSTAIN_MILLIS: INTEGER
  48. // FADE_OUT_MILLIS: INTEGER
  49. // return value: INTEGER
  50.  
  51. —STYLES—
  52.  
  53. AudioFlicker<colorA, colorB>
  54. // blade modulated by current sound
  55. Blast<BASE, BLAST_COLOR, FADEOUT_MS(150), WAVE_SIZE(100), WAVE_MS(400)>
  56. // blast with wave effect
  57. BlastFadeout<BASE, BLAST_COLOR, FADEOUT_MS>
  58. // blast without wave effect, just like a full blade clash
  59. Blinking<colorA, colorB, BLINK_MILLIS, BLINK_PROMILLE(500)>
  60. or: BlinkingX<colorA,colorB, BLINK_MILLIS_FUNC, BLINK_PROMILLE_FUNC>
  61. BrownNoiseFlicker<colorA, colorB, GRADE>
  62. // Usage: BrownNoiseFlicker<A, B
  63. // A, B: COLOR
  64. // return value: COLOR
  65. // Randomly selects between A and B, but keeps nearby
  66. // pixels looking similar.
  67. ByteOrderStyle<BYTEORDER, COLOR>
  68. // BYTEORDER: Color8::RGB, or one of the other byte orders
  69. // COLOR: COLOR
  70. // return value: COLOR
  71. // This shuffles the RGB values around. It's meant to be used
  72. // when you are mixing different kind of pixels on one string.
  73. // While it's not recommended to do so, this should make it
  74. // easier to compensate by re-ordering the channels.SimpleClash<BASE, CLASH_COLOR, CLASH_MILLIS>
  75. &style_charging
  76. // return value: POINTER
  77. // Charging blade style.
  78. // Slowly pulsating battery indicator.
  79.  
  80. ColorCycle<COLOR, PERCENT, RPM>
  81. or: ColorCycle<COLOR, PERCENT, RPM, ON_COLOR, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS>
  82. // or: ColorCycle<COLOR, PERCENT, RPM, ON_COLOR, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS>
  83. // COLOR, ON_COLOR: COLOR
  84. // RPM, PERCENT, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS: a number
  85. // return value: COLOR
  86. // This is intended for a small ring of neopixels
  87. // A section of the ring is lit at the specified color
  88. // and rotates at the specified speed. The size of the
  89. // lit up section is defined by "percentage".
  90. ColorSequence<MILLIS_PER_COLOR, COLOR1, COLOR2, ….>
  91.  
  92. Cylon<COLOR, PERCENT, RPM>
  93. or: ColorCycle<COLOR, PERCENT, RPM, ON_COLOR, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS>
  94. // COLOR, ON_COLOR: COLOR
  95. // RPM, PERCENT, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS: a number
  96. // return value: COLOR
  97. // Cylon/Knight Rider effect, a section of the strip is
  98. // lit up and moves back and forth. Speed, color and fraction
  99. // illuminated can be configured separately for on and off
  100. // states.
  101. Gradient<colorA, colorB>
  102. or: Gradient<colorA, colorB, colorC, …>
  103. HumpFlicker<colorA, colorB, HUMP_WIDTH>
  104. IgnitionDelay<DELAY_MILLIS, BASE>
  105. InOutHelperX<BASE, EXTENSION, RETRACTION,OFF_COLOR>
  106. InOutSparkTip<BASE, OUT_MILLIS, IN_MILLIS, SPARK_COLOR>
  107. LocalizedClash<Base, Clash_color, LENGTH_MILLIS, BLADE_PERCENTAGE>
  108. Lockup<BASE, LOCKUP_COLOR, DRAG_COLOR>
  109. Mix<colorA, colorB, F>
  110. // mix between A and B using function F.
  111. // F = 0 -> return A, F = 16384 -> return (A+B)/2, F = 32768 -> return B
  112. OnSpark<BASE, SPARK_COLOR, MILLIS>
  113. OriginalBlast<BASE, BLAST_COLOR>
  114. // Blast with wave, but wave has BrownNoiseFlicker
  115. Pulsing<colorA, colorB, PULSE_MILLIS>
  116. or: Pulsing<colorA, colorB, PULSE_MILLIS_FUNC>
  117. RandomBlink<MILLIHZ, COLOR1, COLOR2>
  118. or: RandomBlinkX<MILLIHZ_CLASS, COLOR1, COLOR2>
  119. RandomFlicker<colorA, colorB>
  120. RandomPerLEDFlicker<colorA, colorB>
  121. RgbCycle (no arguments)
  122. // return value: COLOR
  123. // Very fast Red, Green, Blue cycle, result should essentially be white
  124. // until you start swinging it around.
  125. Rgb<R, G, B>
  126. return value: COLOR
  127. Sequence<COLOR1, COLOR2, int millis_per_bits, int bits, 0b0000000000000000, ....>
  128. SimpleClash<BASE, CLASH_COLOR, CLASH_MILLIS>
  129. // BASE: COLOR
  130. // CLASH_COLOR: COLOR (defaults to white)
  131. // CLASH_MILLIS: a number (defaults to 40)
  132. // return value: COLOR
  133. // Turns the blade to CLASH_COLOR for CLASH_MILLIS millseconds
  134. // when a clash occurs.
  135. Sparkle<BASE, SPARKLE_COLOR, SPARK_CHANCE_PROMILLE, SPARK_INTENSITY>
  136. Stripes<WIDTH, SPEED, COLOR1, COLOR2, ... >
  137. Strobe<BASE, STROBE_COLOR, STROBE_FREQUENCY, STROBE_MILLIS>
  138. or: StrobeX<BASE, STROBE_COLOR, STROBE_FREQUENCY_FUNC, STROBE_MILLIS_FUNC>
  139. StylePtr<BLADE>
  140. // blade style gets wrapped in this class
  141.  
  142.  
  143. As of ProffieOS 3.6 BETA:
  144.  
  145. —STYLES—
  146.  
  147. RetractionDelay<DELAY_MILLIS, BASE>
  148. ColorChange<TRANSITION, COLORS>
  149. RotateColorsX<ROTATION, COLOR>
  150. // ROTATION specifies how much to rotate the color in HSV (color wheel) space.
  151. // 0 = none, 32768 = 360degrees
  152. TransitionEffect<COLOR, EFFECT_COLOR, TRANSITION1, TRANSITION2, EFFECT>
  153. // COLOR, EFFECT_COLOR: COLOR
  154. // TRANSITION1, TRANSITION2 : TRANSITION
  155. // EFFECT: effect type
  156. // return value: COLOR
  157. // When the specified EFFECT happens (clash/blast/etc.) transition from COLOR to
  158. // EFFECT_COLOR using TRANSITION1. Then transition back using TRANSITION2.
  159.  
  160. TransitionLoop<COLOR, TRANSITION>
  161. // Continuously transitions COLOR to COLOR
  162. // Makes more sense if TRANSITION is a TrConcat, as this will
  163. // transition to/from the intermediate steps in a loop.
  164.  
  165. —TRANSITIONS— (Insert these where it says TRANSITION in a template) (Not sure about how to integrate Functions)
  166.  
  167. InOutTr<BASE, OUT_TRANSITION, IN_TRANSITION, OFF_COLOR>
  168. // Similar to InOutHelper<>, but uses configurable transitions
  169. // to go to and from the BASE to the OFF_COLOR.
  170. TrFadeX<MILLIS_FUNCTION, N>
  171. or: TrFade<MILLIS, N>
  172. // MILLIS_FUNCTION: FUNCTION
  173. // MILLIS: a number
  174. // N: a number
  175. // Transitions back and forth between the two colors several times. (As specified by N).
  176. // If N is 0, it's equal to TrFade. If N is 1 it transitions A-B-A-B, if N is 2, it is A-B-A-B-A-B, and so on.
  177. TrColorCycle<MILLIS, START_RPM, END_RPM>
  178. or now?: ColorCycleTr<MILLIS, START_RPM, END_RPM>
  179. // MILLS: number
  180. // START_RPM: a number (defaults to 0)
  181. // END_RPM: a number (defaults to 6000)
  182. // return value: COLOR
  183. // Tron-like transition.
  184. TrConcat<TRANSITION, INTERMEDIATE, TRANSITION, ...>
  185. // TRANSITION: TRANSITION
  186. // INTERMEDIATE: COLOR
  187. // Concatenates (combines) any number of transitions. In between each transition,
  188. //we need an intermediate color to transition to.
  189. TrDelayX<MILLIS_FUNCTION>
  190. or: TrDelay<MILLIS>
  191. // MILLIS_FUNCTION: FUNCTION
  192. // MILLIS: a number
  193. // Waits for the specified number of milliseconds, then transitions
  194. // to second color. Meant to be used with TrConcat
  195. TrFadeX<MILLIS_FUNCTION>
  196. or: TrFade<MILLIS>
  197. // MILLIS_FUNCTION: FUNCTION
  198. // MILLIS: a number
  199. // Linear fading between two colors in specified number of milliseconds.
  200. TrInstant
  201. // Instant Transition
  202. TrJoin<TR1, TR2, ...>
  203. // TR1, TR2: TRANSITION
  204. // A little hard to explain, but all the specified transitions are run in parallel.
  205. //Basically, we chain transitions like ((A TR1 B) TR2 B)
  206. TrJoinR<TR1, TR2, ...>
  207. // Similar to TrJoin, but transitions are chained to the right instead of to the left.
  208. // Like: (A TR2 (A TR1 B))
  209. TrRandom<TR1, TR2, ...>
  210. // TR1, TR2: TRANSITION
  211. // Each time a new transition is started, a random transition is picked from
  212. // the specified list of transitions.
  213. TrWipeX<MILLIS_FUNCTION>
  214. or: TrWipe<MILLIS>
  215. // MILLIS_FUNCTION: FUNCTION
  216. // MILLIS: a number
  217. // Similar to saber ignition. In the beginning entire blade is color A,
  218. // then color B starts at the base and extends up to the tip of the blade
  219. // in the specified number of milliseconds.
  220. TrWipeInX<MILLIS_FUNCTION>
  221. or: TrWipeIn<MILLIS>
  222. // Like TrWipe, but from tip to base.
  223.  
  224. TransitionEffect<COLOR, EFFECT_COLOR, TRANSITION1, TRANSITION2, EFFECT>
  225. // EFFECT: effect type
  226. // When the specified EFFECT happens (clash/blast/etc.) transition from COLOR to
  227. // EFFECT_COLOR using TRANSITION1. Then transition back using TRANSITION2.
  228.  
  229.  
  230.  
  231. —FUNCTIONS—
  232.  
  233. SmoothStep<POS, WIDTH>
  234. // POS, WIDTH: FUNCTION
  235. // POS: specifies the middle of the smoothstep, 0 = base of blade, 32768=tip
  236. // WIDTH: witdth of transition, 0 = no transition, 32768 = length of blade
  237. // Example: SmoothStep<Int<16384>, Int<16384>> returns 0 up until 25% of the blade.
  238. // From there it has a smooth transition to 32768, which will be reached at 75% of the blade.
  239. // If WIDTH is negative, the transition will go the other way.
  240. SmoothSoundLevel
  241. // Returns 0-32768 based on sound level.
  242. // returned value: INTEGER
  243. NoisySoundLevel
  244. // Returns 0-32768 based on sound level.
  245. // returned value: INTEGER
  246. SwingSpeed<MAX>
  247. // Returns 0-32768 based on swing speed
  248. // returned value: INTEGER
  249.  
  250.  
  251.  
  252. ## Additional new Styles in sa22c CC fork release:
  253.  
  254. - Flare<Base_color, Flare_color, Flare Width>
  255. - Stab<Base_color, Stab_Color(White), Stab_millis(500), Stab_width(50)>
  256.  
  257. - LocalizedLockup<Base, Lockup_color, Drag_color, Block_color, Lockup Walk (200ms), Lockup Width (50% of blade), Block Walk (50ms), Block Width (20size), Drag Width (30%)>
Localized Lockup and Force Lightning Lockup (Block) animation effects based on Fett263’s Dual Lockup mod in a single compact style to create a super easy implantation, greatly reducing style sizes – I really want to call attention to the work Matt did on this, this was a very complex and painstaking amount of work to create this excellent update to the effects.
  258.  
  259. - ColorChange<COLORS...> =
  260. List as many colors (or effects) within the style and advance through list using "on-the-fly" change.
  261. Example = ColorChange<Red,Orange,Yellow,Green,DeepSkyBlue,Blue,Pink,Magenta>
  262.  
  263. - ColorChangeFade<TRANSITION (ms), COLORS...> =
  264. List as many colors (or effects) within the style and advance through list using "on-the-fly" change. Each color will fade into the next over the TRANSITION TIME (ms).
  265. Example = ColorChangeFade<400,Red,Orange,Yellow,Green,DeepSkyBlue,Blue,Pink,Magenta> (fade will take 400ms per color)
  266.  
  267. - EffectScroll<DISPLAY (ms), COLORS...> =
  268. List as many colors (or effects) within the style and advance through list using "scroll/select". To change colors/effects activate "Scroll Mode" and continously advance through the list with each item showing for DISPLAY (ms) until you "Select". Shorter display times will act as a quick menu, longer display times will allow the Scroll Mode to act like a DEMO Mode, which can be entered or exited at will.
  269.  
  270. - ColorScroll<DISPLAY (ms), COLORS...> =
  271. List as many colors (or effects) within the style and advance through list using "on-the-fly" change OR "scroll/select". Each "on-the-fly" change will advance through the list one at a time OR activate "Scroll Mode" and continuously advance through the list with each item showing for DISPLAY (ms) until you "Select". Shorter display times will act as a quick menu, longer display times will allow the Scroll Mode to act like a DEMO Mode, which can be entered or exited at will.
  272.  
  273. - ChangeSpark<Base, Spark_color, Transition (ms)>
  274. ChangeSpark allows a Color or Effect to be implemented with “on-the-fly” color change effects. The Spark color/effect will display and fade over the Transition Time every time the Color Change Effect is activated to add additional “accents” to your color change styles.
  275.  
  276. - EndSpark<Base, Spark_color, Transition (ms)>
  277. EndSpark allows a Color or Effect to be implemented anytime a Lockup is ended, the color/effect will display and fade over the Transition Time to mimic the blade normalizing or cooling off.
  278.  
  279. - OffSpark<Base, Spark_color, Transition (ms)>
  280. OffSpark allows a Color or Effect to be implemented during blade retraction, the color/effect will display and fade over the Transition Time to mimic the blade normalizing or cooling off, when used with an InOutHelper you will want to allow adequate retraction time for the effect to display.
  281.  
  282. -
  283.  
  284. ——————
  285.  
  286. undocumented yet:
  287.  
  288. StyleFire
  289. many more….
Advertisement
Add Comment
Please, Sign In to add comment