Debian Codegraph @

Resources/modules/Dynamics/FeedbackLooper.c5

raw
1 class Module(BaseModule):
2 """
3 "Frequency self-modulated sound looper"
4
5 Description
6
7 This module loads a sound in a table and apply a frequency self-modulated
8 playback of the content. A Frequency self-modulation occurs when the
9 output sound of the playback is used to modulate the reading pointer speed.
10 That produces new harmonics in a way similar to waveshaping distortion.
11
12 Sliders
13
14 # Transposition :
15 Transposition, in cents, of the input sound
16 # Feedback :
17 Amount of self-modulation in sound playback
18 # Filter Frequency :
19 Frequency, in Hertz, of the filter
20 # Filter Q :
21 Q of the filter (inverse of the bandwidth)
22 # Dry / Wet :
23 Mix between the original signal and the degraded signal
24
25 Graph Only
26
27 # Overall Amplitude :
28 The amplitude curve applied on the total duration of the performance
29
30 Popups & Toggles
31
32 # Filter Type :
33 Type of the filter
34 # Polyphony Voices :
35 Number of voices played simultaneously (polyphony),
36 only available at initialization time
37 # Polyphony Chords :
38 Pitch interval between voices (chords),
39 only available at initialization time
40
41 """
42 def __init__(self):
43 BaseModule.__init__(self)
44 self.snd = self.addFilein("snd")
45 self.trfactor = CentsToTranspo(self.transpo, mul=self.polyphony_spread)
46 self.freq = Sig(self.trfactor, mul=self.snd.getRate())
47 self.dry = Osc(self.snd, self.freq, mul=self.polyphony_scaling * 0.5)
48 self.dsp = OscLoop(self.snd, self.freq, self.feed*0.0002, mul=self.polyphony_scaling * 0.5)
49 self.mix = self.dsp.mix(self.nchnls)
50 self.filt = Biquad(self.mix, freq=self.filt_f, q=self.filt_q, type=self.filt_t_index)
51 self.out = Interp(self.dry, self.filt, self.drywet, mul=self.env)
52
53 def filt_t(self, index, value):
54 self.filt.type = index
55
56 Interface = [
57 cfilein(name="snd"),
58 cgraph(name="env", label="Overall Amplitude", func=[(0,1),(1,1)], col="blue1"),
59 cslider(name="transpo", label="Transposition", min=-4800, max=4800, init=0, unit="cnts", col="red1"),
60 cslider(name="feed", label="Feedback", min=0, max=1, init=0.25, unit="x", col="purple1"),
61 cslider(name="filt_f", label="Filter Frequency", min=20, max=18000, init=10000, rel="log", unit="Hz", col="green1"),
62 cslider(name="filt_q", label="Filter Q", min=0.5, max=25, init=1, rel="log", unit="x", col="green2"),
63 cpopup(name="filt_t", label="Filter Type", init="Lowpass", value=["Lowpass", "Highpass", "Bandpass", "Bandreject"], col="green1"),
64 cslider(name="drywet", label="Dry / Wet", min=0, max=1, init=1, rel="lin", unit="x", col="blue1"),
65 cpoly()
66 ]