Debian Codegraph @

pyo/examples/x02-controls/04-building-lfo.py

raw symbols SCIP
1 """
2 04-building-lfo.py - Audio control of parameters.
3
4 One of the most important thing with computer music is the
5 trajectories taken by parameters over time. This is what
6 gives life to the synthesized sound.
7
8 One way to create moving values is by connecting a low
9 frequency oscillator to an object's attribute. This script
10 shows that process.
11
12 Other possibilities that will be covered later use random
13 class objects or feature extraction from an audio signal.
14
15 """
16 from pyo import *
17
18 s = Server().boot()
19
20 # Creates a noise source
21 n = Noise()
22
23 # Creates an LFO oscillating +/- 500 around 1000 (filter's frequency)
24 lfo1 = Sine(freq=0.1, mul=500, add=1000)
25 # Creates an LFO oscillating between 2 and 8 (filter's Q)
26 lfo2 = Sine(freq=0.4).range(2, 8)
27 # Creates a dynamic bandpass filter applied to the noise source
28 bp1 = ButBP(n, freq=lfo1, q=lfo2).out()
29
30 # The LFO object provides more waveforms than just a sine wave
31
32 # Creates a ramp oscillating +/- 1000 around 12000 (filter's frequency)
33 lfo3 = LFO(freq=0.25, type=1, mul=1000, add=1200)
34 # Creates a square oscillating between 4 and 12 (filter's Q)
35 lfo4 = LFO(freq=4, type=2).range(4, 12)
36 # Creates a second dynamic bandpass filter applied to the noise source
37 bp2 = ButBP(n, freq=lfo3, q=lfo4).out(1)
38
39 s.gui(locals())