Skip to content

fix(#232): export memory cues to PCOB2 in DAT and EXT ANLZ files#234

Open
Radexito wants to merge 7 commits into
devfrom
fix/232-memory-cue-export
Open

fix(#232): export memory cues to PCOB2 in DAT and EXT ANLZ files#234
Radexito wants to merge 7 commits into
devfrom
fix/232-memory-cue-export

Conversation

@Radexito

@Radexito Radexito commented Apr 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Memory cues now export correctly to both CDJ hardware and Rekordbox PC. Previously, tracks with memory cues (set via hot_cue_index = -1) produced an empty PCOB2 section in all ANLZ files — CDJs and Rekordbox silently ignored them.
  • Root cause: buildPcobSections and buildExtPcobSections in anlzWriter.js always returned EMPTY_PCOB_2 as a placeholder while memory cue format was under investigation (fix: memory cues not showing in Rekordbox PC (PCOB2 reverse engineering) #208). The underlying buildPcobSlot already handled slotType=0 / hot_cue_num=0 correctly — memory cues just needed to be wired through.
  • Critical fix: native capture 42 revealed that PCOB2 with memory cue entries requires mem_count=0x00000000, not 0xFFFFFFFF (the hot-cue sentinel). Writing the wrong value caused Rekordbox to reject the entire DAT file, hiding waveform, beatgrid, and all analysis data.
  • DAT PCOB2: memory cues now written for CDJ hardware playback.
  • EXT PCOB2: memory cues now written for Rekordbox PC display.
  • EXT PCO2 slot 2: was already handled by buildPco2Sections — no change needed.
  • Tests updated: replaced the "PCOB2 always empty" assertions with correct coverage of memory cue encoding and mem_count values.

Files changed

  • src/audio/anlzWriter.js — wire memory cues into PCOB2 for both DAT and EXT; fix mem_count sentinel
  • src/__tests__/anlzWriter.test.js — update PCOB2 assertions to verify memory cue output and mem_count values

Test plan

  • All 385 main-process unit tests pass
  • Import a track and set at least one memory cue in DjManager
  • Export to Rekordbox USB
  • Open the USB in Rekordbox PC — memory cue appears in the cue list
  • Verify hot cues (A–H) are unaffected and still appear correctly alongside memory cues
  • Load the USB on a CDJ — memory cue marker should appear on the waveform/jog wheel

Closes #232

🤖 Generated with Claude Code

Radexito and others added 2 commits April 14, 2026 00:38
Memory cues (hot_cue_index = -1) were never placed in PCOB2 (slotType=0)
because buildPcobSections/buildExtPcobSections always returned EMPTY_PCOB_2.

buildPcobSlot already correctly handles slotType=0 and hot_cue_num=0 —
just wire memory cues through:
- DAT PCOB2: memory cues for CDJ hardware
- EXT PCOB2: memory cues for Rekordbox PC
- EXT PCO2 slot 2: already handled by buildPco2Sections (no change needed)

Updated tests: replace "PCOB2 always empty" assertions with correct
coverage of the new behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Radexito and others added 3 commits April 19, 2026 15:25
Native Rekordbox (verified capture 42) writes mem_count=0x00000000 in
the PCOB slot-2 header when memory cue entries are present. Writing
0xFFFFFFFF (the hot-cue sentinel) causes Rekordbox to reject the entire
DAT file, hiding waveform, beatgrid, and all analysis data.

Rule: slot_type=0 (memory cues) with entries → mem_count=0x00000000
      slot_type=1 (hot cues) or empty slot    → mem_count=0xFFFFFFFF

Added regression tests locking in both values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Native capture 42 confirms EXT PCOB sections are always the empty 24-byte
stub. Memory cues in the EXT file are written via buildPco2Sections into
PCO2 slot 2, which was already correct. Writing entries into EXT PCOB2
caused Rekordbox/CDJ to reject the EXT file, dropping waveform, PQT2
beatgrid, and PCO2 cue colours from the display.

- Revert buildExtPcobSections to always return EMPTY_PCOB_2 for slot 2
- Fix test: assert EXT PCOB2 is empty even when memory cues are present
- Update protocol_rekordbox.md: DAT PCOB2 confirmed from capture 42

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant