Pspawner allows a routine to dynamically start and stop subpatterns.
The function defines a Routine that receives a Spawner as its sole argument. All control of subpatterns is through the spawner.
Spawner responds to the messages:
- Begin an event stream in parallel to the routine. If delta is non-zero, the pattern will begin that many beats after 'now', provided that now + delta is later than the next event that the Spawner will generate. The method returns the stream. This may be called from any object.
- Run the entire pattern and then return control to the routine.
- Wait dur seconds and then return control to the routine.
- Find the stream in the Spawner and stop it, returns nil if the stream is not found, the stream otherwise.
- Stop all substreams of the Spawner.
We should move the documentation of above methods to the Spawner