Skip to content

Ports

MidiIn

MidiIn(port_name: str, *, virtual: bool = False)

Bases: _MidiPortMixin, Input

MIDI input port. Produces MidiMsg objects.

Parameters:

  • port_name (str) –

    MIDI input port name

  • virtual (bool, default: False ) –

    Create virtual port (Linux and macOS only)

is_enabled

is_enabled: bool

True if port is listening messages / ready to send messages

calls

calls: list[None | tuple[tuple, dict], list[SubscribedCall]]

Message match arguments and callables that will be called with matching incoming messages. None conditions matches any message.

name

name: str

MIDI port name

attached_passthrough_outs

attached_passthrough_outs: list[MidiOut] = []

MidiOut ports attached as pass-through ports which will send all incoming messages as soon as they arrive before sending them to calls

passthrough_out

passthrough_out(midi_output: MidiOut) -> None

Attach MidiOut as a pass-through port to send all incoming messages as soon as they arrive, before sending them to calls. This can greatly reduce latency.

Parameters:

MidiOut

MidiOut(port_name: str, *, virtual: bool = False)

Bases: _MidiPortMixin, Output

MIDI output port. Sends MidiMsg objects.

Parameters:

  • port_name (str) –

    MIDI output port name

  • virtual (bool, default: False ) –

    Create virtual port (Linux and macOS only)

is_enabled

is_enabled: bool

True if port is listening messages / ready to send messages

name

name: str

MIDI port name

send

send(msg: MidiMsg) -> None

Send the MIDI message.

Parameters: