Debian Codegraph @

pyo/examples/x17-osc/01-osc-scan.py

raw symbols SCIP
1 """
2 Scan Open Sound Control inputs on a specific port
3
4 **01-osc-scan.py**
5
6 Scan Open Sound Control inputs on a specific port. This program
7 can be used to find the address used by a specific device or the
8 range of values sent on a given address.
9
10 """
11 from pyo import *
12
13 # Set the port number.
14 port = 9002
15
16 s = Server().boot().start()
17
18 print("Play with your OSC interface...")
19
20 # Function called whenever OscDataReceive receives an input.
21 def printInputMessage(address, *args):
22 print("Address =", address)
23 print("Values =", args)
24 print("---------------")
25
26
27 # OscDataReceive accepts any kind of OSC message.
28 # The wildcard alone ("*") to the address argument means that
29 # the object will monitor any address on the port.
30 scan = OscDataReceive(port=port, address="*", function=printInputMessage)
31
32 s.gui(locals())