-
Notifications
You must be signed in to change notification settings - Fork 4
/
rbbdtone.ny
68 lines (27 loc) · 1.18 KB
/
rbbdtone.ny
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;nyquist plug-in
;version 1
;type process
;name "Reverse bouncing ball delay with Tone Shift..."
;action "Applying reverse bouncing ball Delay with tone shift..."
;info "Reverse bouncing ball delay with Tone Shift by David R. Sky"
;control decay "Decay amount" real "dB" 0.05 0.00 5.00
;control delay "Delay time" real "seconds" 0.02 0.01 1.00
;control count "Number of bounces" int "times" 15 1 100
;control toneshift1 "Tone shift (whole)" int "semitones" -1 -24 24
;control toneshift2 "Tone shift (cents)" int "cents" 0 -100 100
(setf toneshift (sum toneshift1 (mult toneshift2 0.01)))
(setf toneshift (expt 2.0 (/ toneshift 12.0)))
(setf toneshift (/ 1.0 toneshift))
(defun change (s toneshift)
(force-srate 44100 (stretch-abs toneshift (sound s))))
;; Like reverse bouncing ball, but each bounce is tone shifted.
(truncate count)
(setf revcount (sum count 1))
(defun revbounces (s decay delay count)
(if (= count 0)
(cue s)
(sim (cue s)
(loud decay (at (mult delay (- revcount count))
(revbounces (change s toneshift) decay delay
(- count 1 )))))))
(stretch-abs 1 (revbounces s (- 0 decay) delay count))