Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tools/lc6000-display/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -47,15 +52,16 @@ A plan is one message per line: `<delay ms> WD|CTL <hex bytes>`, or `<delay ms>
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
Expand Down
10 changes: 8 additions & 2 deletions tools/lc6000-display/jogseq.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
// <delay ms> WD <hex…> send to "Denon DJ LC6000 PRIME WD"
// <delay ms> WD <hex…> send to "Denon DJ LC6000 PRIME WD" (jog SysEx, ch1 pitch bend, ch1 note 1)
// <delay ms> CTL <hex…> send to the Controller (Serato SysEx 00 20 7F only)
// <delay ms> ACKS <n> <timeout ms> wait until n `01 10 0F` acks have arrived on WD since the last ACKS
// # comment
Expand Down Expand Up @@ -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")
Expand Down
Loading