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 display 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.
Classes
Base class for all editor windows |
Functions
|
Log changes between previous and current JSON data. |
Module Contents
- jdxi_editor.ui.editors.synth.editor.log_changes(previous_data, current_data)[source]
Log changes between previous and current JSON data.
- class jdxi_editor.ui.editors.synth.editor.SynthEditor(midi_helper: object | None = None, parent: PySide6.QtWidgets.QWidget | None = None)[source]
Bases:
jdxi_editor.ui.editors.synth.base.SynthBaseBase class for all editor windows
- _init_synth_data(synth_type: str = JDXiSynth.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
- create_instrument_preset_group(synth_type: str = 'Analog') PySide6.QtWidgets.QGroupBox[source]
Create the instrument preset group box.
- Parameters:
synth_type – str
- Returns:
QGroupBox
- 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_partial_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
- _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
- send_control_change(control_change: jdxi_editor.midi.data.control_change.base.ControlChange, value: int)[source]
Send MIDI CC message
- load_and_set_image(image_path, secondary_image_path=None)[source]
Helper function to load and set the image on the label.
- _get_instrument_selection_combo()[source]
Get the instrument selection combo box from either the widget or direct attribute. Returns None if not found.