Halloween Light String Sequence Example Project

I used this little project code to add a little fun to the office halloween party. It took me awhile to figure out sequence and some other things so I thought I’d share so other searches might find.

shape: 160

driver:

typename: SPI

ledtype: WS2801

interface: PERIPHERY

c_order: RBG

numbers: float32

layout:

typename: strip

brightness: 50

palettes:

halloween: [lime, orange, purple]

animation:

typename: .sequence

length: 30 # Seconds before switching to next item in the sequence

animations:

- typename: $bpa.strip.Wave

  color: lime

- typename: $bpa.strip.Searchlights

  palette: halloween

- typename: $bpa.strip.ColorPattern

  palette: halloween

- typename: $bpa.strip.LarsonScanners.LarsonScanner

  color: orange

- typename: $bpa.strip.PixelPingPong

  palette: purple

  fade_delay: 50

- typename: $bpa.strip.Rainbows.RainbowCycle

  palette: halloween

- typename: $bpa.strip.LarsonScanners.LarsonRainbow

  palette: halloween

- typename: $bpa.strip.PartyMode

  palette: halloween

This is incredibly instructive - for me anyway!

  1. You might be the first person to use the new palettes feature!

I can immediately see a really nice new feature - “SET DEFAULT PALETTE”. If you had that you’d lose half a dozen lines of code or more.

:slight_smile: Nice! Yeah, that’d been a nice touch. In truth, the amount of actual code to the results is super small so I wasn’t hurting. The bigger pain point was finding where it was supported and which animations didn’t yet use it. Glad seeing it used is helpful.

  1. Question - I see you’re using numpy colorlists (because you have the numbers: float32 section enabled). Did you notice any performance differences with that?

It’s particularly noticeable in real-time things like fades for me, less so in other things.

I don’t think I was using a fade at the time I switched, but I did see it improve. It absolutely wasn’t slower so I went with it based on your comments in docs. I haven’t seen any problems with it.

  1. Pro-tip - for re-use!

Consider dividing this into two .yml files:

File base.yml:

shape: 160

driver:

typename: SPI

ledtype: WS2801

interface: PERIPHERY

c_order: RBG

numbers: float32

layout:

typename: strip

brightness: 50

palettes:

halloween: [lime, orange, purple]

and animation.yml:

animation:

typename: .sequence

length: 30 # Seconds before switching to next item in the sequence

animations:

- typename: $bpa.strip.Wave
  color: lime
- typename: $bpa.strip.Searchlights
  palette: halloween
- typename: $bpa.strip.ColorPattern
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonScanner
  color: orange
- typename: $bpa.strip.PixelPingPong
  palette: purple
  fade_delay: 50
- typename: $bpa.strip.Rainbows.RainbowCycle
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonRainbow
  palette: halloween
- typename: $bpa.strip.PartyMode
  palette: halloween

Then you can run your project like this:

$ bp base.yml + animation.yml

Three big advantages:

  1. You can have have the same strip and different animation files halloween.yml arbor-day.yml new-years.yml
  1. You can keep adding to your palettes and aliases so they’re always available in all your projects.
  1. You can quickly “audition” new animations from the command line - like this:

$ bp base.yml + ‘{animation: $bpa.strip.Rainbows.RainbowCycle}’

You can divide your project up into lots of tiny files that way. I have a document planned detailing workflow, when I get past these somewhat obscure bugs I’m working through (POV, who knew that existed? :-D)

Oh, this’ll be really useful for my bigger project where these lights will ultimately land. Also, see how that audition feature would have been useful as I was trying to figure out options for animations as well. Thanks!

···

On Friday, November 2, 2018 at 9:23:55 AM UTC-6, Tom Swirly wrote:

On Fri, Nov 2, 2018 at 4:04 PM Josiah Ritchie josiah....@gmail.com wrote:

I used this little project code to add a little fun to the office halloween party. It took me awhile to figure out sequence and some other things so I thought I’d share so other searches might find.

shape: 160

driver:

typename: SPI

ledtype: WS2801

interface: PERIPHERY

c_order: RBG

numbers: float32

layout:

typename: strip

brightness: 50

palettes:

halloween: [lime, orange, purple]

animation:

typename: .sequence

length: 30 # Seconds before switching to next item in the sequence

animations:

- typename: $bpa.strip.Wave
  color: lime
- typename: $bpa.strip.Searchlights
  palette: halloween
- typename: $bpa.strip.ColorPattern
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonScanner
  color: orange
- typename: $bpa.strip.PixelPingPong
  palette: purple
  fade_delay: 50
