Timed Playlist of Animations Warning: this one is definitely on the more sophisticated/advanced side.

Timed Playlist of Animations
Warning: this one is definitely on the more sophisticated/advanced side.
This sample code shows how to use FastLED to set up a ‘playlist’ of animations, each of which will play for a certain amount of time, and then automatically advance to the next one. The playlist can be set to auto-loop forever, or play-once-and-stop, which should be useful for live performances, and music-sync’d choreography. (We’re looking at you, @Erin_St_Blaine !) The playlist can be triggered by an external event, such as a button push to start things going.
The code is a bit more elaborate than many of the ‘getting started’ examples we post here, so take some time and study it and play with it if you’re interested in this sort of thing. And as always, this is just some example code for getting you started! Play around and have fun!

Oh, and if you wanted to have the playlist start off ‘idle’ (e.g, not running until you start it the first time), then:

  1. Set the last track in the playlist to fadeToBlack.
  2. In setup(), set gCurrentTrackNumber to ARRAY_SIZE(gPlaylist) - 1, e.g., the last track, which is the fadeToBlack one.
  3. Set gLoopPlaylist to false, so it doesn’t auto-restart.

Now what’ll happen is that the playlist will start up with the last track, which is all black, and stay there UNTIL it gets reset by your button push to start the show, etc.

There is a party on my floor right now.

Updated: if you want something more focused on synchronized performance, maybe this new “Timecode Performance” example is a good resource: https://plus.google.com/112916219338292742137/posts/TVzTPbnJNE7

I’ll have to see how I can adapt this, as my own routines use startup variables as well as ones that are passed each time the routine is looped through.

Thanks, really enjoying this!

Thanks Mark Kriegsman for wonderful example code. I have problem with this code
even after uninstall and reinstall both FastLED and Arduino

Arduino: 1.0.6 (Windows 8, Board: “Arduino Uno”
fastled3timeplay.ino:14:2: error: #error “Requires FastLED 3.1 or later; check github for latest code.”
fastled3timeplay.ino: In function ‘void loop()’:
fastled3timeplay:90: error: ‘EVERY_N_MILLISECONDS’ was not declared in this scope
fastled3timeplay:90: error: expected ;' before '{' token fastled3timeplay:102: error: 'patternTimer' was not declared in this scope fastled3timeplay:102: error: 'EVERY_N_SECONDS_I' was not declared in this scope fastled3timeplay:102: error: expected ;’ before ‘{’ token

As the first error states, you need FastLED 3.1 or later.
The main branch is currently “3.0”, which is probably what you have.

A ZIP of the latest 3.1 branch can be found here https://github.com/FastLED/FastLED/archive/FastLED3.1.zip

Thanks
I keep looking for this all last week
That will definitely fix my error