jdxi_editor.midi.sysex.patch_values =================================== .. py:module:: jdxi_editor.midi.sysex.patch_values .. autoapi-nested-parse:: 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. .. rubric:: 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 ---------- .. autoapisummary:: jdxi_editor.midi.sysex.patch_values.VALUE_FORMAT jdxi_editor.midi.sysex.patch_values.VALUE_FORMAT_MIDI jdxi_editor.midi.sysex.patch_values.SYSEX jdxi_editor.midi.sysex.patch_values.METADATA_KEYS jdxi_editor.midi.sysex.patch_values._TIMES jdxi_editor.midi.sysex.patch_values._LEVELS Functions --------- .. autoapisummary:: jdxi_editor.midi.sysex.patch_values.param_class_for_address jdxi_editor.midi.sysex.patch_values._envelope_type jdxi_editor.midi.sysex.patch_values.display_to_midi jdxi_editor.midi.sysex.patch_values.section_values_to_midi jdxi_editor.midi.sysex.patch_values.is_midi_section jdxi_editor.midi.sysex.patch_values.upgrade_legacy_section Module Contents --------------- .. py:data:: VALUE_FORMAT :value: 'VALUE_FORMAT' .. py:data:: VALUE_FORMAT_MIDI :value: 'midi' .. py:data:: SYSEX :value: 'SYSEX' .. py:data:: METADATA_KEYS .. py:data:: _TIMES .. py:data:: _LEVELS .. py:function:: param_class_for_address(address: str) Parameter class of the section at a 4-byte address ("19012000"), or None. .. py:function:: _envelope_type(param) -> Optional[str] .. py:function:: display_to_midi(param, value: Any) -> int 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. .. py:function:: section_values_to_midi(section: dict, param_class=None) -> dict Copy of *section* with its parameter values converted by display_to_midi. .. py:function:: is_midi_section(section: dict) -> bool .. py:function:: upgrade_legacy_section(section: dict) -> dict A section from an old bundle (display values) in raw MIDI values.