I can't find the post,

I can’t find the post, but a couple of weeks ago @Daniel_Garcia we were talking about “frame first” vs “effect first” approaches to higher-level pattern code. I went “effect first” for my panel project, but I want to experiment with “frame first” for some new stuff.

There were two reasons I went for “effect first”: many of my patterns rely on making a “delta” from the previous state of the leds array “frame buffer”, so your use-case of applying a series of effects to one frame before displaying it didn’t apply so much. Does this come up for you, or on the Teensy do you typically have enough memory that each effect can maintain its own buffer and you composite them together at the end before calling LEDS.show()?

Secondly, I looked into a “frame first” arrangement where the frame “controller” would call LEDS.show() every 1/60th of a second, guaranteeing the frame rate (maybe skipping a frame if the effect couldn’t keep up.) I abandoned this when I couldn’t work out how to get a hardware interrupt to call me on a timer, mostly because it seemed the interrupts FastLED was using clashed with those of the Arduino interrupt library. Is this still an issue with FastLED 2.1 running non-SPI strips, can I work around it by getting closer to the metal, or do you use a mechanism other than hardware interrupts to get a stable frame rate?

I have an executor loop that takes care of scheduling tasks (e.g. drawing patterns, etc…) and have it set up to call into the renderer (which calls each pattern’s draw functions) when 16ms have passed since the last time it called into the renderer. The executor loop looks roughly like:

int CExecutor::loop() {
long nCycleTime = millis();
int nTasksExecuted = 0;
for(int i = 0; i < m_nMaxTasks; i++) {
if(m_pTasks[i] != NULL && (millis() > m_nNextExecutes[i]) ) {
m_nNextExecutes[i] = millis() + m_pTasks[i]->execute();
nTasksExecuted++;
}
}
return nTasksExecuted;
}

Robert
I think this is the post you are refering to https://plus.google.com/104827455037151320785/posts/7Y1uBWrTgP7

Brilliant, thanks @Peter_Spriet . Google+ search blows goats.