in_thread
Execute a given block (between do
… end
) in a new thread. Use for playing multiple ‘parts’ at once. Each new thread created inherits all the use/with defaults of the parent thread such as the time, current synth, bpm, default synth args, etc. Despite inheriting defaults from the parent thread, any modifications of the defaults in the new thread will not affect the parent thread. Threads may be named with the name:
optional arg. Named threads will print their name in the logging pane when they print their activity. If you attempt to create a new named thread with a name that is already in use by another executing thread, no new thread will be created.
It is possible to delay the initial trigger of the thread on creation with both the delay:
and sync:
opts. See their respective docstrings. If both delay:
and sync:
are specified, on initial thread creation first the delay will be honoured and then the sync.
Introduced in v2.0
name: |
Make this thread a named thread with name. If a thread with this name already exists, a new thread will not be created. |
delay: |
Initial delay in beats before the thread starts. Default is 0. |
sync: |
Initial sync symbol. Will sync with this symbol before the thread starts. |
sync_bpm: |
Initial sync symbol. Will sync with this symbol before the live_loop starts. Live loop will also inherit the BPM of the thread which cued the symbol. |
# Example 1 | |
|
|
# Example 2 | |
|
|
# Example 3 | |
|
|
# Example 4 | |
|
|
# Example 5 | |
|
|
# Example 6 | |
|
|