Debian Codegraph @

pyo/examples/x02-controls/02-dynamic-control.py

raw symbols SCIP
1 """
2 02-dynamic-control.py - Graphical control for parameters.
3
4 With pyo, it's easy to quickly try some parameter combination
5 with the controller window already configured for each object.
6 To open the controller window, just call the ctrl() method on
7 the object you want to control.
8
9 """
10 from pyo import *
11
12 s = Server().boot()
13 s.amp = 0.1
14
15 # Creates two objects with cool parameters, one per channel.
16 a = FM().out()
17 b = FM().out(1)
18
19 # Opens the controller windows.
20 a.ctrl(title="Frequency modulation left channel")
21 b.ctrl(title="Frequency modulation right channel")
22
23 # If a list of values is given at a particular argument, the ctrl
24 # window will show a multislider to set each value separately.
25
26 oscs = Sine([100, 200, 300, 400, 500, 600, 700, 800], mul=0.1).out()
27 oscs.ctrl(title="Simple additive synthesis")
28
29 s.gui(locals())