rsc3/doc/examples/graph/_scm/reverberated-sine-percussion.scm

34 lines
891 B
Scheme
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
;; reverberated sine percussion (jmcc)
(import (rnrs) (rsc3) (rhs))
(define rallpass
(lambda (i)
(allpass-n i 0.050 (clone 3 (rand 0 0.05)) 1)))
(define chain-of
(lambda (n f)
(foldl1 compose (replicate n f))))
(define reverberated-sine-percussion
(let* ((d 10)
(c 7)
(a 4)
(s (mix-fill
d
(lambda (_)
(resonz (mul (dust ar (/ 2 d)) 50)
(+ 200 (random 0 3000))
0.003))))
(z (delay-n s 0.048 0.48))
(y (mix (comb-l z
0.1
(mul-add (lf-noise1 kr (clone c (rand 0 0.1)))
0.04
0.05)
15)))
(x ((chain-of a rallpass) y)))
(add s (mul 0.2 x))))
(audition (out 0 reverberated-sine-percussion))