Skip to content

Message

OscMsg

OscMsg(
    address: str,
    data: str | bytes | bool | int | float | list | tuple = None,
    *,
    source: None | OscIn = None
)

Bases: Msg

Open Sound Control message

Parameters:

  • address (str) –

    Open Sound Control message address

  • data (str | bytes | bool | int | float | list | tuple, default: None ) –

    Open Sound Control message data

  • source (None | OscIn, default: None ) –

    The OscIn instance that generated the message

ctime

ctime: float

Message creation time in "Unix time" format

type

type: str = 'OSC'

Message type description for filtering and representation

address

address: str = address

Message address

data

data: str | bytes | bool | int | float | list | tuple = data

Message data

source

source: None | OscIn

Input port instance that generated the message

matches

matches(
    address: None | Container | str = None,
    data: (
        None | Container | str | bytes | bool | int | float | list | tuple
    ) = None,
) -> bool

Checks if message's attributes match all provided attribute conditions:

  1. If condition is None or omitted, it matches anything.

  2. If condition equals attribute, it matches the attribute.

  3. If condition is a container and contains the attribute, it matches the attribute.

Use Not(condition) to invert condition matching.

Returns:

  • bool

    True if all attributes match, False if any does not match