loopcode
Generate repeated evaluations of arbitrary Csound code.
Syntax
Usage
Many of the examples in this guide have been using a technique known as temporal recursion. In Csound this is done with an instrument that schedules it's own instance to run after some time delay.
The recursive instrument holds all the algorithms and logic flow to generate events in a (hopefully) interesting pattern.
livecode is a convenient temporal recursion wrapper. It executes any Csound code specified in a multi-line string, and uses an array of time values to specify the times between executions. One restriction to note with loopcode is that he Csound code in the string needs to run at i-time.
Arguments
i/klooptimes[] -- Relative onset beat intervals between events. The selected value for the next event iterates sequentially through this array. Negative values signify a rest, and an event will not be generated at the specified time.
Sid -- A String used as a unique identifier handle. Any string can be used as long as it is unique.
Scode -- Your Csound code. Must run at i-time.
iLOOPDURis a reserved variable available in Scode:iLOOPDURholds the current looptime assigned. This is useful for tying event durations in Scode to the loop duration.
istatus (optional, default=1) -- An on/off switch. If istatus=0, the loop stops. If istatus=1, the loop starts.