The latest version of this manual can be found at http://dsacre.github.io/pyliblo/doc/.
Return the current time as a floating point number (seconds since January 1, 1900).
A server that can receive OSC messages using a simple single-threaded polling model. Use ServerThread for an OSC server that runs in its own thread and never blocks.
Create a new Server object.
Receive and dispatch one OSC message. Blocking by default, unless timeout is specified.
|Parameters:||timeout – Time in milliseconds after which the function returns if no messages have been received. timeout may be 0, in which case the function always returns immediately, whether messages have been received or not.|
|Returns:||True if a message was received, otherwise False.|
Register a callback function for OSC messages with matching path and argument types.
Delete a callback function. For both path and typespec, None may be used as a wildcard.
New in version 0.9.2.
|Parameters:||obj – The object that implements the OSC callbacks to be registered. By default this is the server object itself.|
This function is usually called automatically by the server’s constructor, unless its reg_methods parameter was set to False.
Add bundle notification handlers.
New in version 0.10.0.
The server’s URL.
The server’s port number.
The server’s protocol (one of the constants UDP, TCP, or UNIX).
Return the file descriptor of the server socket, or -1 if not supported by the underlying server protocol.
Free the underlying server object and close its port. Note that this will also happen automatically when the server is deallocated.
Unlike Server, ServerThread uses its own thread which runs in the background to dispatch messages. ServerThread has the same methods as Server, with the exception of Server.recv(). Instead, it defines two additional methods start() and stop().
Because liblo creates its own thread to receive and dispatch messages, callback functions will not be run in the main Python thread!
Create a new ServerThread object, which can receive OSC messages. Unlike Server, ServerThread uses its own thread which runs in the background to dispatch messages. Note that callback methods will not be run in the main Python thread!
Start the server thread. liblo will now start to dispatch any messages it receives.
Stop the server thread.
A decorator that serves as a more convenient alternative to Server.add_method().
Set the path and argument types for which the decorated method is to be registered.
Create a new Address object from the given hostname/port or URL.
The address’s URL.
The address’s hostname.
The address’s port number.
The address’s protocol (one of the constants UDP, TCP, or UNIX).
An OSC message, consisting of a path and arbitrary arguments.
Create a new Message object.
Append the given arguments to the message. Arguments can be single values or (typetag, data) tuples.
A bundle of one or more messages to be sent and dispatched together.
Create a new Bundle object. You can optionally specify a time at which the messages should be dispatched (as an OSC timetag float), and any number of messages to be included in the bundle.
Add one or more messages to the bundle.
Raised when creating a liblo OSC server fails.
When constructing a message, pyliblo automatically converts arguments to an appropriate OSC data type. To explicitly specify the OSC data type to be transmitted, pass a (typetag, data) tuple instead. Some types can’t be unambiguously recognized, so they can only be sent that way.
The mapping between OSC and Python data types is shown in the following table:
|typetag||OSC data type||Python data type|
|'h'||int64||long (Python 2.x), int (Python 3.x)|
|'c'||char||str (single character)|
|'m'||midi||tuple of four ints|
|'b'||blob||list of ints (Python 2.x), bytes (Python 3.x)|