jdxi_editor.midi.sysex.patch_values

jdxi_editor.midi.sysex.patch_values Patch sections in raw MIDI values, the form the JD-Xi itself sends.

Saved sections carry VALUE_FORMAT: "midi". A section taken from the synth’s memory also carries SYSEX, the section as one DT1 message, so it can be restored byte for byte.

Bundles saved before this were written from the editor controls, in their display units (ms, 0.0-1.0 fractions, signed ±63, …), but read back as raw values, so every load and save moved them. display_to_midi converts one of those values the way the control showed it, and upgrade_legacy_section converts a whole old section.

Example

>>> from jdxi_editor.midi.data.parameter.digital import DigitalPartialParam as P
>>> display_to_midi(P.AMP_PAN, -35)          # signed display value
29
>>> display_to_midi(P.AMP_ENV_ATTACK_TIME, 290.0)   # ms (10-1000)
36
>>> display_to_midi(P.AMP_ENV_SUSTAIN_LEVEL, 0.39)  # fraction
50

Attributes

VALUE_FORMAT

VALUE_FORMAT_MIDI

SYSEX

METADATA_KEYS

_TIMES

_LEVELS

Functions

param_class_for_address(address)

Parameter class of the section at a 4-byte address ("19012000"), or None.

_envelope_type(param) → Optional[str]

display_to_midi(param, value) → int

Raw MIDI value of param from the value its editor control shows.

section_values_to_midi(section[, param_class]) → dict

Copy of section with its parameter values converted by display_to_midi.

is_midi_section(section) → bool

upgrade_legacy_section(section) → dict

A section from an old bundle (display values) in raw MIDI values.

Module Contents

jdxi_editor.midi.sysex.patch_values.VALUE_FORMAT = 'VALUE_FORMAT'[source]
jdxi_editor.midi.sysex.patch_values.VALUE_FORMAT_MIDI = 'midi'[source]
jdxi_editor.midi.sysex.patch_values.SYSEX = 'SYSEX'[source]
jdxi_editor.midi.sysex.patch_values.METADATA_KEYS[source]
jdxi_editor.midi.sysex.patch_values._TIMES[source]
jdxi_editor.midi.sysex.patch_values._LEVELS[source]
jdxi_editor.midi.sysex.patch_values.param_class_for_address(address: str)[source]

Parameter class of the section at a 4-byte address (“19012000”), or None.

jdxi_editor.midi.sysex.patch_values._envelope_type(param) → str | None[source]
jdxi_editor.midi.sysex.patch_values.display_to_midi(param, value: Any) → int[source]

Raw MIDI value of param from the value its editor control shows.

Envelope times are in ms (10-5000 for the pitch envelope, 10-1000 otherwise), sustain levels are 0.0-1.0, everything else is in the parameter’s display range, which the parameter converts itself.

jdxi_editor.midi.sysex.patch_values.section_values_to_midi(section: dict, param_class=None) → dict[source]

Copy of section with its parameter values converted by display_to_midi.

jdxi_editor.midi.sysex.patch_values.is_midi_section(section: dict) → bool[source]
jdxi_editor.midi.sysex.patch_values.upgrade_legacy_section(section: dict) → dict[source]

A section from an old bundle (display values) in raw MIDI values.