jdxi_editor.midi.io.backend
Starting without a MIDI backend.
python-rtmidi raises from MidiIn() / MidiOut() when it cannot reach
the platform’s MIDI service at all. On Linux that is whenever /dev/snd/seq
is missing, because the kernel’s snd-seq module is not loaded – the
normal state in a container, on a minimal install, and on a CI runner, where
it reads:
MidiInAlsa::initialize: error creating ALSA sequencer client object
An unguarded construction makes that fatal: the editor cannot be built at all, and the user is shown a traceback rather than a message. But the editor is useful without a JD-Xi attached, and already opens its MIDI configuration dialog when it finds no ports, so an absent backend should look like “no ports” rather than a crash.
NoMidiBackend answers every method the editor calls on a port, so
callers need no special case and nothing has to tolerate None. rtmidi’s
own dummy API would have done this, but the published wheels are not built
with it: get_compiled_api() offers only the platform’s real backend.
Classes
A MIDI port that is always closed and has nothing to offer. |
Functions
|
Build an rtmidi port, or a stand-in when there is no MIDI backend. |
Module Contents
- class jdxi_editor.midi.io.backend.NoMidiBackend[source]
A MIDI port that is always closed and has nothing to offer.
- jdxi_editor.midi.io.backend.open_rtmidi(factory, kind: str)[source]
Build an rtmidi port, or a stand-in when there is no MIDI backend.
- Parameters:
factory –
rtmidi.MidiInorrtmidi.MidiOutkind – str what the port is for, for the log line
- Returns:
the rtmidi port, or
NoMidiBackend