jdxi_editor.ui.editors.synth.editor

synth_editor.py

This module defines the SynthEditor class, a base class for all editor windows in the JD-Xi Manager application. It provides an interface for editing synthesizer parameters, handling MIDI messages, and updating UI components.

Key Features: - UI Elements: Uses PySide6 widgets, including ComboBoxes, Sliders, and SpinBoxes, to adjust synthesizer parameters. - MIDI Integration: Sends and receives MIDI messages via MIDIHelper, supporting parameter changes, SysEx communication,

and program change handling.

  • Preset Management: Loads, updates, and applies instrument presets with PresetHandler and PresetLoader.

  • Parameter Control: Dynamically creates UI controls for synthesizer parameters, supporting bipolar values and digital conversion.

  • Shortcuts: Implements keyboard shortcuts for refreshing data and closing the window.

Dependencies: - PySide6 for the UI components. - jdxi_manager.midi for MIDI communication. - jdxi_manager.midi.data.parameter for synthesizer parameter handling. - jdxi_manager.ui.style for applying UI styles.

Attributes

TONE_DISPATCH

SYNTH_CAPABILITIES

Classes

SynthEditor

Base class for all editor windows

Functions

get_storage_scope(→ str)

get_editor_target(→ str)

Module Contents

jdxi_editor.ui.editors.synth.editor.TONE_DISPATCH[source]
jdxi_editor.ui.editors.synth.editor.SYNTH_CAPABILITIES[source]
jdxi_editor.ui.editors.synth.editor.get_storage_scope(msb: int) str[source]
jdxi_editor.ui.editors.synth.editor.get_editor_target(msb: int, umb: int) str[source]
class jdxi_editor.ui.editors.synth.editor.SynthEditor(midi_helper: object | None = None, parent: PySide6.QtWidgets.QWidget | None = None, address: jdxi_editor.midi.data.address.address.JDXiSysExAddress | None = None)[source]

Bases: jdxi_editor.ui.editors.synth.base.SynthBase

Base class for all editor windows

parameter_received[source]
partial_map[source]
sysex_current_data = None[source]
preset_preset_list = None[source]
programs = None[source]
cc_parameters[source]
nrpn_parameters[source]
nrpn_map[source]
bipolar_parameters = [][source]
midi_requests = [][source]
instrument_default_image = None[source]
instrument_title_label = None[source]
instrument_image_label = None[source]
instrument_icon_folder = None[source]
partial_number = None[source]
preset_helper = None[source]
instrument_selection_combo = None[source]
preset_type = None[source]
refresh_shortcut[source]
close_shortcut[source]
json_parser[source]
__str__()[source]
__repr__()[source]
_init_synth_data(synth_type: str = JDXi.Synth.DIGITAL_SYNTH_1, partial_number: int | None = 0)[source]

Initialize synth-specific data.

showEvent(event: PySide6.QtGui.QShowEvent) None[source]

Override showEvent to request current settings from the instrument when the editor is shown. This ensures the sliders pick up the current settings from the instrument, similar to Digital 1, Digital 2, and Analog synth editors.

Parameters:

event – QShowEvent

get_controls_as_dict()[source]

Get the current values of self.controls as a dictionary.

Returns:

dict A dictionary of control parameter names and their values.

_get_preset_helper_for_current_synth()[source]

Return the appropriate preset handler based on the current synth preset_type.

dispatch_sysex_to_area(json_sysex_data: str) None[source]

Dispatch SysEx data to the appropriate area for processing.

Parameters:

json_sysex_data

Returns:

None

abstract _update_controls(partial_no: int, sysex_data: dict, successes: list, failures: list) None[source]

Apply updates to the UI components based on the received SysEx data.

Parameters:
  • partial_no – int

  • sysex_data – dict

  • successes – list

  • failures – list

Returns:

None

By default has no partials, so subclass to implement partial updates

_parse_sysex_json(json_sysex_data: str) dict | None[source]

_parse_sysex_json

Parameters:

json_sysex_data – str

Returns:

dict

set_instrument_title_label(name: str, synth_type: str)[source]

set_instrument_title_label

Parameters:
  • name – str

  • synth_type – str

Returns:

None

update_combo_box_index(preset_number)[source]

Updates the QComboBox to reflect the loaded preset.

update_instrument_title()[source]

update instrument title

Returns:

update_instrument_preset(text: str)[source]

update_instrument_preset

Parameters:

text

Returns:

load_preset(preset_index)[source]

Load a preset by program change.

_handle_program_change(channel: int, program: int)[source]

Handle program change messages by requesting updated data

_handle_control_change(channel: int, control: int, value: int)[source]

Handle program change messages by requesting updated data

load_and_set_image(image_path, secondary_image_path=None)[source]

Helper function to load and set the image on the label.

update_instrument_image()[source]

Update the instrument image based on the selected synth.

_get_instrument_selection_combo()[source]

Get the instrument selection combo box from either the widget or direct attribute. Returns None if not found.

_get_instrument_image_label()[source]

Get the instrument image label from either the widget or direct attribute. Returns None if not found.

_get_selected_instrument_text() str[source]

_get_selected_instrument_text

Returns:

str

_parse_instrument_text(text: str) jdxi_editor.ui.editors.synth.specs.InstrumentDescriptor | None[source]
_try_load_specific_or_generic_image(name: str, type_: str) bool[source]
_fallback_to_default_image(reason: str)[source]
_update_common_controls(partial_number: int, filtered_data, successes, failures)[source]
_update_modify_controls(partial_number: int, filtered_data, successes, failures)[source]