jdxi_editor.ui.windows.jdxi.follow ================================== .. py:module:: jdxi_editor.ui.windows.jdxi.follow .. autoapi-nested-parse:: jdxi_editor.ui.windows.jdxi.follow The instrument window follows the JD-Xi. What is changed on the instrument itself reaches the window: - at start (once the MIDI ports are open) the window reads the program, the four tones and the Digital partials, so it does not start on "Init Tone" - the part shown (Digital 1, Digital 2, Analog, Drums) is read again every couple of seconds: a tone chosen with the JD-Xi's own buttons appears on the display, the OCTAVE buttons light as on the instrument and the panel sliders move to the tone's values. Nothing is read while a MIDI file or pattern plays, while the app is minimised, or for a few seconds after a click, a key or a value sent from the app (a reply on its way must not undo what was just set) - a program change from the JD-Xi on a part's channel reads that part at once - the notes played on the JD-Xi light the window's keys, and their channel tells the part selected on the JD-Xi: the window selects it too The replies go through the usual path (tone names, editors), so an editor that is open follows too. Attributes ---------- .. autoapisummary:: jdxi_editor.ui.windows.jdxi.follow.STARTUP_DELAY_MS jdxi_editor.ui.windows.jdxi.follow.POLL_INTERVAL_MS jdxi_editor.ui.windows.jdxi.follow.QUIET_AFTER_INPUT_S jdxi_editor.ui.windows.jdxi.follow.SYSTEM_COMMON jdxi_editor.ui.windows.jdxi.follow.ROLAND_DT1 jdxi_editor.ui.windows.jdxi.follow.TEMPORARY_TONE jdxi_editor.ui.windows.jdxi.follow.TEMPORARY_PROGRAM jdxi_editor.ui.windows.jdxi.follow.PARTIAL_1 jdxi_editor.ui.windows.jdxi.follow.PARTS jdxi_editor.ui.windows.jdxi.follow.DIGITAL_COMMON_OCTAVE jdxi_editor.ui.windows.jdxi.follow.ANALOG_OCTAVE jdxi_editor.ui.windows.jdxi.follow.ZONE_OCTAVE jdxi_editor.ui.windows.jdxi.follow.OCTAVE_CENTRE jdxi_editor.ui.windows.jdxi.follow.FOLLOW_NOTES jdxi_editor.ui.windows.jdxi.follow.FOLLOW_PAUSE_S jdxi_editor.ui.windows.jdxi.follow.DIGITAL_SLIDERS jdxi_editor.ui.windows.jdxi.follow.ANALOG_SLIDERS jdxi_editor.ui.windows.jdxi.follow.KNOB_CC jdxi_editor.ui.windows.jdxi.follow.KNOB_CC_EFFECTS jdxi_editor.ui.windows.jdxi.follow.KNOB_NRPN jdxi_editor.ui.windows.jdxi.follow.NRPN_NULL jdxi_editor.ui.windows.jdxi.follow.PART_REQUESTS Classes ------- .. autoapisummary:: jdxi_editor.ui.windows.jdxi.follow.InstrumentFollower Functions --------- .. autoapisummary:: jdxi_editor.ui.windows.jdxi.follow._zone_request jdxi_editor.ui.windows.jdxi.follow.parse_dt1 jdxi_editor.ui.windows.jdxi.follow._value_at Module Contents --------------- .. py:data:: STARTUP_DELAY_MS :value: 1200 .. py:data:: POLL_INTERVAL_MS :value: 2000 .. py:data:: QUIET_AFTER_INPUT_S :value: 3.0 .. py:data:: SYSTEM_COMMON :value: (2, 0, 0) .. py:data:: ROLAND_DT1 :value: (65, 16, 0, 0, 0, 14, 18) .. py:data:: TEMPORARY_TONE :value: 25 .. py:data:: TEMPORARY_PROGRAM :value: 24 .. py:data:: PARTIAL_1 :value: 32 .. py:data:: PARTS .. py:data:: DIGITAL_COMMON_OCTAVE :value: 21 .. py:data:: ANALOG_OCTAVE :value: 52 .. py:data:: ZONE_OCTAVE :value: 25 .. py:data:: OCTAVE_CENTRE :value: 64 .. py:data:: FOLLOW_NOTES :value: 3 .. py:data:: FOLLOW_PAUSE_S :value: 2.0 .. py:data:: DIGITAL_SLIDERS .. py:data:: ANALOG_SLIDERS .. py:data:: KNOB_CC .. py:data:: KNOB_CC_EFFECTS .. py:data:: KNOB_NRPN .. py:data:: NRPN_NULL :value: 127 .. py:function:: _zone_request(area: str) -> str .. py:data:: PART_REQUESTS .. py:function:: parse_dt1(data) -> Optional[tuple] (address, values) of a Roland DT1 from the JD-Xi (SysEx data without F0/F7). .. py:function:: _value_at(address: tuple, values: list, block: tuple, offset: int) -> Optional[int] The byte at *block* + *offset* if this DT1 (at *address*) holds it. .. py:class:: InstrumentFollower(window, parent: Optional[PySide6.QtCore.QObject] = None) Bases: :py:obj:`PySide6.QtCore.QObject` Keeps the instrument window in step with the JD-Xi (see the module doc). .. py:attribute:: window .. py:attribute:: midi_helper .. py:attribute:: _last_input :value: 0.0 .. py:attribute:: _lit :type: Dict[tuple, object] .. py:attribute:: _tone_octave :type: Dict[str, int] .. py:attribute:: _zone_octave :type: Dict[str, int] .. py:attribute:: _part :value: None .. py:attribute:: _recent_channels :type: list :value: [] .. py:attribute:: _part_followed_at :value: -2.0 .. py:attribute:: _nrpn :type: Dict[int, list] .. py:attribute:: timer .. py:method:: start() -> None .. py:method:: stop() -> None The program is closing: no more readings. .. py:method:: read_all() -> None Program, tones and partials: what the window shows at start. .. py:method:: _connected() -> bool .. py:method:: _quiet() -> bool Nothing in the way of a reading: no playback, no recent input, app shown. .. py:method:: current_part() .. py:method:: poll() -> None Read the part shown again (its tone name, octave and the sliders' values). .. py:method:: poll_now() -> None The part shown changed: read it straight away. .. py:method:: request_part(part) -> None .. py:method:: on_outgoing(message) -> None A value, note or program sent from the app: wait before reading. .. py:method:: on_incoming(message) -> None .. py:method:: on_dt1(address: tuple, values: list) -> None .. py:method:: _system_read(address, values) -> None .. py:method:: follow_part(channel) -> None The JD-Xi plays its keyboard on the channel of the part selected on it: the window selects that part too, so its tone buttons, octave and sliders act on the part being played (they acted on the part selected in the app, and a tone chosen there was not heard until the two were aligned). Only after a few notes in a row on that channel, and not more than once in a while: a pattern playing several parts does not make it jump. .. py:method:: _octave_read(part, store: Dict, octave: int) -> None .. py:method:: _show_part_octave() -> None .. py:method:: _show_octave(octave: int) -> None .. py:method:: _show_sliders(part, address, values, block, offsets) -> None .. py:method:: _new_program() -> None A program loads as saved: the ENV slider (relative to it) back to the middle. .. py:method:: knob_moved(channel: int, control: int, value: int) -> None A knob turned on the JD-Xi (CC or NRPN): the window's slider follows it at once; the editors get the value with the next reading. .. py:method:: _show_knob(name: str, value: int) -> None .. py:method:: light_key(note: int, on: bool, channel: Optional[int] = None) -> None Light the window's key under the finger: with an octave shift the JD-Xi sends its keys an octave or more away, and the window's keyboard (always the 37 keys of the JD-Xi) shows the key that was pressed. A key lit stays the one turned off, also if the octave changes while it is held. .. py:method:: show_wheel(name: str, value: float) -> None The window's pitch or mod wheel shows where the JD-Xi's is. .. py:method:: part_octave(channel: Optional[int]) -> int Octave shift of the part playing on *channel* (that of the part shown when the channel is not a part's). .. py:method:: eventFilter(watched, event) -> bool .. py:method:: _bytes(message) :staticmethod: