Debian Codegraph @

Resources/modules/Time/DelayMod.c5

raw
1 class Module(BaseModule):
2 """
3 "Stereo delay module with LFO on delay times"
4
5 Description
6
7 A stereo delay whose delay times are modulated with LFO of different shapes.
8
9 Sliders
10
11 # Delay Time L :
12 Delay time of the left channel delay
13 # Delay Time R :
14 Delay time of the right channel delay
15 # LFO Depth L :
16 Amplitude of the LFO applied on left channel delay time
17 # LFO Depth R :
18 Amplitude of the LFO applied on right channel delay time
19 # LFO Freq L :
20 Frequency of the LFO applied on left channel delay time
21 # LFO Freq R :
22 Frequency of the LFO applied on right channel delay time
23 # Gain Delay L :
24 Amplitude of the left channel delay
25 # Gain Delay R :
26 Amplitude of the right channel delay
27 # Feedback :
28 Amount of delayed signal fed back in the delay chain
29 # LFO Sharpness :
30 Sharper waveform results in more harmonics in the LFO spectrum.
31 # Dry / Wet :
32 Mix between the original signal and the delayed signals
33
34 Graph Only
35
36 # Overall Amplitude :
37 The amplitude curve applied on the total duration of the performance
38
39 Popups & Toggles
40
41 # LFO Waveform L :
42 Shape of the LFO waveform applied on left channel delay
43 # LFO Waveform R :
44 Shape of the LFO waveform applied on right channel delay
45 # Polyphony Voices :
46 Number of voices played simultaneously (polyphony),
47 only available at initialization time
48 # Polyphony Spread :
49 Pitch variation between voices (chorus),
50 only available at initialization time
51
52 """
53 def __init__(self):
54 BaseModule.__init__(self)
55 self.snd = self.addSampler("snd")
56 self.lfol = LFO(self.speedl, sharp=self.sharp, mul=self.depthl, type=self.wavel_index, add=1)
57 self.lfor = LFO(self.speedr, sharp=self.sharp, mul=self.depthr, type=self.waver_index, add=1)
58 self.ampl = DBToA(self.gainl)
59 self.ampr = DBToA(self.gainr)
60 self.delay = Delay(self.snd, delay=[self.dell*self.lfol,self.delr*self.lfor], feedback=self.fb, maxdelay=20, mul=[self.ampl, self.ampr])
61 self.out = Interp(self.snd, self.delay, self.drywet, mul=self.env*0.5)
62
63 def wavel(self, index, value):
64 self.lfol.type = (index - 1) % 8
65
66 def waver(self, index, value):
67 self.lfor.type = (index - 1) % 8
68
69 Interface = [ csampler(name="snd", label="Audio"),
70 cgraph(name="env", label="Overall Amplitude", func=[(0,1),(1,1)], col="blue1"),
71 cslider(name="dell", label="Delay Time L", min=0.0001, max=10, init=0.15, gliss=0.1, rel="log", unit="sec", half=True, col="purple1"),
72 cslider(name="delr", label="Delay Time R", min=0.0001, max=10, init=0.25, gliss=0.1, rel="log", unit="sec", half=True, col="red1"),
73 cslider(name="depthl", label="LFO Depth L", min=0.001, max=0.5, init=0.05, rel="log", unit="x", half=True, col="purple2"),
74 cslider(name="depthr", label="LFO Depth R", min=0.001, max=0.5, init=0.05, rel="log", unit="x", half=True, col="red2"),
75 cslider(name="speedl", label="LFO Freq L", min=0.001, max=200, init=1, rel="log", unit="Hz", half=True, col="purple3"),
76 cslider(name="speedr", label="LFO Freq R", min=0.001, max=200, init=1.1, rel="log", unit="Hz", half=True, col="red3"),
77 cslider(name="gainl", label="Gain Delay L", min=-48, max=18, init=0, rel="lin", unit="dB", half=True, col="purple4"),
78 cslider(name="gainr", label="Gain Delay R", min=-48, max=18, init=0, rel="lin", unit="dB", half=True, col="red4"),
79 cslider(name="fb", label="Feedback", min=0, max=0.999, init=0.5, rel="lin", unit="x", col="green1"),
80 cslider(name="sharp", label="LFO Sharpness", min=0, max=1, init=0.5, rel="lin", unit="x", col="green2"),
81 cslider(name="drywet", label="Dry / Wet", min=0, max=1, init=0.7, rel="lin", unit="x", col="blue1"),
82 cpopup(name="wavel", label="LFO Waveform L", init="Sine", col="purple2", value=["Sine", "Saw Up", "Saw Down", "Square",
83 "Triangle", "Pulse", "Bipolar Pulse", "SAH"]),
84 cpopup(name="waver", label="LFO Waveform R", init="Sine", col="red2", value=["Sine", "Saw Up", "Saw Down", "Square",
85 "Triangle", "Pulse", "Bipolar Pulse", "SAH"]),
86 cpoly()
87 ]
88