jdxi_editor.midi.sysex.patch_bundle
jdxi_editor.midi.sysex.patch_bundle Write and read the JSON sections of a patch bundle (.jsz / .msz).
Saving takes each section from the synth’s memory (see SynthMemory) when it
is complete there: the JSON is the parsed DT1, exactly as a reply from the
JD-Xi, plus SYSEX (that DT1) and VALUE_FORMAT: "midi". Sections the
memory does not hold are written from the editor controls and converted to
raw MIDI values.
Loading sends a section’s SYSEX unchanged when it has one; older
sections, saved in display units, are converted first.
Attributes
Functions
|
|
|
Bundle JSON for one DT1 section: parsed values, 4-byte ADDRESS, SYSEX. |
|
Write every complete patch section in memory; returns their addresses. |
|
Convert the editor-written sections in folder to raw MIDI values. |
|
The section's DT1 message, if it carries one. |
|
A loaded section in raw MIDI values (old sections are converted). |
|
One DT1 per parameter of a section in raw MIDI values. |
|
Copy the first MIDI file of a .msz bundle into folder, under a name of our own. |
Module Contents
- jdxi_editor.midi.sysex.patch_bundle.section_from_dt1(dt1: bytes) dict[source]
Bundle JSON for one DT1 section: parsed values, 4-byte ADDRESS, SYSEX.
- jdxi_editor.midi.sysex.patch_bundle.write_memory_sections(memory: jdxi_editor.midi.io.synth_memory.SynthMemory, folder: pathlib.Path, only: set[str] | None = None) set[str][source]
Write every complete patch section in memory; returns their addresses.
- Parameters:
only – when given, the 4-byte addresses (hex, e.g.
"19420000") that a read of the JD-Xi has just confirmed: the other sections in memory may be from before (the editor controls are used for them, as the user was told)
- jdxi_editor.midi.sysex.patch_bundle.convert_editor_sections(folder: pathlib.Path, skip: set[str]) int[source]
Convert the editor-written sections in folder to raw MIDI values.
- Parameters:
skip – addresses written from the synth’s memory (already raw)
- Returns:
number of files converted
- jdxi_editor.midi.sysex.patch_bundle.section_sysex(section: dict) bytes | None[source]
The section’s DT1 message, if it carries one.
- jdxi_editor.midi.sysex.patch_bundle.load_section(section: dict) dict[source]
A loaded section in raw MIDI values (old sections are converted).
- jdxi_editor.midi.sysex.patch_bundle.section_param_dt1s(section: dict) list[bytes][source]
One DT1 per parameter of a section in raw MIDI values.
The values are written as they are (no display conversion), at the section address plus the parameter’s offset; 4-nibble parameters are split as the JD-Xi expects.
- jdxi_editor.midi.sysex.patch_bundle.extract_bundle_midi(zip_ref, folder: pathlib.Path) pathlib.Path | None[source]
Copy the first MIDI file of a .msz bundle into folder, under a name of our own.
The name inside the ZIP is never used as a path: «../../x.mid» or an absolute path would write outside folder (zip slip). Oversized entries are refused.
- Parameters:
zip_ref – an open zipfile.ZipFile
- Returns:
the file written, or None when the bundle has no usable MIDI file