1 declare name "freeverb";
3 declare author "Grame";
5 declare copyright "(c)GRAME 2006";
7 //======================================================
10 // Faster version using fixed delays (20% gain)
12 //======================================================
15 // Constant Parameters
16 //--------------------
26 initialwet = 1.0/scalewet;
47 allpasstuningL1 = 556;
48 allpasstuningL2 = 441;
49 allpasstuningL3 = 341;
50 allpasstuningL4 = 225;
54 //--------------------
55 // Damp : filtrage des aigus des echos (surtout actif pour des grandes valeurs de RoomSize)
56 // RoomSize : taille de la piece
57 // Dry : signal original
58 // Wet : signal avec reverbration
60 dampSlider = hslider("Damp",0.5, 0, 1, 0.025)*scaledamp;
61 roomsizeSlider = hslider("RoomSize", 0.5, 0, 1, 0.025)*scaleroom + offsetroom;
62 wetSlider = hslider("Wet", 0.3333, 0, 1, 0.025);
63 drySlider = hslider("Dry", 0, 0, 1, 0.025);
64 combfeed = roomsizeSlider;
70 // Comb and Allpass filters
71 //-------------------------
73 allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
75 comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
81 monoReverb(fb1, fb2, damp, spread)
82 = _ <: comb(combtuningL1+spread, fb1, damp),
83 comb(combtuningL2+spread, fb1, damp),
84 comb(combtuningL3+spread, fb1, damp),
85 comb(combtuningL4+spread, fb1, damp),
86 comb(combtuningL5+spread, fb1, damp),
87 comb(combtuningL6+spread, fb1, damp),
88 comb(combtuningL7+spread, fb1, damp),
89 comb(combtuningL8+spread, fb1, damp)
91 allpass (allpasstuningL1+spread, fb2)
92 : allpass (allpasstuningL2+spread, fb2)
93 : allpass (allpasstuningL3+spread, fb2)
94 : allpass (allpasstuningL4+spread, fb2)
97 stereoReverb(fb1, fb2, damp, spread)
98 = + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
101 // fxctrl : add an input gain and a wet-dry control to a stereo FX
102 //----------------------------------------------------------------
104 fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_;
111 freeverb = vgroup("Freeverb", fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread)));