subsequence.osc =============== .. py:module:: subsequence.osc .. autoapi-nested-parse:: OSC integration for realtime control and state broadcasting. Start the OSC server by calling ``composition.osc()`` before ``composition.play()``. The server listens on a UDP port (default 9000) for incoming control messages and sends state updates to a target host/port (default 127.0.0.1:9001). Built-in Receive Handlers ───────────────────────── - ``/bpm ``: Set tempo - ``/mute/``: Mute a pattern - ``/unmute/``: Unmute a pattern - ``/data/ ``: Update shared data (supports int, float, str) Built-in Send Events ──────────────────── - ``/bar ``: On bar change - ``/chord ``: On chord change - ``/section ``: On section change - ``/bpm ``: On tempo change Module Contents --------------- .. py:class:: OscServer(composition: subsequence.composition.Composition, receive_port: int = 9000, send_port: int = 9001, send_host: str = '127.0.0.1', receive_host: str = '0.0.0.0') Async OSC server/client for bi-directional communication. Wire up the OSC ports and built-in control handlers; call start() to begin listening. .. py:method:: map(address: str, handler: Callable) -> None Register a custom OSC handler. .. py:method:: send(address: str, *args: Any) -> None Send an OSC message. .. py:method:: start() -> None :async: Start the OSC server and client. .. py:method:: stop() -> None :async: Stop the OSC server and close the outgoing client socket.