A loop for live coding
live_loop
[name (symbol)]
Run the block in a new thread with the given name, and loop it forever. Also sends a cue with the same name each time the block runs. If the block is giving a parameter, this is given the result of the last run of the loop (with initial value either being 0 or an init arg).
Introduced in v2.1
|
live_loop :ping do sample :elec_ping sleep 1 end |
|
|
live_loop :foo do |a| puts a sleep 1 a += 1 end |
# pass a param (a) to the block (inits to 0) # prints out all the integers # increment a by 1 (last value is passed back into the loop) |