2022-08-24 13:53:18 +00:00
|
|
|
#lang scribble/manual
|
|
|
|
@(require (for-label racket))
|
|
|
|
|
|
|
|
@title{(pause-self-when-done src)}
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
2022-08-24 13:53:18 +00:00
|
|
|
pause the synth when the 'done' flag of the unit at `src' is set.
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
|
|
|
@racketblock[
|
2022-08-24 13:53:18 +00:00
|
|
|
(let* ((x (mouse-x kr -1 1 0 0.1))
|
|
|
|
(e (linen x 1 0.1 1 pause-synth)))
|
|
|
|
(audition (out 0 (mul (sin-osc ar 440 0) e))))
|
2022-08-28 10:27:01 +00:00
|
|
|
]
|
2022-08-24 13:53:18 +00:00
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
|
|
|
@racketblock[
|
2022-08-24 13:53:18 +00:00
|
|
|
(let* ((x (mouse-x kr -1 1 0 0.1))
|
|
|
|
(e (linen x 2 0.1 2 do-nothing)))
|
|
|
|
(audition (mrg2 (pause-self-when-done e)
|
|
|
|
(out 0 (mul (sin-osc ar 440 0) e)))))
|
2022-08-28 10:27:01 +00:00
|
|
|
]
|
|
|
|
|
2022-08-24 13:53:18 +00:00
|
|
|
|