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