From fe06824b6b22e30791420ab85bfdda73fb6e26f4 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Mon, 16 Nov 2026 00:39:48 -0500 Subject: [PATCH] tools/lc6000-display: allow the jog marker (ch1 pitch bend) and play state (ch1 note 1) on WD; correct the WD rule (#165) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VCgWWsoPKWUFiYf5pcC5B5 --- tools/lc6000-display/README.md | 12 +++++++++--- tools/lc6000-display/jogseq.swift | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/lc6000-display/README.md b/tools/lc6000-display/README.md index 59efb96..06b4a87 100644 --- a/tools/lc6000-display/README.md +++ b/tools/lc6000-display/README.md @@ -21,6 +21,11 @@ In short: The display shows uploads **rotated 180°**, so images are sent pre-rotated. Uploads move about 3.1 KB/s, so they're for what changes rarely, not real-time readouts. +For real-time readouts, djay also sends two channel messages to WD on ch1 (#165): +- **Pitch bend:** the platter marker. It's the virtual record's angle at 33⅓ rpm, wrapping once per turn, sent at + about 50 Hz. +- **Note 1** at velocity 127 or 0: the play/cue state. + ## Files | File | What it does | @@ -47,15 +52,16 @@ A plan is one message per line: ` WD|CTL `, or ` waits for that many accepted acks and stops the run on a refusal. Lines starting with `#` are comments. `jogseq` sends only what the protocol needs: -- **WD:** the `00 02 0B 7F 10` messages, the identity request, and `90 01 00`. +- **WD:** the `00 02 0B 7F 10` messages, the identity request, pitch bend on ch1, and note 1 on ch1. - **Controller:** Serato SysEx, the `cmd 60` host message, LED note-ons, and the identity request. It also refuses to send if the port names are ambiguous. ## Rules -- **Get an OK before sending to the hardware.** A stray note on WD resets the display (#143), and the host hello - changes the unit's mode. +- **Get an OK before sending to the hardware.** The host hello changes the unit's mode, and WD should only ever get + the messages above. In #143, the app's LED traffic leaked onto WD and left the display blank. Which message + blanked it isn't known: note 1 alone is djay's play/cue state. - **No third-party data in this folder:** no other app's images, and no capture files. Test images are our own. - **What was verified, and what's still a guess:** - Verified: these exact images were uploaded and shown on hardware. Uploads were accepted (acks `00`), with the diff --git a/tools/lc6000-display/jogseq.swift b/tools/lc6000-display/jogseq.swift index e116ef6..aa5da67 100644 --- a/tools/lc6000-display/jogseq.swift +++ b/tools/lc6000-display/jogseq.swift @@ -2,7 +2,7 @@ import CoreMIDI import Foundation // Sends a jog-display plan to the LC6000 (#121, #165), listening on both of its ports. Plan lines: -// WD send to "Denon DJ LC6000 PRIME WD" +// WD send to "Denon DJ LC6000 PRIME WD" (jog SysEx, ch1 pitch bend, ch1 note 1) // CTL send to the Controller (Serato SysEx 00 20 7F only) // ACKS wait until n `01 10 0F` acks have arrived on WD since the last ACKS // # comment @@ -50,7 +50,13 @@ for (n, raw) in try String(contentsOfFile: args[2], encoding: .utf8).split(separ } else { let denon = sysexOK && Array(b[1...5]) == [0x00, 0x02, 0x0B, 0x7F, 0x10] let identity = b == [0xF0, 0x7E, 0x00, 0x06, 0x01, 0xF7] - guard denon || identity || b == [0x90, 0x01, 0x00] else { fail("WD takes 00 02 0B 7F 10 SysEx, identity request, or 90 01 00") } + // What a host sends the jog display besides SysEx (#165): the platter marker as pitch bend on ch1, and the + // play/cue state as note 1 on ch1. + let marker = b.count == 3 && b[0] == 0xE0 && b[1] < 0x80 && b[2] < 0x80 + let playState = b.count == 3 && b[0] == 0x90 && b[1] == 0x01 && b[2] < 0x80 + guard denon || identity || marker || playState else { + fail("WD takes 00 02 0B 7F 10 SysEx, an identity request, pitch bend on ch1, or note 1 on ch1") + } } plan.append((delay, .send(port: p[1], bytes: b))) default: fail("port must be WD, CTL or ACKS")