L5 - some clock notes
Posted: 14 Apr 2014 02:44
Just a head's up -- the Lemur OS does seem to properly stop the clocks if you are changing between templates, but be aware if you are a template designer -- the old BPM settings and old/current beatcount are preserved. So, if you are using a clock for something and don't explicitly set the BPM and don't reset the beatcount you may get unexpected behavior.
As a developer, make sure you try to leave the clocks in a known state when you are done with them.
Also (this is obvious, but it bit me) - if you are using a clock as a timer, remember that *every* script that is set to 'on clock' will execute when that particular clock starts back up again.
Timer note - using 2 scripts -- one to do things and a second to watch for things that happen, all based on the same clock but using different divisions (1/4 note and 1/16 note for example) seems to be a very clean way to handle talking to external devices when you need to wait. The 'start' button (or whatever triggers things for your template) can simply set a BPM and do a clock_start(#); When the monitoring/waiting is done, a clock_stop() can be issued and you're good to go.
As a developer, make sure you try to leave the clocks in a known state when you are done with them.
Also (this is obvious, but it bit me) - if you are using a clock as a timer, remember that *every* script that is set to 'on clock' will execute when that particular clock starts back up again.
Timer note - using 2 scripts -- one to do things and a second to watch for things that happen, all based on the same clock but using different divisions (1/4 note and 1/16 note for example) seems to be a very clean way to handle talking to external devices when you need to wait. The 'start' button (or whatever triggers things for your template) can simply set a BPM and do a clock_start(#); When the monitoring/waiting is done, a clock_stop() can be issued and you're good to go.