ModuleDraft 0.2, for comment

On this page
  1. The rule that shapes it
  2. Sketch
  3. Timing
  4. Cues
  5. Beat grids
  6. Analysis
  7. What isn't stored
  8. Size
  9. Mixes
  10. Open questions
  11. Prior art

DJ module (draft 0.2)

Status: draft for comment. Namespace: org.openmusiccollection.dj. Needs: Core 1.0.

DJs spend years preparing their music: cue points, loops, beat grids, memory points. Today that work is locked into one DJ app, and moving it to another costs money or is lost. This module lets that preparation travel with the collection.

The rule that shapes it

Tempo and key describe the recording, so they are core item fields (with provenance), holding the collection's one value. Cue points, beat grids and measurements describe one audio stream: a different master or encode of the same song shifts every position. So DJ data lives on the copy whose audio was measured, file or stream, in the copy's ext. A BPM a tool measured from Bandcamp's preview goes on the Bandcamp copy; Rekordbox's cues for a TIDAL track go on the TIDAL copy.

Sketch

"ext": {
  "org.openmusiccollection.dj": {
    "beat_grid": [[112, 124.0, 1], [180112, 124.0, 3]],
    "cues": [
      { "kind": "hot", "slot": 1, "at_ms": 32012, "label": "Drop", "color": "#E5484D" },
      { "kind": "memory", "at_ms": 64090 },
      { "kind": "loop", "slot": 2, "at_ms": 96010, "length_ms": 7742 }
    ],
    "analysis": { "bpm": 124.0, "key": "Am", "energy": 7, "loudness_lufs": -8.2,
                  "audio": "full", "by": "Rekordbox 7" }
  }
}

Timing

Positions are milliseconds from the first real sample of the audio, after removing the encoder's leading silence and padding as the file's own gapless header states (LAME/Xing, iTunSMPB). Each producer converts from its app's view; readers trust the numbers. A file copy's fingerprint lets an importer check it is placing cues on the same audio.

Cues

kind is hot, memory, loop, fade_in, fade_out or load, an open list. A loop is a cue with length_ms; a hot loop or saved loop also has a slot. Anything else (Serato's flips, Rekordbox's active loop) goes in the producer's namespace. A reader maps kinds it lacks as it sees fit (Serato has no memory cues). Colours are hex strings; apps map them to their nearest palette colour.

Beat grids

A grid is compact: an array of markers [at_ms, bpm, beat_in_bar], only where the tempo or the bar position changes, and readers fill in the beats between. beat_in_bar is which beat of the bar the marker falls on, from 1. The grid's own bpm places the beats; the item's bpm is what to show. A one-hour live recording with a drifting tempo is about 110 KB this way.

Analysis

analysis is what a tool measured on this copy's audio: bpm, key (in the core's notation), energy (1 to 10, the scale Mixed In Key made common), loudness_lufs, and other scores by name. audio says what was measured, preview or full, and by who measured it. The item's bpm and key stay the collection's one value; a home may pick one of these to show there, with provenance saying where it came from.

What isn't stored

  • Waveforms. Apps compute them again from the audio.
  • Stems separated on the fly (Rekordbox, Serato, Traktor, djay) and their caches are the app's working data. A stem file (Native Instruments' .stem.mp4) is an ordinary file copy of its own recording; apps recognise the format from the file.

Size

A home that supports this module MUST accept at least 1 MB of its data per copy. This is apart from an app's own data_bytes in Access.

Mixes

A DJ mix, a radio show or a live set is a recording like any other (it has a title, artists and copies: a SoundCloud upload, a file), with a tracklist of other recordings, in the item's ext:

{"type":"item","id":"m1","kind":"recording","title":"Basement, March","artists":["Anna K"],"duration_ms":5400000,
 "copies":[{"source":"s3","ref":"1987654321","url":"https://soundcloud.com/anna-k/basement-march"}],
 "ext":{"org.openmusiccollection.dj":{"mix":{"tracklist":[
   {"at_ms":0,"item":"i1","title":"Night Drive","artists":["Mira Holt"]},
   {"at_ms":312000,"item":"i2","title":"Glass Tides","artists":["Lumen Arcade"]},
   {"at_ms":598000,"title":"ID","artists":["Unknown"]}]}}}}
  • Each line has at_ms (when it starts in the mix) and either item, the id of a recording in the collection, or title and artists for a track the person doesn't have (or that nobody has identified yet, an "ID").
  • An item id is local like every id, and a home that combines collections without knowing this module can't rewrite it. So a line with item SHOULD also carry title and artists, which let the line be matched again.
  • Apps that don't know the module show the mix as a long recording, which is what it is.
  • A mix the person plans rather than recorded is an ordered list; a recorded mix is an item, since it has its own audio.

Open questions

  1. Should a mix's tracklist say how tracks were blended (transitions, overlaps)?

What was decided, and when, is in the changelog.

Prior art

Rekordbox XML, Serato and Traktor (NML) cue formats, and the tools that convert between them.