2022-08-24 13:53:18 +00:00
|
|
|
#lang scribble/manual
|
|
|
|
@(require (for-label racket))
|
|
|
|
|
|
|
|
@title{(decay2 in attackTime decayTime)}
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
2022-08-24 13:53:18 +00:00
|
|
|
Exponential decay. decay has a very sharp attack and can produce
|
|
|
|
clicks. decay2 rounds off the attack by subtracting one decay from
|
|
|
|
another.
|
|
|
|
|
|
|
|
(decay2 in a d) is equivalent to (sub (decay in d) (Decay in a)).
|
|
|
|
|
|
|
|
Used as an envelope
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
|
|
|
@racketblock[
|
2022-08-24 13:53:18 +00:00
|
|
|
(audition
|
|
|
|
(out 0 (mul (decay2 (impulse ar (x-line kr 1 50 20 remove-synth) 0.25)
|
|
|
|
0.01
|
|
|
|
0.2)
|
|
|
|
(mul (f-sin-osc ar 600 0) 0.25))))
|
2022-08-28 10:27:01 +00:00
|
|
|
]
|
2022-08-24 13:53:18 +00:00
|
|
|
|
|
|
|
Compare the above with decay used as the envelope.
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
|
|
|
@racketblock[
|
2022-08-24 13:53:18 +00:00
|
|
|
(audition
|
|
|
|
(out 0 (mul (decay (impulse ar (x-line kr 1 50 20 remove-synth) 0.25)
|
|
|
|
0.01)
|
|
|
|
(mul (f-sin-osc ar 600 0) 0.25))))
|
2022-08-28 10:27:01 +00:00
|
|
|
]
|
|
|
|
|
2022-08-24 13:53:18 +00:00
|
|
|
|