-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfx_delay2.dsp
30 lines (24 loc) · 950 Bytes
/
fx_delay2.dsp
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
// delay effect
// faust library
declare options "[midi:on][nvoices:4]";
import("stdfaust.lib");
declare author "Critter&Guitari";
declare copyright "GRAME";
declare license "LGPL with exception";
gate = button("gate");
gain = hslider("gain", 0.5, 0, 1, 0.001);
delTime = hslider("delTime", 125, 1, 2000, 1);
beginDel = hslider("beginDel", 125, 1, 2000, 1);
globalCurve = hslider("curve", 1, 1, 12, 1);
direction = hslider("direction", 1, 0, 1, 1);
trig_delay(num, time, del, dir, curve) = env <: sum(i, num, del_voice((i*time)+del, vol(i) * 0.8 )) :> _
with {
vol(x) = pow( dir - (x/num), curve);
a = hslider("a", 0.001, 0.001, 4, 0.001);
d = hslider("d", 0.1, 0.001, 4, 0.001);
s = hslider("s", 0, 0, 1, 0.01);
r = hslider("r", 0.5, 0.001, 4, 0.001);
env = _ * en.adsre(a,d,s,r, gate);
del_voice(ms,g) = _ : @ (ms*(ma.SR*0.001)) : _ *(g);
};
process = trig_delay(32,delTime,beginDel,direction,globalCurve) *(gain);