Page 1 of 1

Posted: 23 Mar 2014, 13:06
by ceasless
For each case statement block, do I need to provide unique counters and temporary variables (like midiTmp, for holding the current tMidi when iterating over the midi array, or throwaway counters like m,x,p etc) ?

I've been playing it safe so far and creating new counters and temp variables for each block because I'm worried what might happen if two callbacks are initiated and both are using 'x' as a counter in a for loop, but maybe this isn't actually something I need to worry about?

Posted: 24 Mar 2014, 12:28
by martignasse
hi ceasless,

you are speaking about script right ?

just to be sure ;)

if so,

each time the callback function is called, it end up in only one case block and this block is guaranteed to be executed plainly before another callback call

thus, you can use only one counter variable for the callback function

for infos, it's not the same for the process function

hope it help

Posted: 24 Mar 2014, 13:45
by ceasless
Yes, talking about fastscript for sure.

So no matter how complex the input streams get, callbacks are called one at a time? What if all params receive input at exactly the same time?

I was imagining it to have a more asynchronous nature.

Anyway, thanks for the clarification!

Posted: 26 Mar 2014, 12:19
by martignasse
it's engine events internal

but one way or another, the engine end up by calling param callback multiple time, one for each param who need it, one after one