| 1 |
""" |
| 2 |
01-flanger.py - Hand-made simple flanger. |
| 3 |
|
| 4 |
A flanger is an audio effect produced by mixing two identical signals |
| 5 |
together, one signal delayed by a small and gradually changing period. |
| 6 |
This produces a swept comb filter effect: peaks and notches are produced |
| 7 |
in the resulting frequency spectrum, related to each other in a linear |
| 8 |
harmonic series. Varying the time delay causes these to sweep up and |
| 9 |
down the frequency spectrum. |
| 10 |
|
| 11 |
""" |
| 12 |
from pyo import * |
| 13 |
|
| 14 |
s = Server().boot() |
| 15 |
|
| 16 |
|
| 17 |
amp = Fader(fadein=0.25, mul=0.5).play() |
| 18 |
src = PinkNoise(amp).mix(2) |
| 19 |
|
| 20 |
|
| 21 |
middelay = 0.005 |
| 22 |
|
| 23 |
depth = Sig(0.99) |
| 24 |
depth.ctrl(title="Modulation Depth") |
| 25 |
lfospeed = Sig(0.2) |
| 26 |
lfospeed.ctrl(title="LFO Frequency in Hz") |
| 27 |
feedback = Sig(0.5, mul=0.95) |
| 28 |
feedback.ctrl(title="Feedback") |
| 29 |
|
| 30 |
|
| 31 |
lfo = Sine(freq=lfospeed, mul=middelay * depth, add=middelay) |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
flg = Delay(DCBlock(src), delay=lfo, feedback=feedback) |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
cmp = Compress(src + flg, thresh=-20, ratio=4).out() |
| 41 |
|
| 42 |
s.gui(locals()) |