jdxi_editor.midi.io.device
jdxi_editor.midi.io.device The connected JD-Xi as the editor sees it.
One JDXiDevice holds the state that belongs to the synth rather than to any editor:
requests: the SysExRequestQueue that paces RQ1 requests, one reply at a timememory: the SynthMemory mirror of the synth’s parameter bytes, which patches are saved fromecho_guard: the EchoGuard that stops data received from the synth being written straight back to it
The MIDI helper owns one (helper.device) and reports every message to it:
received() for incoming messages, before_send() and sent() for
outgoing ones.
Example
>>> sent = []
>>> device = JDXiDevice(sent.append)
>>> reply = bytes.fromhex("F0 41 10 00 00 00 0E 12 19 42 00 00 01 02 22 F7")
>>> device.received(reply)
>>> device.memory.read(bytes.fromhex("19 42 00 00"), 2)
b'\x01\x02'
>>> with device.applying_device_data():
... device.before_send(reply) # an editor echoing the reply
False
>>> device.received([0xC0, 0x05]) # program change: the program is replaced
>>> device.memory.sections()
[]
Attributes
Classes
Request queue, memory mirror and echo guard of one JD-Xi. |
Functions
|
|
|
The Roland message without F0/F7: 41, device, model×4, command, address×4, data…, checksum. |
|
|
|
The JDXiDevice of a MIDI helper ( |
Module Contents
- jdxi_editor.midi.io.device._roland_body(message: Sequence[int]) list | None[source]
The Roland message without F0/F7: 41, device, model×4, command, address×4, data…, checksum.
- class jdxi_editor.midi.io.device.JDXiDevice(send: Callable[[Sequence[int]], Any], requests: jdxi_editor.midi.io.request_queue.SysExRequestQueue | None = None, memory: jdxi_editor.midi.io.synth_memory.SynthMemory | None = None, echo_guard: jdxi_editor.midi.io.echo_guard.EchoGuard | None = None)[source]
Request queue, memory mirror and echo guard of one JD-Xi.
- request(messages: Iterable[str | bytes | Sequence[int]]) int[source]
Queue RQ1 (and other) messages; returns how many were queued.
- applying_device_data() contextlib.AbstractContextManager[None][source]
Scope in which this thread applies data received from the JD-Xi.
- received(message: Sequence[int]) None[source]
A message from the JD-Xi (SysEx with or without F0/F7, or channel data).
A DT1 reply lets the queue send its next request and is recorded in memory; a program change forgets what it replaced.
- before_send(message: Sequence[int]) bool[source]
False if message must not be sent (a DT1 echoing received data).
- fresh(message: Sequence[int]) list | None[source]
A reply (DT1) with the bytes the editor wrote after asking for it put back.
- Returns:
the reply without F0/F7 and with its checksum made again, or None when nothing is to change
- jdxi_editor.midi.io.device.device_for(owner: Any) JDXiDevice[source]
The JDXiDevice of a MIDI helper (
owner.device).For objects that are not MidiIOControllers (tests, tools), a device is created on first use and kept on the object.