jdxi_editor.midi.io.helper

This module provides address unified helper class for MIDI communication with the Roland JD-Xi. It integrates both MIDI input and output functionalities by combining the features of the MIDIInHandler and MIDIOutHandler classes.

Classes:
MIDIHelper: A helper class that inherits from both MIDIInHandler and MIDIOutHandler,

offering address consolidated interface for handling MIDI messages (including SysEx messages in JSON format) for the JD-Xi synthesizer.

Dependencies:
  • PySide6.QtCore.Signal for Qt signal support.

  • jdxi_editor.midi.input_handler.MIDIInHandler for handling incoming MIDI messages.

  • jdxi_editor.midi.output_handler.MIDIOutHandler for handling outgoing MIDI messages.

Classes

MidiIOHelper

MidiIOHelper

Module Contents

class jdxi_editor.midi.io.helper.MidiIOHelper(parent=None)[source]

Bases: jdxi_editor.midi.io.input_handler.MidiInHandler, jdxi_editor.midi.io.output_handler.MidiOutHandler

MidiIOHelper

Class to handle midi input/output

_instance = None[source]
_current_out_port = None[source]
_current_in_port = None[source]
in_port_name = ''[source]
out_port_name = ''[source]
midi_messages = [][source]
current_in = None[source]
current_out = None[source]
initialized = True[source]
send_mido_message(msg: mido.Message)[source]

send_mido_message

Parameters:

msg – mido.Message

Returns:

send_json_patch_to_instrument(json_string: str) None[source]

Send all parameters from a JSON patch to the instrument as SysEx messages.

Parameters:

json_string – str JSON string containing patch data

Returns:

None

json_patch_to_sysex_bytes(json_string: str) list[bytes][source]

Convert a JSON patch to a list of SysEx message bytes (for export to .syx). Uses the same param resolution and composition logic as send_json_patch_to_instrument.

Parameters:

json_string – str JSON string containing patch data

Returns:

list[bytes] List of SysEx message bytes, one per parameter

save_patch_as_syx(file_path: str, temp_folder) bool[source]

Save patch as raw Roland SysEx (.syx) from JSON files in temp folder. Reads each JSON file, converts to SysEx bytes, concatenates, and writes.

Parameters:
  • file_path – str Output .syx file path

  • temp_folder – Path-like Folder containing JSON patch files (from json_composer.process_editor)

Returns:

bool True on success

load_patch(file_path: str)[source]

Load the patch file and send to the instrument. Handles .jsz/.msz (JSON bundles), .json, and .syx (binary SysEx). .msz bundles may contain MIDI files (handled by PatchManager).

Parameters:

file_path – str

Returns:

None

__str__()[source]

__str__

Returns:

str String representation

__repr__()[source]
load_sysx_patch(file_path: str)[source]

Load the SysEx patch from a file and send to the instrument. Supports single messages and concatenated messages (e.g. Perl .syx format). Each F0…F7 block is sent as a separate message.

Parameters:

file_path – str File path as a string

Returns:

None

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

Set MIDI input and output ports

Parameters:
  • in_port – str

  • out_port – str

Returns:

bool True on success, False otherwise

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

Attempt to automatically connect to JD-Xi MIDI ports.

Parameters:
  • in_port – str

  • out_port – str

Returns:

bool True on success, False otherwise

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

Reconnect ports

Parameters:
  • in_port – str

  • out_port – str

Returns:

None

auto_connect_jdxi() bool[source]

Attempt to automatically connect to JD-Xi MIDI ports.

Returns:

bool True on success, False otherwise