jdxi_editor.midi.io.synth_state =============================== .. py:module:: jdxi_editor.midi.io.synth_state .. autoapi-nested-parse:: What the JD-Xi holds, kept apart from what the editor shows. confirmed (LCS) bytes read back from the JD-Xi (its replies): the only thing ever shown as verified pending bytes the editor sent and has not read back yet different bytes read back with another value than the one sent (the JD-Xi did not take it, or it changed on the JD-Xi) The working state (WS) is the editors' values; SynthMemory (device.memory) stays what the editors show and send, including writes. Also: per-part comparison of two readings, to tell what changed on the JD-Xi while it was away. Attributes ---------- .. autoapisummary:: jdxi_editor.midi.io.synth_state.PARTS jdxi_editor.midi.io.synth_state.PART_NAMES Classes ------- .. autoapisummary:: jdxi_editor.midi.io.synth_state.SynthState Functions --------- .. autoapisummary:: jdxi_editor.midi.io.synth_state.part_of_address jdxi_editor.midi.io.synth_state._dt1_payload jdxi_editor.midi.io.synth_state.parts_that_differ jdxi_editor.midi.io.synth_state.state_of Module Contents --------------- .. py:data:: PARTS :value: (('program', ('1800',)), ('digital_1', ('1901',)), ('digital_2', ('1921',)), ('analog',... .. py:data:: PART_NAMES .. py:function:: part_of_address(address_hex: str) -> Optional[str] .. py:function:: _dt1_payload(message: Sequence[int]) (linear start, values) of a DT1, or None. .. py:class:: SynthState Confirmed, pending and different bytes of one JD-Xi. .. py:attribute:: confirmed .. py:attribute:: _pending :type: dict[int, int] .. py:attribute:: _different :type: dict[int, tuple[int, int]] .. py:attribute:: _lock .. py:method:: sent(message: Sequence[int]) -> None A DT1 that went out: pending until read back. .. py:method:: received(message: Sequence[int]) -> None A DT1 from the JD-Xi: confirmed; it settles what was pending there. .. py:method:: program_changed(ranges: Optional[Sequence[tuple[int, int]]] = None) -> None A new program on the JD-Xi: nothing of the old one holds. With *ranges* (linear [start, end)), only a part changed: only those bytes. .. py:method:: pending_count() -> int .. py:method:: is_confirmed(address: Sequence[int], size: int = 1) -> bool Every byte read back and nothing sent since. .. py:method:: different() -> dict address (hex) -> (sent, read) where the JD-Xi holds another value. .. py:method:: snapshot() -> dict The confirmed sections: address (hex) -> bytes (a copy). .. py:function:: parts_that_differ(before: dict, after: dict, addresses: Optional[Iterable[str]] = None) -> list[str] The parts (PARTS order) whose sections differ between two snapshots. Only sections known in both count (a section never read says nothing). .. py:function:: state_of(helper) -> Optional[SynthState] The SynthState of *helper*'s JD-Xi (None without a device).