Debian Codegraph @

docs/_sources/examples/06-filters/04-phasing.rst.txt

raw
1 04-phasing.py - The phasing effect.
2 ============================================================================================================================================
3
4
5 The Phaser object implements a variable number of second-order
6 allpass filters, allowing to quickly build complex phasing effects.
7
8 A phaser is an electronic sound processor used to filter a signal
9 by creating a series of peaks and troughs in the frequency spectrum.
10 The position of the peaks and troughs of the waveform being affected
11 is typically modulated so that they vary over time, creating a sweeping
12 effect. For this purpose, phasers usually include a low-frequency
13 oscillator. - https://en.wikipedia.org/wiki/Phaser_(effect)
14
15 A phase shifter unit can be built from scratch with the Allpass2 object,
16 which implement a second-order allpass filter that create, when added to
17 the original source, one notch in the spectrum.
18
19 .. code-block:: python
20
21 from pyo import *
22
23 s = Server().boot()
24
25 # Simple fadein.
26 fade = Fader(fadein=0.5, mul=0.2).play()
27
28 # Noisy source.
29 a = PinkNoise(fade)
30
31 # These LFOs modulate the `freq`, `spread` and `q` arguments of
32 # the Phaser object. We give a list of two frequencies in order
33 # to create two-streams LFOs, therefore a stereo phasing effect.
34 lf1 = Sine(freq=[0.1, 0.15], mul=100, add=250)
35 lf2 = Sine(freq=[0.18, 0.13], mul=0.4, add=1.5)
36 lf3 = Sine(freq=[0.07, 0.09], mul=5, add=6)
37
38 # Apply the phasing effect with 20 notches.
39 b = Phaser(a, freq=lf1, spread=lf2, q=lf3, num=20, mul=0.5).out()
40
41 s.gui(locals())
42