| 1 |
""" |
| 2 |
04-rms-tracing.py - Auto-wah effect. |
| 3 |
|
| 4 |
The auto-wah effect (also know as "envelope following filter") is like a |
| 5 |
wah-wah effect, but instead of being controlled by a pedal, it is the RMS |
| 6 |
amplitude of the input sound which control it. The envelope follower (RMS) |
| 7 |
is rescaled and used to change the frequency of a bandpass filter applied |
| 8 |
to the source. |
| 9 |
|
| 10 |
""" |
| 11 |
from pyo import * |
| 12 |
|
| 13 |
s = Server().boot() |
| 14 |
|
| 15 |
MINFREQ = 250 |
| 16 |
MAXFREQ = 5000 |
| 17 |
|
| 18 |
|
| 19 |
sf = SfPlayer("../snds/drumloop.wav", loop=True) |
| 20 |
|
| 21 |
|
| 22 |
follow = Follower(sf) |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
freq = Scale(follow, outmin=MINFREQ, outmax=MAXFREQ) |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
filter = ButBP(sf.mix(2), freq=freq, q=2).out() |
| 31 |
|
| 32 |
s.gui(locals()) |