jdxi_editor.midi.io.synth_state

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

PARTS

PART_NAMES

Classes

SynthState

Confirmed, pending and different bytes of one JD-Xi.

Functions

part_of_address(address_hex) → Optional[str]

_dt1_payload(message)

(linear start, values) of a DT1, or None.

parts_that_differ(before, after[, addresses]) → list[str]

The parts (PARTS order) whose sections differ between two snapshots.

state_of(helper) → Optional[SynthState]

The SynthState of helper's JD-Xi (None without a device).

Module Contents

jdxi_editor.midi.io.synth_state.PARTS = (('program', ('1800',)), ('digital_1', ('1901',)), ('digital_2', ('1921',)), ('analog',...[source]
jdxi_editor.midi.io.synth_state.PART_NAMES[source]
jdxi_editor.midi.io.synth_state.part_of_address(address_hex: str) → str | None[source]
jdxi_editor.midi.io.synth_state._dt1_payload(message: Sequence[int])[source]

(linear start, values) of a DT1, or None.

class jdxi_editor.midi.io.synth_state.SynthState[source]

Confirmed, pending and different bytes of one JD-Xi.

confirmed[source]
_pending: dict[int, int][source]
_different: dict[int, tuple[int, int]][source]
_lock[source]
sent(message: Sequence[int]) → None[source]

A DT1 that went out: pending until read back.

received(message: Sequence[int]) → None[source]

A DT1 from the JD-Xi: confirmed; it settles what was pending there.

program_changed(ranges: Sequence[tuple[int, int]] | None = None) → None[source]

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.

pending_count() → int[source]
is_confirmed(address: Sequence[int], size: int = 1) → bool[source]

Every byte read back and nothing sent since.

different() → dict[source]

address (hex) -> (sent, read) where the JD-Xi holds another value.

snapshot() → dict[source]

The confirmed sections: address (hex) -> bytes (a copy).

jdxi_editor.midi.io.synth_state.parts_that_differ(before: dict, after: dict, addresses: Iterable[str] | None = None) → list[str][source]

The parts (PARTS order) whose sections differ between two snapshots. Only sections known in both count (a section never read says nothing).

jdxi_editor.midi.io.synth_state.state_of(helper) → SynthState | None[source]

The SynthState of helper’s JD-Xi (None without a device).