| 1 |
class Module(BaseModule): |
| 2 |
""" |
| 3 |
"Multi-stages second-order phase shifter allpass filters" |
| 4 |
|
| 5 |
Description |
| 6 |
|
| 7 |
Phaser implements a multi-stages second-order allpass filters, |
| 8 |
which, when mixed with the original signal, create a serie of |
| 9 |
peaks/notches in the sound. |
| 10 |
|
| 11 |
Sliders |
| 12 |
|
| 13 |
# Base Freq : |
| 14 |
Center frequency of the first notch of the phaser |
| 15 |
# Q Factor : |
| 16 |
Q factor (resonance) of the phaser notches |
| 17 |
# Notch Spread : |
| 18 |
Distance between phaser notches |
| 19 |
# Feedback : |
| 20 |
Amount of phased signal fed back into the phaser |
| 21 |
# Dry / Wet : |
| 22 |
Mix between the original signal and the phased signal |
| 23 |
|
| 24 |
Graph Only |
| 25 |
|
| 26 |
# Overall Amplitude : |
| 27 |
The amplitude curve applied on the total duration of the performance |
| 28 |
|
| 29 |
Popups & Toggles |
| 30 |
|
| 31 |
# Number of Stages : |
| 32 |
Changes notches bandwidth (stacked filters), |
| 33 |
only available at initialization time |
| 34 |
# Polyphony Voices : |
| 35 |
Number of voices played simultaneously (polyphony), |
| 36 |
only available at initialization time |
| 37 |
# Polyphony Spread : |
| 38 |
Pitch variation between voices (chorus), |
| 39 |
only available at initialization time |
| 40 |
|
| 41 |
""" |
| 42 |
def __init__(self): |
| 43 |
BaseModule.__init__(self) |
| 44 |
self.snd = self.addSampler("snd") |
| 45 |
self.phaser = Phaser(input=self.snd, freq=self.centerfreq, spread=self.spread, q=self.fq, feedback=self.fb, num=self.stages_index+1, mul=0.5) |
| 46 |
self.out = Interp(self.snd, self.phaser, self.drywet, mul=self.env) |
| 47 |
|
| 48 |
Interface = [ csampler(name="snd"), |
| 49 |
cgraph(name="env", label="Overall Amplitude", func=[(0,1),(1,1)], col="blue1"), |
| 50 |
cslider(name="centerfreq", label="Base Freq", min=20, max=15000, init=100, rel="log", unit="Hz", col="green1"), |
| 51 |
cslider(name="fq", label="Q Factor", min=0.5, max=10, init=5, rel="lin", unit="Q", col="green2"), |
| 52 |
cslider(name="spread", label="Notch Spread", min=0.1, max=2, init=1.25, rel="lin", unit="x", col="green3"), |
| 53 |
cslider(name="fb", label="Feedback", min=0, max=0.999, init=0.7, rel="lin", unit="x", col="purple1"), |
| 54 |
cslider(name="drywet", label="Dry / Wet", min=0, max=1, init=0.8, rel="lin", unit="x", col="blue1"), |
| 55 |
cpopup(name="stages", label="Number of Stages", init="16", rate="i", col="grey", value=[str(i+1) for i in range(64)]), |
| 56 |
cpoly() |
| 57 |
] |
| 58 |
|