Debian Codegraph @

pyo/examples/x17-osc/03-send-streams.py

raw symbols SCIP
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 # Manual control of the density of grains per second.
17 dens = Sig(0.5)
18 dens.ctrl(title="Density of grains per second")
19
20 # Generate a normalized random position in the sound with interpolation.
21 pos = Randi(min=0.00, max=1.00, freq=0.1)
22
23 # Manual control of the transposition per grain.
24 pit = Sig(0)
25 pit.ctrl(title="Transposition per grain")
26
27 # Manual control of the grain's duration.
28 dur = Sig(0.5)
29 dur.ctrl(title="Grain duration")
30
31 # Takes audio signals and sends their current value as OSC messages every buffer size.
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())