platypush.backend.midi

class platypush.backend.midi.MidiBackend(device_name=None, port_number=None, midi_throttle_time=None, *args, **kwargs)[source]

This backend will listen for events from a MIDI device and post a MidiMessageEvent whenever a new MIDI event happens.

Triggers:

Requires:

  • rtmidi (pip install rtmidi)
__init__(device_name=None, port_number=None, midi_throttle_time=None, *args, **kwargs)[source]
Parameters:
  • device_name (str) – Name of the MIDI device. N.B. either device_name or port_number must be set. Use platypush.plugins.midi.query_ports() to get the available ports indices and names
  • port_number (int) – MIDI port number
  • midi_throttle_time (int) – If set, the MIDI events will be throttled - max one per selected time frame (in seconds). Set this parameter if you want to synchronize MIDI events with plugins that normally operate with a lower throughput.
run()[source]

Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.