jdxi_editor.midi.io.controller

MIDI I/O Controller for JD-Xi

This module provides the MidiIOController class, which facilitates MIDI communication with the Roland JD-Xi synthesizer. It allows users to list, open, and manage MIDI input and output ports, automatically detect JD-Xi ports, and handle MIDI message reception.

Features: - Retrieve available MIDI input and output ports. - Automatically detect JD-Xi MIDI ports. - Open and close MIDI input and output ports by name or index. - Check the status of open MIDI ports. - Set a callback for incoming MIDI messages.

Dependencies: - rtmidi for MIDI communication. - PyQt6.QtCore for QObject-based structure.

Example Usage:

controller = MidiIOController() controller.open_ports(“JD-Xi MIDI IN”, “JD-Xi MIDI OUT”) print(controller.current_in_port, controller.current_out_port)

Classes

MidiIOController

Helper class for MIDI communication with the JD-Xi

Module Contents

class jdxi_editor.midi.io.controller.MidiIOController(parent: PySide6.QtCore.QObject)[source]

Bases: PySide6.QtCore.QObject

Helper class for MIDI communication with the JD-Xi

midi_in[source]
midi_out[source]
input_port_number: int | None = None[source]
output_port_number: int | None = None[source]
property current_in_port: str | None[source]

Get current input port name

Returns:

Optional[str], MIDI input port name

property current_out_port: str | None[source]

Get current output port name

Returns:

Optional[str], MIDI output port name

get_input_ports() List[str][source]

Get available MIDI input ports

Returns:

List[str], MIDI input ports

get_output_ports() List[str][source]

Get available MIDI output ports

Returns:

List[str], MIDI output ports

find_jdxi_ports() Tuple[str | None, str | None][source]

Find JD-Xi input and output ports

Returns:

Tuple[Optional[str], Optional[str]], JD-Xi input and output ports

open_input(port_name_or_index: str) bool[source]

Open MIDI input port by name or index

Parameters:

port_name_or_index – str, MIDI input port name or index

Returns:

bool True if successful, False otherwise

open_output(port_name_or_index: str) bool[source]

Open MIDI output port by name or index

Parameters:

port_name_or_index – str

Returns:

bool True if successful, False otherwise

open_input_port(port_name_or_index: str) bool[source]

Open MIDI input port by name or index

Parameters:

port_name_or_index – str

Returns:

bool

open_output_port(port_name_or_index: str) bool[source]

Open MIDI output port by name or index

Parameters:

port_name_or_index – str, MIDI output port name or index

Returns:

bool True if successful, False otherwise

close_ports() None[source]

Close MIDI ports

Returns:

None

property is_input_open: bool[source]

Check if MIDI input port is open

Returns:

bool

property is_output_open: bool[source]

Check if MIDI output port is open

Returns:

bool

open_ports(in_port: str, out_port: str) bool[source]

Open both input and output ports by name

Parameters:
  • in_port – str, Input port name or None

  • out_port – str, Output port name or None

Returns:

bool