[Function]
(sprout object {keyword value}*)

Inserts object into the scheduler according to keyword arguments. Returns no values. It is an error to call sprout if events or rts is not running. If rts is running then sprout can be called from the REPL or from inside a receiver hook to add objects to the scheduler interactively.

sprout supports the following keyword arguments:

:at number
The initial start time of object in the scheduler. If the value is not specified it defaults to the object-time of object, or to now if object has no object-time method.

sprout is also available as a process clause.

Examples

Example 1. Using sprout (clausal form).

(define (wiggle n lb ub dur rate)
  (process repeat n
           for k = (between lb ub)
           output (new midi :time (now) :duration dur :keynum k)
           when (odds .3)
           sprout (process with j = (+ k 12) repeat 12
                           for l = (between j (+ j 7))
                           output (new midi :time (now) :keynum l 
                                        :duration .1)
                           wait .1)
             at (now)
           wait rate))

(events (wiggle 30 50 70 .2 .3) "test.mid")
 "test.mid"

See rts documentation for examples of using sprout interactively.

See also: