Skip to content

Spike: drive the LC6000 jog wheel display (WD port) with Syndicate info #121

Open

Description

@Skeyelab

Parent

#12

Why

When djay Pro starts, the LC6000's jog wheel display shows the djay logo, so djay knows how to draw on it. The user wants the display to show Syndicate info: deck number, track title or artwork, BPM, and position.

What we know

  • The LC6000 shows up as two USB MIDI devices: "…LC6000 PRIME Controller" (the controls) and "…LC6000 PRIME WD", which sends no input and is almost certainly the Wheel Display.
  • Denon's MIDI spec says the display needs SysEx and doesn't document it. Forum threads say Denon doesn't share it; djay Pro (Algoriddim) is a Denon partner and evidently has it.
  • No public LC6000 display protocol was found. Prime 4 jog-display SysEx findings exist, but that's a different device.

Spike plan (research only, no app code)

  1. The user installs a MIDI spy, such as MIDI Monitor (snoize) with its spy driver, and records everything djay Pro sends to the WD destination at launch, on track load and during play.
  2. Decode the format: SysEx framing, image encoding (size, pixel format, compression), and any text or BPM messages.
  3. Prototype in a scratch tool: send one captured message back to the WD port and confirm the display reacts. Then try a generated image, such as our app icon.
  4. Write up the findings, with a go or no-go for a v1.1 feature.

Risks

  • The data might not be MIDI at all (it could be USB bulk), which would need different tooling.
  • The format might be encrypted or proprietary. This is interoperability research, but check Denon's terms before shipping anything.
  • Image transfer over MIDI may be slow.

Done when

  • The captures are saved (not in the repo if they contain djay assets).
  • The format is documented, or the reason it can't be decoded is.
  • Go or no-go, with an estimate.

