-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreeverb.dspi
68 lines (55 loc) · 1.92 KB
/
freeverb.dspi
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
declare name "Freeverb";
declare category "Reverb";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("math.lib");
import("music.lib");
import("effect.lib");
import("filter.lib");
/*-----------------------------------------------
freeverb by "Grame"
-----------------------------------------------*/
// Filter Parameters
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
//drgreenthumb: vsliders changed to hsliders
roomsizeSlider = hslider("RoomSize", 0.5, 0, 1, 0.025)*0.28 + 0.7;
dampslider = hslider("damp",0.5, 0, 1, 0.025);
combfeed = roomsizeSlider;
//wetslider = 0.5 + hslider("wet_dry[name:wet/dry]", 0, -0.5, 0.5, 0.1);
wet_dry = hslider("wet_dry[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry = 1 - wet_dry;
// Comb and Allpass filters
allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
// Reverb components
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
//----------------------------------------------------------------
fxctrl(g,w,Fx) = _ <: (*(g) <: _ + Fx ), *(1-w) +> _;
process = _<:*(dry),(*(wet_dry):fxctrl(0.015,wet_dry, monoReverb(combfeed, 0.5, dampslider, 23))):>_;