AgentSkillsCN

midi-rekordbox

生成 AI 著作的代码更改叙事 walkthrough。适用于实施后,解释发生了什么、为什么以及如何运作。

SKILL.md
--- frontmatter
name: midi-rekordbox
description: Rekordbox MIDI Learn CSV format reference (reverse-engineered). Use when parsing or generating Rekordbox CSV mapping files, implementing MIDI-to-function lookup, working with deck channel offsets, hi-res 14-bit CC controls, or understanding DDJ/XDJ/DJM controller MIDI conventions. Ground truth CSVs included as supporting files.

Rekordbox MIDI Learn CSV Protocol

Reverse-engineered from bundled controller CSVs and the official AlphaTheta MIDI Learn Operation Guide. The guide documents the UI workflow; this skill documents the CSV wire format that the UI reads and writes.

Ground truth: references/DDJ-FLX10.midi.csv (567 lines, 4-deck) and references/DDJ-GRV6.midi.csv (339 lines, 2-deck).

File Structure

code
Line 1:  @file,1,DDJ-FLX10                    ← file marker, format version (always 1), controller name
Line 2:  #name,function,type,input,deck1,deck2,deck3,deck4,output,deck1,deck2,deck3,deck4,option,comment
Line 3+: data rows, section headers, or empty separators

The CSV is also the EXPORT/IMPORT format — Rekordbox's MIDI setting window reads and writes this exact structure.

Column Definitions (15 columns, 0-indexed)

ColHeaderPurposeNotes
0#nameInternal identifierOften matches col 1; # prefix = not user-assignable in MIDI Learn UI
1functionRekordbox function (key column)Supports modifiers: +Shift, +LongPress, +Press
2typeControl typeSee Control Types below
3inputBase MIDI IN code (4-digit hex)Empty when deck columns have full codes
4-7deck1-deck4Input deck assignmentsChannel offsets OR full MIDI codes
8outputBase MIDI OUT code (LED feedback)Often mirrors input
9-12deck1-deck4Output deck assignmentsMirrors input pattern
13optionFlags (semicolon-separated)See Options below
14commentHuman description

MIDI Hex Format

Codes are 4-digit hex: SSDD — status byte + data byte.

code
Status byte = upper nibble (message type) + lower nibble (channel 0-15)

  9x = Note On      Example: 900B = Note On, Ch 0, Note 0x0B
  8x = Note Off     Example: 800B = Note Off, Ch 0, Note 0x0B
  Bx = Control Change   Example: B640 = CC, Ch 6, CC 0x40

Channels are 0-indexed in the CSV (0-15) but conventionally displayed as 1-16.

Deck Assignment Patterns

Pattern 1: Base Code + Channel Offsets (most common)

csv
PlayPause,PlayPause,Button,900B,0,1,2,3,900B,0,1,2,3,Fast;Priority=50;Dual,Play/Pause

Base 900B (Ch 0) + offsets 0,1,2,3 → Ch 0 (Deck 1), Ch 1 (Deck 2), Ch 2 (Deck 3), Ch 3 (Deck 4).

Pattern 2: Empty Base + Full MIDI in Deck Columns

csv
Load,Load,Button,,9646,9647,9648,9649,,,,,,,Load to Deck

Input column empty; each deck column has a complete 4-digit MIDI code.

Pattern 3: Global (No Deck Assignment)

csv
Browse,Browse,Rotary,B640,,,,,,,,,,,Browse

Channel 6 = global controls. All deck columns empty.

Pattern 4: Non-Sequential Channel Offsets

csv
PAD1_PadMode1,PAD1_PadMode1,Pad,9000,7,9,11,13,...

Offsets 7, 9, 11, 13 → Channels 7, 9, 11, 13 for decks 1-4. Not always sequential.

Pattern 5: Multi-Row Per Function

csv
FXPartSelectVocalOn,,Button,9714,,,,,9714,,,,,,FX PART SELECT VOCAL
FXPartSelectVocalOn,,Button,9914,,,,,9914,,,,,,FX PART SELECT VOCAL
FXPartSelectVocalOn,,Button,9B14,,,,,9B14,,,,,,FX PART SELECT VOCAL

Same function on separate rows with different MIDI codes (channels 7, 9, 11). Deck columns empty; channel is baked into the code.

Control Types

Verified in CSVs

CSV NameMIDI MessageResolutionDescription
ButtonNote On/OffMomentary button
PadNote On (velocity)Velocity-sensitive pad
KnobSliderHiResCC (14-bit)0-16383High-resolution fader (MSB+LSB)
RotaryCC (relative)Rotary encoder (64=center, >64=CW, <64=CCW)
JogRotateCCJog wheel rotation
JogTouchNote On/OffJog wheel touch detect
JogIndicatorJog display feedback (output only)
DifferenceCCPosition difference (search/seek)
IndicatorOutput-only LED feedback
ValueCCSpecial: Needle Search or Velocity Sampler
ParameterInternal config, uses FFFx codes (outside standard MIDI)

Listed in Official Guide but NOT Found in CSVs

UI NameExpected CSV NameStatus
Knob/Slider (0h-7Fh)Knob or KnobSliderNot observed in DDJ-FLX10 or DDJ-GRV6 CSVs

All faders in both CSVs use KnobSliderHiRes (14-bit). 7-bit knob types may exist in other controllers.

14-Bit Hi-Res Controls (MSB/LSB)

KnobSliderHiRes uses standard MIDI 14-bit CC encoding:

  • MSB: CC 0-31 (coarse value, appears in the CSV)
  • LSB: CC 32-63 (fine value, implicit — CC number = MSB CC + 32)
  • Combined value: MSB * 128 + LSB (range 0-16383)