Activity

  1. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Research prep: jog display SysEx (no device I/O)

    What's public

    • The best source is whanake-music/denon-prime-4-analysis. It is the only byte-level write-up I found: USB captures of VirtualDJ and Serato driving a Prime 4. Its SysEx layout is:
      F0 00 02 0B <target> 08 <cmd> <lenHi> <lenLo> <payload…> F7     len = 14-bit payload byte count
      
      • 00 02 0B is the manufacturer ID for Denon/inMusic. A VirtualDJ definition for the DN-500BD uses the same ID in its identity reply, so it is consistent across inMusic. I haven't checked it against the MMA table yet.
      • Targets: 10 is the left jog display, 30 the right, 7F the control surface, and 00 the FX OLEDs.
      • Jog commands, all on the Prime 4:
        • Unlock for SysEx control: F0 00 02 0B 10 08 10 00 00 F7. This is a likely first thing djay sends.
        • Backlight brightness: cmd 7C, 1 byte.
        • Element color: cmd 0B, 9 bytes. It takes an element followed by A, R, G and B, each as two nibbles (0* 0*). The elements are album art, logo, platter ring/indicator, slip ring/indicator, progress ring/indicator, and text.
        • Visible elements and preset text: cmd 0A, 4 bytes. It takes two bit masks, an album-art index and a text code from a fixed list (1/64…64, A–D, 3/6/12). The display shows only these presets; there is no free text.
        • Platter and slip position: pitch bend E0 and E1, 14-bit.
      • Album-art upload is not figured out. The author writes "requires images to be loaded onto jog wheels, which hasn't been figured out yet". That is the piece djay's logo should show us.
      • The same repo has RGB LEDs on the surface: 7F 08 03 00 05 <ch> <idx> R G B, 7-bit each.
      • Also from the repo: F0 00 02 0B 7F 08 60 00 04 04 01 02 00 F7 asks the unit to send back all knob and fader positions. That could help us sync pickup at connect.
    • Denon hasn't published the LC6000 screen protocol. Community threads say the LC6000 MIDI spec PDF covers controls but not the screen (NI forum, Engine DJ forum). Serato draws track art and its logo. A custom logo only works when the LC6000 is linked to Prime players.
    • Unverified VirtualDJ posts. Some VirtualDJ forum jog SysEx was generated by ChatGPT. I'm ignoring it.
    • SC6000 and Prime Go don't apply here. On those, the jog display is a separate USB device driven by Linux (meta-az0x, DeathCamel58). We see plain USB-MIDI, so the Prime 4 SysEx model is the closer match.

    What to look for in djay's capture

    1. An unlock. I expect one per deck, of the form F0 00 02 0B <t> 08 10 00 00 F7. The LC6000 has one jog per unit, so <t> is probably 10, but that needs checking.
    2. A burst of large messages with the same command. That would be the logo bitmap. The total payload size tells us the resolution and packing; the decoder's "image?" lines check this.
    3. Short messages with cmd 0A, 0B or 7C. These would be visibility, color and brightness.

    Decoder

    The script is sysex-decode.py; its full text is at the end of this comment.

    It reads two kinds of input. One is MIDI Monitor's text export, with SysEx shown as hex; it rejoins SysEx that wraps across lines. The other is a raw .syx file.

    For each capture it does three things:

    • Groups the messages by manufacturer and by target, class and command, flagging any length mismatch.
    • Finds bursts: runs of the same command back to back.
    • Guesses image formats. For each burst over 1 kB, it compares the payload size with these:
      • sizes: 320², 240², 480², 360², 128² and 320×240;
      • formats: RGB565, RGB888, ARGB, gray8, gray4 and mono;
      • packings: nibbles, 7-in-8 and raw 7-bit.

    With --dump DIR it also writes each burst three ways: as sent (.raw), nibble-joined (.nib) and 7-in-8 unpacked (.78), ready for ffmpeg -f rawvideo.

    I tested it on a synthetic capture: the Prime 4 unlock and text messages, plus a 240×240 RGB565 image as nibbles, wrapped at 40 bytes per line the way MIDI Monitor does. It split 59 messages and put the 240×240 RGB565 nibble match first, with +0 bytes. The .nib dump matched the source image byte for byte. A size alone is ambiguous (240² RGB565 nibbles = 480² gray4 nibbles = 320×240 RGB888 raw), so we'll need to view the dump to decide.

    No messages were sent to the hardware. Nothing gets sent without the CoS's OK.

    sysex-decode.py
    #!/usr/bin/env python3
    """Scratch decoder for #121: what does djay Pro send the LC6000's jog display?
    
    Input: a MIDI Monitor text export (File > Export, or copy-paste of the event list with
    "Show SysEx data as hex"), or a raw .syx dump (MIDI Monitor > Save SysEx). Any text whose
    lines carry hex byte pairs works: SysEx spanning several lines is joined until F7.
    
      python3 -I sysex-decode.py capture.txt            # summary
      python3 -I sysex-decode.py capture.syx --dump out # also write payload bursts, decoded
    
    What it prints:
      1. Each SysEx split out, grouped by header. Denon/inMusic (00 02 0B) is parsed as the Prime 4
         layout (github.com/whanake-music/denon-prime-4-analysis):
           F0 00 02 0B <target> <class> <cmd> <lenHi> <lenLo> <payload…> F7
         with len a 14-bit count of payload bytes; a mismatch is flagged.
      2. Bursts: runs of the same (target, class, cmd) back to back, with their total payload.
      3. Image guesses: each burst's payload size against WxH x bytes-per-pixel under the
         packings a 7-bit SysEx stream can use (nibbles, 7-in-8, raw 7-bit).
    No device I/O: this only reads a file.
    """
    import re
    import sys
    from collections import OrderedDict, defaultdict
    from pathlib import Path
    
    DENON = (0x00, 0x02, 0x0B)
    SIZES = [(320, 320), (240, 240), (480, 480), (360, 360), (128, 128), (320, 240), (240, 320)]
    FORMATS = [("RGB565", 2), ("RGB888", 3), ("ARGB8888", 4), ("gray8", 1), ("gray4", 0.5), ("mono1", 0.125)]
    # Bytes on the wire per byte of image data, for each 7-bit packing.
    PACKINGS = [("nibbles (2 wire B per B)", 2.0), ("7-in-8 (8 per 7)", 8 / 7), ("raw 7-bit", 1.0)]
    
    HEX = re.compile(r"\b[0-9A-Fa-f]{2}\b")
    
    
    def read_bytes(path):
        """Returns [(direction, bytes)] chunks. Binary .syx is one chunk; text is one per line."""
        data = Path(path).read_bytes()
        if data[:1] == b"\xF0":
            return [("?", list(data))]
        chunks = []
        for line in data.decode("utf-8", "replace").splitlines():
            lower = line.lower()
            direction = "to" if re.search(r"\bto\b", lower) else "from" if re.search(r"\bfrom\b", lower) else "?"
            # Only the hex run that holds SysEx bytes: drop timestamps like 12:34:56.789.
            tokens = [int(t, 16) for t in HEX.findall(re.sub(r"\d+:\d+:\d+(\.\d+)?", " ", line))]
            if tokens:
                chunks.append((direction, tokens))
        return chunks
    
    
    def split_sysex(chunks):
        """Yields (direction, message) for each F0…F7, joining messages that span chunks."""
        current, direction = None, "?"
        for d, data in chunks:
            for b in data:
                if b == 0xF0:
                    current, direction = [b], d
                elif current is not None:
                    current.append(b)
                    if b == 0xF7:
                        yield direction, current
                        current = None
        if current:
            yield direction, current + ["(unterminated)"]
    
    
    def parse(msg):
        body = [b for b in msg[1:] if isinstance(b, int) and b != 0xF7]
        if not body:
            return {"maker": "empty"}
        if body[0] == 0x00 and len(body) >= 3:
            maker, rest = tuple(body[:3]), body[3:]
        else:
            maker, rest = (body[0],), body[1:]
        info = {"maker": " ".join(f"{b:02X}" for b in maker), "rest": rest}
        if maker == DENON and len(rest) >= 5:
            target, cls, cmd, hi, lo = rest[:5]
            payload = rest[5:]
            declared = (hi << 7) | lo
            info.update(key=(target, cls, cmd), payload=payload, declared=declared, ok=declared == len(payload))
        elif maker == (0x7E,) or maker == (0x7F,):
            info.update(key=("universal", *rest[:3]), payload=rest)
        else:
            info.update(key=tuple(rest[:3]), payload=rest)
        return info
    
    
    def hexs(bs, limit=24):
        s = " ".join(f"{b:02X}" for b in bs[:limit])
        return s + (f" … (+{len(bs) - limit})" if len(bs) > limit else "")
    
    
    def image_guesses(n):
        out = []
        for (w, h) in SIZES:
            for fmt, bpp in FORMATS:
                raw = w * h * bpp
                for pack, factor in PACKINGS:
                    wire = raw * factor
                    if wire and abs(n - wire) / wire < 0.02:
                        out.append((abs(n - int(wire)), f"{w}x{h} {fmt}, {pack}: expect {int(wire)} B ({n - int(wire):+d})"))
        return [text for _, text in sorted(out, key=lambda t: t[0])]
    
    
    def unnibble(p):
        return bytes(((p[i] & 0x0F) << 4) | (p[i + 1] & 0x0F) for i in range(0, len(p) - 1, 2))
    
    
    def unpack78(p):
        """MSB-first 7-in-8: a header byte holds bit 7 of the next seven bytes (Roland/Elektron style)."""
        out = bytearray()
        for i in range(0, len(p), 8):
            group = p[i:i + 8]
            if not group:
                break
            msbs = group[0]
            for j, b in enumerate(group[1:]):
                out.append(b | (((msbs >> (6 - j)) & 1) << 7))
        return bytes(out)
    
    
    def main(argv):
        if len(argv) < 2:
            print(__doc__)
            return 2
        dump = Path(argv[argv.index("--dump") + 1]) if "--dump" in argv else None
        messages = list(split_sysex(read_bytes(argv[1])))
        print(f"{len(messages)} SysEx messages\n")
    
        groups = OrderedDict()
        for d, m in messages:
            info = parse(m)
            k = (d, info["maker"], info.get("key"))
            g = groups.setdefault(k, {"n": 0, "sizes": defaultdict(int), "first": m, "bad": 0})
            g["n"] += 1
            g["sizes"][len(m)] += 1
            g["bad"] += 0 if info.get("ok", True) else 1
    
        print("== Groups (direction, maker, key = target/class/cmd for Denon) ==")
        for (d, maker, key), g in groups.items():
            k = " ".join(f"{x:02X}" if isinstance(x, int) else str(x) for x in (key or ()))
            sizes = ", ".join(f"{s} B x{c}" for s, c in sorted(g["sizes"].items())[:6])
            flag = f"  LEN MISMATCH x{g['bad']}" if g["bad"] else ""
            print(f"{d:>4} {maker:8} [{k}] x{g['n']}  sizes: {sizes}{flag}")
            print(f"       first: {hexs(g['first'])}")
    
        print("\n== Bursts (same key back to back) ==")
        bursts = []
        for d, m in messages:
            info = parse(m)
            k = (d, info["maker"], info.get("key"))
            if bursts and bursts[-1]["k"] == k:
                bursts[-1]["msgs"] += 1
                bursts[-1]["payload"] += info.get("payload", [])
            else:
                bursts.append({"k": k, "msgs": 1, "payload": list(info.get("payload", []))})
        for i, b in enumerate(bursts):
            d, maker, key = b["k"]
            k = " ".join(f"{x:02X}" if isinstance(x, int) else str(x) for x in (key or ()))
            n = len(b["payload"])
            line = f"#{i:<3} {d:>4} {maker} [{k}] {b['msgs']} msgs, {n} payload B"
            print(line)
            for guess in image_guesses(n) if n > 1000 else []:
                print(f"       image? {guess}")
            if dump and n > 1000:
                dump.mkdir(parents=True, exist_ok=True)
                base = dump / f"burst{i:03d}"
                Path(f"{base}.raw").write_bytes(bytes(b["payload"]))
                Path(f"{base}.nib").write_bytes(unnibble(b["payload"]))
                Path(f"{base}.78").write_bytes(unpack78(b["payload"]))
        if dump:
            print(f"\nPayloads in {dump}/: .raw as sent, .nib nibble-joined, .78 7-in-8 unpacked.")
            print("View one: ffmpeg -f rawvideo -pixel_format rgb565le -video_size 320x320 -i burst000.nib out.png")
        return 0
    
    
    if __name__ == "__main__":
        sys.exit(main(sys.argv))
  2. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Decoded: djay sends a plain PNG (198×198 RGBA) to the jog display

    Capture: djayspy.mmon, MIDI Monitor with the spy driver. It holds 31 SysEx messages, with two djay launches about 82 s apart.

    Frame

    F0 00 02 0B <target> 10 <cmd> <lenHi> <lenLo> <payload…> F7     len = 14-bit payload byte count
    
    • The Prime 4 layout has the same shape, with class 08. The LC6000 uses class 10.
    • Every length field matched its payload in this capture.

    Image upload, each step confirmed

    Step Message Payload
    1 7F 10 0C, len 3 01 68 27 is the 21-bit image byte count: 29735
    2 7F 10 0D, three chunks <21-bit offset into the image> + 7-bit data. The offsets are 0, 14332 and 28664.
    3 7F 10 0E, len 9 01 00 00 03 0A 0E 0E 07 00 (see the hypotheses below)
    4 7F 10 10, len 0 about 0.5 s later. Probably show or commit.
    • Packing: an MSB-first bitstream. The 7 low bits of each byte are joined end to end and read back as 8-bit bytes.
      • It is not grouped 8-to-7, and there is no header byte.
      • The 3-byte offset at the head of each chunk is why the earlier unpackings found no magic: those bytes were decoded as data.
      • 16380 data bytes give 14332 bytes. 14332 + 14332 + 1071 = 29735, exactly the size step 1 declares.
    • Result: a valid PNG.
      • 198×198, 8-bit RGBA (color type 6).
      • Chunks: IHDR, sRGB, eXIf (which also says 198×198), two IDATs, then IEND. All CRCs are OK, with 0 trailing bytes.
      • Both launches uploaded byte-identical files.
      • The picture is djay's app icon: a gold record on a gray rounded square. I'm not attaching it, since it's Algoriddim's artwork.
    • What this means for us: we can render our own 198×198 PNG and upload it the same way. No custom codec is needed.

    Other messages (hypotheses, not confirmed)

    From the unit:

    • Identity reply 7E 00 06 02 00 02 0B 10 00 19 00 00 05 00 01 00 00 00 00 with the ASCII text A12104251503774. That looks like a serial number. Family 10 00, member 19 00.
    • 01 10 0F 00 01 00, five times about 0.15–0.5 s after the upload. These look like acks from the unit; target 01 looks like the replying device. I can't tell direction from the archive, because the endpoint field is empty.
    • 01 10 10 at +14.9 s, also probably from the unit.

    From djay:

    • 7F 10 0A, len 4: this is likely the Prime 4 "visible elements / text" message (A mask, B mask, art index, text code).
      • Values seen: 01 00 06 0D, then on track load 0D 00 06 0D, 0D 00 06 00, 0D 00 06 08 and 01 00 01 0D.
      • On the Prime 4, A=01 shows the background image and A=0D adds the position ring. Text 0D is "--".
    • 7F 10 0E, len 9: this matches the Prime 4 element-color layout of an element plus four nibble pairs. As element 01 (the logo) with A=0x00, R=0x3A, G=0xEE, B=0x70 it doesn't look right, so treat it as unknown.
    • Universal identity request 7E 00 06 01, sent at each launch.

    Decoder updated

    sysex-decode.py now does two more things:

    • It reads the .mmon file directly.
    • It rebuilds each 0C/0D upload. With --dump DIR it writes image0.png and so on, and prints the size and dimensions.

    On this capture it finds image 0: 29735 B, PNG 198x198 and image 1 (the same), byte-identical to a separate hand decode.

    Next step: replay an upload with our own 198×198 PNG and see whether it shows on the display. That means sending to the hardware, so it waits for the CoS's OK.

    sysex-decode.py (updated)
    #!/usr/bin/env python3
    """Scratch decoder for #121: what does djay Pro send the LC6000's jog display?
    
    Input: a MIDI Monitor text export (File > Export, or copy-paste of the event list with
    "Show SysEx data as hex"), or a raw .syx dump (MIDI Monitor > Save SysEx). Any text whose
    lines carry hex byte pairs works: SysEx spanning several lines is joined until F7.
    
      python3 -I sysex-decode.py capture.txt            # summary
      python3 -I sysex-decode.py capture.syx --dump out # also write payload bursts, decoded
    
    What it prints:
      1. Each SysEx split out, grouped by header. Denon/inMusic (00 02 0B) is parsed as the Prime 4
         layout (github.com/whanake-music/denon-prime-4-analysis):
           F0 00 02 0B <target> <class> <cmd> <lenHi> <lenLo> <payload…> F7
         with len a 14-bit count of payload bytes; a mismatch is flagged.
      2. Bursts: runs of the same (target, class, cmd) back to back, with their total payload.
      3. Image guesses: each burst's payload size against WxH x bytes-per-pixel under the
         packings a 7-bit SysEx stream can use (nibbles, 7-in-8, raw 7-bit).
    No device I/O: this only reads a file.
    """
    import re
    import sys
    from collections import OrderedDict, defaultdict
    from pathlib import Path
    
    DENON = (0x00, 0x02, 0x0B)
    SIZES = [(320, 320), (240, 240), (480, 480), (360, 360), (128, 128), (320, 240), (240, 320)]
    FORMATS = [("RGB565", 2), ("RGB888", 3), ("ARGB8888", 4), ("gray8", 1), ("gray4", 0.5), ("mono1", 0.125)]
    # Bytes on the wire per byte of image data, for each 7-bit packing.
    PACKINGS = [("nibbles (2 wire B per B)", 2.0), ("7-in-8 (8 per 7)", 8 / 7), ("raw 7-bit", 1.0)]
    
    HEX = re.compile(r"\b[0-9A-Fa-f]{2}\b")
    
    
    def read_mmon(data):
        """A MIDI Monitor document: a plist whose messageData is a keyed archive of SMMessages."""
        import plistlib
        archive = plistlib.loads(plistlib.loads(data)["messageData"])
        objects = archive["$objects"]
        deref = lambda u: objects[u.data] if isinstance(u, plistlib.UID) else u
        chunks = []
        for u in deref(archive["$top"]["root"])["NS.objects"]:
            m = deref(u)
            if deref(m["$class"])["$classname"] == "SMSystemExclusiveMessage":
                chunks.append(("?", [0xF0, *deref(m.get("data", b"")), 0xF7]))
        return chunks
    
    
    def read_bytes(path):
        """Returns [(direction, bytes)] chunks. Binary .syx is one chunk; text is one per line."""
        data = Path(path).read_bytes()
        if data.startswith(b"bplist00"):
            return read_mmon(data)
        if data[:1] == b"\xF0":
            return [("?", list(data))]
        chunks = []
        for line in data.decode("utf-8", "replace").splitlines():
            lower = line.lower()
            direction = "to" if re.search(r"\bto\b", lower) else "from" if re.search(r"\bfrom\b", lower) else "?"
            # Only the hex run that holds SysEx bytes: drop timestamps like 12:34:56.789.
            tokens = [int(t, 16) for t in HEX.findall(re.sub(r"\d+:\d+:\d+(\.\d+)?", " ", line))]
            if tokens:
                chunks.append((direction, tokens))
        return chunks
    
    
    def split_sysex(chunks):
        """Yields (direction, message) for each F0…F7, joining messages that span chunks."""
        current, direction = None, "?"
        for d, data in chunks:
            for b in data:
                if b == 0xF0:
                    current, direction = [b], d
                elif current is not None:
                    current.append(b)
                    if b == 0xF7:
                        yield direction, current
                        current = None
        if current:
            yield direction, current + ["(unterminated)"]
    
    
    def parse(msg):
        body = [b for b in msg[1:] if isinstance(b, int) and b != 0xF7]
        if not body:
            return {"maker": "empty"}
        if body[0] == 0x00 and len(body) >= 3:
            maker, rest = tuple(body[:3]), body[3:]
        else:
            maker, rest = (body[0],), body[1:]
        info = {"maker": " ".join(f"{b:02X}" for b in maker), "rest": rest}
        if maker == DENON and len(rest) >= 5:
            target, cls, cmd, hi, lo = rest[:5]
            payload = rest[5:]
            declared = (hi << 7) | lo
            info.update(key=(target, cls, cmd), payload=payload, declared=declared, ok=declared == len(payload))
        elif maker == (0x7E,) or maker == (0x7F,):
            info.update(key=("universal", *rest[:3]), payload=rest)
        else:
            info.update(key=tuple(rest[:3]), payload=rest)
        return info
    
    
    def hexs(bs, limit=24):
        s = " ".join(f"{b:02X}" for b in bs[:limit])
        return s + (f" … (+{len(bs) - limit})" if len(bs) > limit else "")
    
    
    def image_guesses(n):
        out = []
        for (w, h) in SIZES:
            for fmt, bpp in FORMATS:
                raw = w * h * bpp
                for pack, factor in PACKINGS:
                    wire = raw * factor
                    if wire and abs(n - wire) / wire < 0.02:
                        out.append((abs(n - int(wire)), f"{w}x{h} {fmt}, {pack}: expect {int(wire)} B ({n - int(wire):+d})"))
        return [text for _, text in sorted(out, key=lambda t: t[0])]
    
    
    def unnibble(p):
        return bytes(((p[i] & 0x0F) << 4) | (p[i + 1] & 0x0F) for i in range(0, len(p) - 1, 2))
    
    
    def unpack78(p):
        """MSB-first 7-in-8: a header byte holds bit 7 of the next seven bytes (Roland/Elektron style)."""
        out = bytearray()
        for i in range(0, len(p), 8):
            group = p[i:i + 8]
            if not group:
                break
            msbs = group[0]
            for j, b in enumerate(group[1:]):
                out.append(b | (((msbs >> (6 - j)) & 1) << 7))
        return bytes(out)
    
    
    def unbits(seven):
        """MSB-first bitstream: 7 bits from each byte, back to back, read as 8-bit bytes (#121)."""
        acc = nbits = 0
        out = bytearray()
        for b in seven:
            acc, nbits = (acc << 7) | (b & 0x7F), nbits + 7
            if nbits >= 8:
                nbits -= 8
                out.append((acc >> nbits) & 0xFF)
        return bytes(out)
    
    
    def lc6000_images(messages):
        """The LC6000 jog image upload, as djay sends it (#121): 0C <21-bit size>, then 0D chunks of
        <21-bit offset into the image> + MSB-first 7-bit bitstream. The image is a PNG."""
        images, size, image = [], None, bytearray()
        for _, m in messages:
            info = parse(m)
            key, p = info.get("key"), info.get("payload", [])
            if info["maker"] != "00 02 0B" or not key or len(p) < 3:
                continue
            value = (p[0] << 14) | (p[1] << 7) | p[2]
            if key[2] == 0x0C:
                size, image = value, bytearray()
            elif key[2] == 0x0D and size is not None:
                if value != len(image):
                    print(f"  chunk offset {value} != {len(image)} so far: gap or reorder")
                image += unbits(p[3:])
                if len(image) >= size:
                    images.append(bytes(image[:size]))
                    size = None
        return images
    
    
    def main(argv):
        if len(argv) < 2:
            print(__doc__)
            return 2
        dump = Path(argv[argv.index("--dump") + 1]) if "--dump" in argv else None
        messages = list(split_sysex(read_bytes(argv[1])))
        print(f"{len(messages)} SysEx messages\n")
    
        groups = OrderedDict()
        for d, m in messages:
            info = parse(m)
            k = (d, info["maker"], info.get("key"))
            g = groups.setdefault(k, {"n": 0, "sizes": defaultdict(int), "first": m, "bad": 0})
            g["n"] += 1
            g["sizes"][len(m)] += 1
            g["bad"] += 0 if info.get("ok", True) else 1
    
        print("== Groups (direction, maker, key = target/class/cmd for Denon) ==")
        for (d, maker, key), g in groups.items():
            k = " ".join(f"{x:02X}" if isinstance(x, int) else str(x) for x in (key or ()))
            sizes = ", ".join(f"{s} B x{c}" for s, c in sorted(g["sizes"].items())[:6])
            flag = f"  LEN MISMATCH x{g['bad']}" if g["bad"] else ""
            print(f"{d:>4} {maker:8} [{k}] x{g['n']}  sizes: {sizes}{flag}")
            print(f"       first: {hexs(g['first'])}")
    
        print("\n== Bursts (same key back to back) ==")
        bursts = []
        for d, m in messages:
            info = parse(m)
            k = (d, info["maker"], info.get("key"))
            if bursts and bursts[-1]["k"] == k:
                bursts[-1]["msgs"] += 1
                bursts[-1]["payload"] += info.get("payload", [])
            else:
                bursts.append({"k": k, "msgs": 1, "payload": list(info.get("payload", []))})
        for i, b in enumerate(bursts):
            d, maker, key = b["k"]
            k = " ".join(f"{x:02X}" if isinstance(x, int) else str(x) for x in (key or ()))
            n = len(b["payload"])
            line = f"#{i:<3} {d:>4} {maker} [{k}] {b['msgs']} msgs, {n} payload B"
            print(line)
            for guess in image_guesses(n) if n > 1000 else []:
                print(f"       image? {guess}")
            if dump and n > 1000:
                dump.mkdir(parents=True, exist_ok=True)
                base = dump / f"burst{i:03d}"
                Path(f"{base}.raw").write_bytes(bytes(b["payload"]))
                Path(f"{base}.nib").write_bytes(unnibble(b["payload"]))
                Path(f"{base}.78").write_bytes(unpack78(b["payload"]))
        images = lc6000_images(messages)
        if images:
            print("\n== LC6000 jog image uploads (0C size, 0D offset + 7-bit bitstream) ==")
        for i, image in enumerate(images):
            kind = "PNG" if image[:8] == b"\x89PNG\r\n\x1a\n" else "unknown"
            dims = f" {int.from_bytes(image[16:20], 'big')}x{int.from_bytes(image[20:24], 'big')}" if kind == "PNG" else ""
            print(f"image {i}: {len(image)} B, {kind}{dims}, head {image[:8].hex()}")
            if dump:
                dump.mkdir(parents=True, exist_ok=True)
                (dump / f"image{i}.{'png' if kind == 'PNG' else 'bin'}").write_bytes(image)
        if dump:
            print(f"\nPayloads in {dump}/: .raw as sent, .nib nibble-joined, .78 7-in-8 unpacked.")
            print("View one: ffmpeg -f rawvideo -pixel_format rgb565le -video_size 320x320 -i burst000.nib out.png")
        return 0
    
    
    if __name__ == "__main__":
        sys.exit(main(sys.argv))
  3. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Second capture: both ports, both directions (djayspy2.mmon)

    There are 1000 messages over 22.4 s:

    Direction Port Messages
    djay → unit Controller 418
    djay → unit WD 13
    unit → djay Controller 568
    unit → djay WD 1

    This capture doesn't include djay's launch, and there's no image upload in it (no 0C or 0D). It starts with djay already running and ends when djay quits.

    The timeline holds three things

    1. Layer change. The unit sends note 51 (90/91 33 7F) at 7.16 s and 14.09 s. Within 5 ms, djay repaints every LED and sends this burst to WD:
      7F 10 0A 00 04  0D 00 06 0D
      7F 10 0A 00 04  0D 00 06 08
      7F 10 0A 00 04  0D 00 06 08
      7F 10 0A 00 04  01 00 01 0D
      
      The same burst opens the capture at 0 s.
      • About 30 ms after each burst, the unit sends 8F 37 00 (ch16, note 55, off).
      • About 6.2 s later it sends 9F 37 7F.
      • Guess: note 55 on ch16 marks an overlay on the jog display. 00 means the overlay is showing; 7F means it timed out back to the idle view.
    2. The unit's heartbeat. The unit sends note 52 at velocity 127 (9x 34 7F) every 300 ms, on the active layer's channel. djay never answers it. Our app should ignore it; I need to check that it does.
    3. djay quitting (22.42 s), in this order:
      • 90 01 00 to WD (the same note that came before each upload in capture 1; likely a reset or release);
      • an LED repaint to dim, then 9x 35 7F on ch1–4;
      • F0 00 20 7F 02 F7 to the Controller. 00 20 7F is Serato's manufacturer ID, so djay speaks Serato's host protocol to the LC6000. 02 looks like the host's goodbye.
      • The unit then answers 90 33 00 and 9F 37 7F, its standalone state.

    What we send at connect, compared

    • Ours: 24 note-ons on ch1 at velocity 1, and no SysEx at all.
    • djay: 78 LED notes across ch1–4, 0A on every layer change, and the Serato goodbye when it quits.
    • If the goodbye is 00 20 7F 02, there is very likely a Serato "hello" at launch. That's the leading suspect for the black display: the jog may show uploaded images only while a host is connected. This capture missed the launch, so the hello isn't in it.

    Next steps (nothing has been sent)

    1. A third capture, which only the user can do: record first, then launch djay, wait about 10 s, then quit. That gets the hello and the upload, with their order and timing.
    2. Optional cheap probe, needs an OK: send djay's four-0A layer burst to WD, nothing else. If the display changes, the 0A messages work and the upload is the issue. If it stays black, we need the hello.
    3. The minimal sequence once the hello is known:
      • the hello to the Controller;
      • 90 01 00 to WD;
      • 0A, 0C, 0D×n, 0E, then wait for the five 01 10 0F acks;
      • the identity request 7E 06 01;
      • 10;
      • the four-0A burst;
      • then the goodbye 00 20 7F 02 when we're done.
  4. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Uploads after a power cycle: status 06, so the unit needs a host first

    These sends ran with ack listening, after the user power-cycled the LC6000. The unit was idle, showing its white↔blue "pie" animation.

    Image Run Acks (01 10 0F 00 01 xx)
    djay's PNG, verbatim 04:34 and 04:35, before the power cycle (unit still in djay's state) 00 ×5, plus the identity reply and 01 10 10
    our deck-ring PNG after the power cycle 00, 00, then 06 as the last chunk lands, then nothing more
    djay's PNG, verbatim after the power cycle 00, 00, then 06 as the last chunk lands, then nothing more
    • 06 isn't about the image. The identical djay bytes got 00 before the power cycle and 06 after it.
    • Reading: the unit takes the data, but refuses the image (06) unless a host has done its handshake. A power cycle clears that handshake. djay speaks Serato's protocol to the Controller port (it sends the goodbye F0 00 20 7F 02 F7 at quit), so the matching hello at launch is the missing step. Capture 3, which records djay launching, is the blocker.
    • The earlier "black display" had another cause: before LEDs go to the unit's controls port on every layer, never the jog display's WD port (#143) #144 our app sent its LEDs to WD, and 90 01 xx there is djay's reset message. With LEDs go to the unit's controls port on every layer, never the jog display's WD port (#143) #144 merged, the idle pie shows instead.
    • Our PNG is valid (CRCs, zlib and dimensions all check out). A re-encode in djay's exact structure is ready in case it ever matters: several deflate blocks, eXIf, IDAT split at 16384.
  5. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Verbatim launch replay: accepted, but the display stays blank until a later 0A

    Replay: capture 3's first second (msgs 0–265), sent verbatim to both ports with djay's own PNG.

    • The unit accepted everything: the WD acks were 00 ×5, the CTL identity replies came ×3, then the WD identity reply and 01 10 10.
    • But the display stayed blank.

    The rest of capture 3 (msgs 266–573) holds no quit. djay is still running when the capture ends at 13.6 s.

    • 10.98 s: one CTL note.
    • 12.27 s and 13.63 s: a layer change. Each time, djay repaints the LEDs on the new channel and sends the four-0A burst to WD.
    • Nothing else goes to WD after the commit: no second 10, no keepalive.

    Hypothesis: the 0A image index. By the Prime 4 layout, 0A's payload is A mask, B mask, image index, text.

    • Before the upload, djay sends 01 00 **06** 0D. That's index 06, probably a placeholder or blank, and it matches what we see: blank.
    • The upload is stored in slot 01: 0E's payload starts 01.
    • Every later burst ends 01 00 **01** 0D, which shows index 01, the uploaded image.

    So "upload, then 10" stores the image, and a later 0A with index 01 makes it visible. The replay stopped before that point.

    Next steps (nothing sent):

    1. Send just the four-0A burst, or only its last message 0A 01 00 01 0D, now. The unit should still hold the committed upload.
    2. Or replay the whole capture, msgs 0–573 with the captured timing, which includes both bursts.

    Then the same launch with our PNG: 0E 01, then a 0A with index 01.

  6. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    The unit accepts our own image: the full upload recipe

    Our deck-ring icon is now accepted. All acks came back 00, the commit was acknowledged, and the "show" burst went out. Whether it actually shows on the jog is pending the user's look.

    The last two missing pieces

    1. 0E is a checksum. Its 9-byte payload is the slot (01) followed by the PNG's 32-bit byte-sum as 8 nibbles, most significant first.
      • djay's PNG sums to 0x3AEE70, which is 00 00 03 0A 0E 0E 07 00.
      • The computed 0E reproduces djay's captured message byte for byte.
      • Sending djay's checksum with our image is what got status 06 on the last ack.
    2. The image shows only after a later 0A with image index 01. Before the upload, djay sends 0A 01 00 06 0D (index 06, blank). Every later burst ends 0A 01 00 01 0D.
      • Confirmed: after a verbatim replay of djay's launch the display stayed blank until the burst, then djay's logo appeared.

    Full sequence (verified with our PNG)

    Step Port Message
    1 CTL F0 00 02 0B 7F 10 60 00 04 04 01 01 00 F7, then the Serato hello F0 00 20 7F 01 F7 (without the hello the upload gets 06)
    2 WD 90 01 00
    3 WD 0A 01 00 06 0D
    4 WD 0C <21-bit PNG size>
    5 WD 0D <21-bit offset> <MSB-first 7-bit bitstream>, 14332 image bytes per chunk (n*8//7 + 1 wire bytes)
    6 WD 0E 01 <byte-sum as 8 nibbles>
    7 WD wait for 01 10 0F 00 01 00 acks; 06 means refused
    8 WD 7E 06 01, then 10 (commit; the unit answers 01 10 10)
    9 WD 0A … 01 00 01 0D (show index 01)
    • Image: a 198×198 RGBA PNG.
    • Frame: F0 00 02 0B <target> 10 <cmd> <len 14-bit> payload F7, with target 7F going to the unit and 01 coming from it.
    • Still to do:
      • Bisect out the CTL LED paint and identity requests, which rode along from djay's launch, to get the minimal sequence.
      • Find the goodbye's effect on the stored image.
      • Then design the feature (spec and slices) test-first.
  7. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Confirmed on hardware: the user sees our deck-ring icon on the LC6000's jog display. The recipe is in the comment above.

    What the unit's acks mean (F0 00 02 0B 01 10 0F 00 01 <status> F7, one per upload message; not every message gets one):

    • 00: accepted.
    • 06: refused when the image completes. Seen with a wrong 0E checksum, and with any upload while no host had said hello.
    • 01 10 10 00 00: the unit acknowledges the 10 commit.

    Scratch tools and captures stay out of the repo; djay's PNG and the .mmon captures are not committed.

  8. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Orientation (user observation): our icon's notch, drawn pointing up-right, shows pointing down-left on the jog, and the image doesn't turn with the platter. So the display shows uploads transformed:

    • A single horizontal or vertical mirror is ruled out; those would put the notch up-left or down-right.
    • A 180° rotation (the same as flipping both axes) fits.
    • So does a mirror across the anti-diagonal.

    Rule for now: pre-rotate the PNG 180° before upload.

    Pending confirm (needs an OK to send): an upright F with a red square in the top-right corner, 198×198, 2.1 KB, which uploads in about 1 s. The plan is ready.

    • Under a 180° rotation it shows as an upside-down F with the square bottom-left.
    • Under the anti-diagonal mirror, the F lies on its side.
  9. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Orientation confirmed by the F test: the user saw the F upside down, with the red square in the lower left. That is a 180° rotation, not a mirror.

    Rule: rotate the image 180° before encoding the PNG. The checksum in 0E is then computed over the rotated PNG's bytes.

  10. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Correction (from the djay-playing capture on #165): note 1 on WD (90 01 xx) is djay's play/cue state, velocity 127 or 0. It isn't a display reset, as I said earlier here. The blank display in #143 came from the app's whole LED stream going to WD; which message caused it is unknown. Also on WD: pitch bend on ch1 = the platter marker (the virtual record angle, 33⅓ rpm). See #165.

  11. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Upload speed, corrected (from the djay track-load capture on #165): the ~3.1 KB/s I measured came from my sender's API, not the unit. MIDISendSysex paces SysEx at MIDI 1.0 speed (31,250 baud). djay hands about 74 KB to CoreMIDI in about 40 ms, and the unit acks it within about 1.1 s: roughly 60–70 KB/s. So a cover-art upload takes about 0.5 s, not 10 s.

    Slots: 0C's three bytes are only the 21-bit size. The slot is 0E's first byte and 0A's image index: the logo is in slot 01, and cover art goes into slot 02, shown with 0A 0D 00 02 0D. The tools now support both (jogseq burst, jogbuild plan … [slot]).

  12. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Confirmed on hardware: a burst upload of our deck-ring icon (rotated 180° by jogbuild) to slot 02, shown with 0A 01 00 02 0D. The user sees our icon on the jog.

    • Host hello first. The unit answered 9F 37 7F, 90 33 7F and 8F 37 00.
    • Acks: 00 ×4, at +0.097, +0.104, +0.106 and +0.561 s. Then the identity reply, and the commit acked 01 10 10 at +0.585 s.
    • Timing: 0.55 s from the first 0D to the last ack, for 20.3 KB on the wire. That's about 37 KB/s including the unit's processing; the last ack, about 0.45 s after the third, looks like the PNG decode. The paced send took about 7 s for the same image.
    • Sender: jogseq burst (UMP SysEx7 via MIDISendEventList), from PR tools/lc6000-display: burst sends at USB speed, upload slot in plans (#165) #168.
  13. Skeyelab commented on Nov 16, 2026

    @Skeyelab
    MemberAuthor

    Pre-rotation confirmed: with the 180° pre-rotation from jogbuild, the user sees our icon upright, with its notch up-right as drawn. The slot 02 switch (0A 01 00 02 0D) showed it.

    Next session's probes (each needs an OK):

    1. Preload two slots. Put one image in slot 01 and another in 02, then swap with a single 0A index message: instant images on a layer change.
    2. Sweep the pitch-bend marker on WD ch1, without the hello.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-infoWaiting on reporter for more information

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions