| 1 |
""" |
| 2 |
Sending audio streams as Open Sound Control messages |
| 3 |
|
| 4 |
**03-send-streams.py** |
| 5 |
|
| 6 |
This program does not generate any sound. All it does is to produce |
| 7 |
audio streams that are then send on an open port as OSC messages in |
| 8 |
order to control a granulation process created in the example |
| 9 |
*02-receive-streams.py*. |
| 10 |
|
| 11 |
""" |
| 12 |
from pyo import * |
| 13 |
|
| 14 |
s = Server().boot() |
| 15 |
|
| 16 |
|
| 17 |
dens = Sig(0.5) |
| 18 |
dens.ctrl(title="Density of grains per second") |
| 19 |
|
| 20 |
|
| 21 |
pos = Randi(min=0.00, max=1.00, freq=0.1) |
| 22 |
|
| 23 |
|
| 24 |
pit = Sig(0) |
| 25 |
pit.ctrl(title="Transposition per grain") |
| 26 |
|
| 27 |
|
| 28 |
dur = Sig(0.5) |
| 29 |
dur.ctrl(title="Grain duration") |
| 30 |
|
| 31 |
|
| 32 |
send = OscSend( |
| 33 |
input=[dens, pos, pit, dur], |
| 34 |
port=9000, |
| 35 |
address=["/density", "/position", "/pitch_rand", "/duration"], |
| 36 |
host="127.0.0.1", |
| 37 |
) |
| 38 |
|
| 39 |
s.gui(locals()) |