jdxi_editor.jdxi.preset.data
Module: preset_data
This module defines the JDXIPresetData class, which provides methods to retrieve structured preset data for different JD-Xi synth types, including Analog, Digital1, Digital2, and Drum. It calculates MIDI bank and program values for use in MIDI Program Change messages.
- Classes:
JDXIPresetData: Provides static methods for looking up JD-Xi presets by synth type and index.
- Constants and Enums (from imports):
JDXISynth: Enum representing synth types (ANALOG, DIGITAL_1, DIGITAL_2, DRUM).
JDXIPresets: Named preset lists for each synth type.
Example usage:
>>>from jdxi_editor.jdxi.synth.type import JDXISynth …preset_data = JDXIPresetData.get_preset_details(JDXISynth.DIGITAL_1, 10) …print(preset_data)
# Output: # { # ‘presets’: […], # ‘bank_msb’: 1, # ‘bank_lsb’: 0, # ‘program’: 10 # }
>>>import json …from dataclasses import asdict … …preset = JDXiPresetData.get_preset_details(JDXiSynth.ANALOG_SYNTH, 5) … …with open(“preset.json”, “w”) as f: … json.dump(asdict(preset), f, indent=2) … …with open(“preset.json”, “r”) as f: … data = json.load(f) … preset = JDXiPresetData(**data)