Debian Codegraph @

docs/_sources/examples/17-osc/01-osc-scan.rst.txt

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