Debian Codegraph @

pyo/examples/x08-dynamics/04-rms-tracing.py

raw symbols SCIP
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 # Play the drum lopp.
19 sf = SfPlayer("../snds/drumloop.wav", loop=True)
20
21 # Follow the amplitude envelope of the input sound.
22 follow = Follower(sf)
23
24 # Scale the amplitude envelope (0 -> 1) to the desired frequency
25 # range (MINFREQ -> MAXFREQ).
26 freq = Scale(follow, outmin=MINFREQ, outmax=MAXFREQ)
27
28 # Filter the signal with a band pass. Play with the Q to make the
29 # effect more or less present.
30 filter = ButBP(sf.mix(2), freq=freq, q=2).out()
31
32 s.gui(locals())