- typename: $bpa.strip.Rainbows.RainbowCycle
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonRainbow
  palette: halloween
- typename: $bpa.strip.PartyMode
  palette: halloween

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/6757b1be-0cb7-432b-b0e0-fc4119a52a9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

Hey Josiah,

Thanks for this post! This was incredibly helpful for me.

Out of curiosity, is there a way to define a length on a per-animation level? For example, run the first for 5 seconds, second for 10, etc.

Also, what is the relationship between fps and the number of LEDs in a strip? I assumed running an animation at 25 fps for 2 seconds (say colorchase or pixeltester) would cover a full 50 led strip, but that doesn’t seem to be the case. Am I misunderstanding something there?

Thanks!

···

On Friday, November 2, 2018 at 11:00:54 AM UTC-5, Josiah Ritchie wrote:

On Friday, November 2, 2018 at 9:23:55 AM UTC-6, Tom Swirly wrote:

This is incredibly instructive - for me anyway!

  1. You might be the first person to use the new palettes feature!

I can immediately see a really nice new feature - “SET DEFAULT PALETTE”. If you had that you’d lose half a dozen lines of code or more.

:slight_smile: Nice! Yeah, that’d been a nice touch. In truth, the amount of actual code to the results is super small so I wasn’t hurting. The bigger pain point was finding where it was supported and which animations didn’t yet use it. Glad seeing it used is helpful.

  1. Question - I see you’re using numpy colorlists (because you have the numbers: float32 section enabled). Did you notice any performance differences with that?

It’s particularly noticeable in real-time things like fades for me, less so in other things.

I don’t think I was using a fade at the time I switched, but I did see it improve. It absolutely wasn’t slower so I went with it based on your comments in docs. I haven’t seen any problems with it.

  1. Pro-tip - for re-use!

Consider dividing this into two .yml files:

File base.yml:

shape: 160

driver:

typename: SPI

ledtype: WS2801

interface: PERIPHERY

c_order: RBG

numbers: float32

layout:

typename: strip

brightness: 50

palettes:

halloween: [lime, orange, purple]

and animation.yml:

animation:

typename: .sequence

length: 30 # Seconds before switching to next item in the sequence

animations:

- typename: $bpa.strip.Wave
  color: lime
- typename: $bpa.strip.Searchlights
  palette: halloween
- typename: $bpa.strip.ColorPattern
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonScanner
  color: orange
- typename: $bpa.strip.PixelPingPong
  palette: purple
  fade_delay: 50
- typename: $bpa.strip.Rainbows.RainbowCycle
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonRainbow
  palette: halloween
- typename: $bpa.strip.PartyMode
  palette: halloween

Then you can run your project like this:

$ bp base.yml + animation.yml

Three big advantages:

  1. You can have have the same strip and different animation files halloween.yml arbor-day.yml new-years.yml
  1. You can keep adding to your palettes and aliases so they’re always available in all your projects.
  1. You can quickly “audition” new animations from the command line - like this:

$ bp base.yml + ‘{animation: $bpa.strip.Rainbows.RainbowCycle}’

You can divide your project up into lots of tiny files that way. I have a document planned detailing workflow, when I get past these somewhat obscure bugs I’m working through (POV, who knew that existed? :-D)

Oh, this’ll be really useful for my bigger project where these lights will ultimately land. Also, see how that audition feature would have been useful as I was trying to figure out options for animations as well. Thanks!

On Fri, Nov 2, 2018 at 4:04 PM Josiah Ritchie josiah....@gmail.com wrote:

I used this little project code to add a little fun to the office halloween party. It took me awhile to figure out sequence and some other things so I thought I’d share so other searches might find.

shape: 160

driver:

typename: SPI

ledtype: WS2801

interface: PERIPHERY

c_order: RBG

numbers: float32

layout:

typename: strip

brightness: 50

palettes:

halloween: [lime, orange, purple]

animation:

typename: .sequence

length: 30 # Seconds before switching to next item in the sequence

animations:

- typename: $bpa.strip.Wave
  color: lime
- typename: $bpa.strip.Searchlights
  palette: halloween
- typename: $bpa.strip.ColorPattern
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonScanner
  color: orange
- typename: $bpa.strip.PixelPingPong
  palette: purple
  fade_delay: 50
- typename: $bpa.strip.Rainbows.RainbowCycle
  palette: halloween
- typename: $bpa.strip.LarsonScanners.LarsonRainbow
  palette: halloween
- typename: $bpa.strip.PartyMode
  palette: halloween

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/6757b1be-0cb7-432b-b0e0-fc4119a52a9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com