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 |
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.MidiOutHandlerMidiIOHelper
Class to handle midi input/output
- 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
- 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