Example: TempoSlider mapped to B000 (CC 0). The device also sends CC 32 as the LSB — this is NOT in the CSV but must be handled by any parser.

code
CSV entry:     B000 → CC 0 on base channel (MSB)
Implicit LSB:  B020 → CC 32 on same channel (LSB, not in CSV)

Parser must: recognize CC 32-63 as LSBs for CC 0-31 when the MSB maps to a KnobSliderHiRes function. The LSB shares the same function name and deck assignment.

Options Field

Semicolon-separated in column 13. Example: Fast;Priority=50;Dual

OptionFormatDescription
FastflagPriority processing for time-critical controls
Priority=Nkey=valuePriority level 0-100
Dualflag4-deck mode support (DDJ-FLX10)
Blink=Nkey=valueLED blink rate in milliseconds
ROflagRead-only: controller reports state, not user-assignable
Value=Nkey=valueConfig value (used with Parameter type)
Min=Nkey=valueMinimum value
Max=Nkey=valueMaximum value

Row Types

TypeColumn 0Column 1Example
FunctionalnamefunctionPlayPause,PlayPause,Button,900B,...
Section header# Nameempty# Browser,,,,,,,,,,,,,,
Separatoremptyempty,,,,,,,,,,,,,,
#-prefixed functional#Namefunction#JogScratch,JogScratch,JogRotate,...
# placeholder#function#,Browse+Press+Shift,Button,...

#-Prefixed Rows

Column 0 starting with # marks controls not assignable through the MIDI Learn UI. Two subcategories observed:

  1. Hardwired + RO — Controller-reported state, firmware-fixed. All jog controls, deck select indicators. Always have RO option. (e.g., #JogScratch, #Deck3)

  2. Hardwired, not RO — Real input controls with fixed MIDI assignments that can't be remapped. No RO flag. (e.g., #CrossFader with Fast, #ChannelFader)

These rows have valid MIDI codes and produce real messages. A sniffer/parser should handle them.

Special Sections

# State — Status synchronization

csv
VinylState,VinylState,Button,903A,0,1,2,3,,,,,,RO,LED State of Vinyl buttons
DeckState,DeckState,Button,903C,0,1,2,3,,,,,,RO,LED State of DECK

# illumination — LED control (Channel 15)

csv
LoadedIndicator,LoadedIndicator,Indicator,,,,,,,9F00,9F01,9F02,9F03,RO;Priority=100,Load illumination
JogBrightnessSetting,JogBrightnessSetting,Value,BF46,,,,,BF46,,,,,RO;Priority=100,JOG RING brightness

Uses 9Fxx (Note On Ch 15) and BFxx (CC Ch 15).

# Parameter — Internal config

csv
JogIndicatorInterval,JogIndicatorInterval,Parameter,FFF1,,,,,,,,,,Value=12,
MidiOutInterval,MidiOutInterval,Parameter,FFF3,,,,,,,,,,Value=2,

FFFx codes are outside standard MIDI range — internal to Rekordbox.

Channel Conventions (Hardware-Specific)

Some controls are NOT in the CSV — they're hardwired in controller firmware. These channel assignments are observed empirically:

Controller FamilyChannelKnown Controls
DDJ controllersCh 6MicLevel (CC 5), MasterLevel (CC 8), BoothLevel (CC 9), CueMasterMix (CC 12), HeadphonesLevel (CC 13)
XDJ all-in-onesCh 4MasterLevel (CC 24), BoothLevel (CC 25)
DJM mixersCh 0MasterLevel (CC 24), BoothLevel (CC 25)
All (illumination)Ch 15LED feedback (9Fxx, BFxx)

Note: DDJ Ch 6 mappings confirmed on DDJ-GRV6 only. XDJ/DJM mappings are unverified — derived from community reports.

Lookup Algorithm

To find a Rekordbox function from a received MIDI message:

code
1. Parse message: type (note_on/note_off/cc), channel, data1
2. Build key: "{type}:{channel}:{data1}"
3. Search CSV rows:
   a. Pattern 1: base_code channel + deck_offset == message channel?
   b. Pattern 2: deck column contains full MIDI code matching message?
4. If CC 32-63 and no direct match:
   → Check CC (data1 - 32) as MSB for KnobSliderHiRes — this is the LSB
5. Return function from column 1, control type from column 2

Verification Status

ClaimEvidenceConfidence
CSV structure (15 cols, @file header)2 CSVs + official IMPORT/EXPORTHigh
Deck offset patterns 1-4Verified in both CSVsHigh
Pattern 5 (multi-row)DDJ-GRV6 lines 223-226High
Control types (verified list)Exhaustive grep of both CSVsHigh
Knob/KnobSlider typesNOT found in either CSVUnverified
14-bit MSB/LSBWorking parser + MIDI specHigh
# prefix = not UI-assignableObserved behavior, not confirmedMedium
DDJ Ch 6 built-in controlsConfirmed on DDJ-GRV6 hardwareMedium
XDJ/DJM channel conventionsCommunity reports, no hardware testLow

Sources

  • Ground truth CSVs: references/DDJ-FLX10.midi.csv, references/DDJ-GRV6.midi.csv (bundled with this skill)
  • Official guide: AlphaTheta "MIDI LEARN Operation Guide" for rekordbox 7.0.5 (UI workflow, control type definitions)
  • CSV source: /Applications/rekordbox 7/rekordbox.app/Contents/Resources/MidiMappings/
  • MIDI spec: https://www.midi.org/specifications (14-bit CC, status bytes)