Skip to content

Commit bdd9859

Browse files
committed
Update documentation to reflect new color ID from #13
Also flesh out color table documentation.
1 parent 3503714 commit bdd9859

3 files changed

Lines changed: 47 additions & 19 deletions

File tree

doc/modules/ROOT/pages/anlz.adoc

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ include::example$tag_shared.edn[]
291291
(draw-box (text "unknown" :math [:sub 1]) {:span 3})
292292
(draw-box (text "time" :math) {:span 4})
293293
(draw-box (text "loop_time" :math) {:span 4})
294-
(draw-related-boxes (repeat 12 nil))
294+
(draw-box (text "c" :math [:sub "id"]))
295+
(draw-related-boxes (repeat 11 nil))
295296
296297
(draw-box (text "len_comment" :math) {:span 4})
297298
(draw-gap "comment" {:min-label-columns 4})
@@ -330,9 +331,16 @@ _type_ is 2, meaning that this cue stores a loop, then __loop_time__
330331
at bytes{nbsp}``18``-`1b` stores the track time in milliseconds at
331332
which the player should loop back to _time_.
332333

333-
The next twelve bytes have an unknown purpose, but seem to have the
334-
value `00`, except for the second byte which seems to have the value
335-
`10`. They are followed by __len_comment__, which contains the length,
334+
Immediately after the loop time, at byte{nbsp}``1c`` is the single
335+
byte value __color_id__ (labeled _c~id~_). This holds the color,
336+
if any, assigned to memory points and loops. If it is not zero,
337+
it is the ID of a row in the <<exports.adoc#color-rows,color table>>.
338+
Hot cues do not use this value, and have their own color information
339+
later in the entry.
340+
341+
The next eleven bytes have an unknown purpose, but seem to have the
342+
value `00`, except for the first byte which seems to have the value
343+
`01`. They are followed by __len_comment__, which contains the length,
336344
in bytes, of the _comment_ field which immediately follows it. If
337345
__len_comment__ has a non-zero value, _comment_ will hold the text of
338346
the comment, encoded as a UTF-16 Big Endian string with a trailing
@@ -342,25 +350,25 @@ trailing `NUL`).
342350

343351
WARNING: Some extended cue entries are incomplete, and their
344352
__len_entry__ indicates they end before the comment, or include the
345-
comment but end before the color information. Code that processes them
346-
needs to be prepared to handle this, and treat such partial cues as
347-
having no comment and/or color.
353+
comment but end before the hot cue color information.
354+
Code that processes them needs to be prepared to handle this,
355+
and treat such partial cues as having no comment and/or hot cue color.
348356

349357
Immediately after _comment_ (in other words, starting __len_comment__
350358
+ `1c` past the start of the entry) there are four one-byte values
351-
containing color information. __color_code__ (labeled _c_ in the
352-
diagram) appears to be a code identifying the color with which
353-
rekordbox displays the cue, by looking it up in a table. There have
354-
been sixteen codes identified, and their corresponding RGB colors can
355-
be found by looking at the
359+
containing hot cue color information. __color_code__
360+
(labeled _c_ in the diagram) appears to be a code identifying the color
361+
in which rekordbox displays the cue, by looking it up in a table.
362+
There have been sixteen codes identified, and their corresponding RGB
363+
colors can be found by looking at the
356364
https://github.com/Deep-Symmetry/beat-link/blob/v0.6.1/src/main/java/org/deepsymmetry/beatlink/data/CueList.java#L457-L509[`findRecordboxColor`
357365
static method] in the Beat Link library’s `CueList` class. The next
358366
three bytes, __color_red__ (labeled _r_), __color_green__ (labeled
359367
_g_), and __color_blue__ (labeled _b_), make up an RGB color
360368
specification which is similar, but not identical, to the color that
361369
rekordbox displays. We believe these are the values used to illuminate
362370
the RGB LEDs in a player that has loaded the cue. When no color is
363-
associated with the cue, all four of these bytes have the value `00`.
371+
associated with the hot cue, all four of these bytes have the value `00`.
364372

365373
We do not know what, if anything, is stored in the remaining bytes of
366374
the tag.

doc/modules/ROOT/pages/exports.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,26 @@ to have any meaning.
457457
(draw-bottom)
458458
----
459459

460+
Regardless of the names assigned to the colors by the user, the
461+
row _id_ values map to the following colors in the user interface
462+
of rekordbox and on CDJs:
463+
464+
.Colors displayed.
465+
[cols=">1m,<8"]
466+
|===
467+
|ID |Meaning
468+
469+
|0 |No color
470+
|1 |Pink
471+
|2 |Red
472+
|3 |Orange
473+
|4 |Yellow
474+
|5 |Green
475+
|6 |Aqua
476+
|7 |Blue
477+
|8 |Purple
478+
|===
479+
460480
[[genre-rows]]
461481
=== Genre Rows
462482

src/main/kaitai/rekordbox_anlz.ksy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ types:
247247
- id: color_id
248248
type: u1
249249
doc: |
250-
References a row in the colors table if the memory cue or loop
251-
has been assigned a color
250+
References a row in the colors table if this is a memory cue or loop
251+
and has been assigned a color.
252252
- size: 11 # Loops seem to have some non-zero values in the last four bytes of this.
253253
- id: len_comment
254254
type: u4
@@ -263,22 +263,22 @@ types:
263263
- id: color_code
264264
type: u1
265265
doc: |
266-
A lookup value for a color table? We use this to index to the colors shown in rekordbox.
266+
A lookup value for a color table? We use this to index to the hot cue colors shown in rekordbox.
267267
if: (len_entry - len_comment) > 44
268268
- id: color_red
269269
type: u1
270270
doc: |
271-
The red component of the color to be displayed.
271+
The red component of the hot cue color to be displayed.
272272
if: (len_entry - len_comment) > 45
273273
- id: color_green
274274
type: u1
275275
doc: |
276-
The green component of the color to be displayed.
276+
The green component of the hot cue color to be displayed.
277277
if: (len_entry - len_comment) > 46
278278
- id: color_blue
279279
type: u1
280280
doc: |
281-
The blue component of the color to be displayed.
281+
The blue component of the hot cue color to be displayed.
282282
if: (len_entry - len_comment) > 47
283283
- size: len_entry - 48 - len_comment # The remainder after the color
284284
if: (len_entry - len_comment) > 48

0 commit comments

Comments
 (0)