Skip to main content

Automated rekordbox cue placement based on phrase analysis

Project description

djcues

Automated hot cue and memory cue placement for rekordbox, based on phrase analysis (PSSI), vocal detection (PVDI), and a standardized cue strategy.

djcues reads your rekordbox database, analyzes each track's phrase structure and vocal content, proposes cue placements following your cue system, and lets you review, adjust, and apply them back to the database.

Screenshot of djcues visualization

Installation

Requires Python 3.10+ and uv.

git clone <repo-url> && cd dj
uv sync

Run commands with uv run djcues <command>, or activate the venv first:

source .venv/bin/activate
djcues <command>

Cue System

djcues uses a standardized 8 hot cue + 8 memory cue system defined in cue-system.csv:

Pad Hot Cue Color Memory Cue
A First Beat Green First Beat
B Loop In Green Loop In
C Vocal / Buildup Yellow Before Buildup
D Drop Red Before Drop
E Breakdown Blue Before Breakdown
F Special Purple Before Special
G Outro Cyan Before Outro
H Loop Out Orange Loop Out

Memory cues 3-7 are placed a configurable number of bars before their corresponding hot cue (default: 16 bars). Memory cues 1, 2, and 8 share the same position as their hot cue. Colors are standardized per slot.

To customize the cue system, edit cue-system.csv and update the CUE_SYSTEM definition in src/djcues/constants.py.

Usage

Preview cues for a track

djcues propose "Playlist Name" "Track Name"

Visualize with waveform, phrases, and vocal detection

# Single track
djcues viz "Playlist Name" "Track Name"

# Entire playlist
djcues viz "Playlist Name" --all

# Compare proposals against existing cues
djcues viz "Playlist Name" "Track Name" --compare

Review and apply cues

# Launch interactive review in browser
djcues review "Playlist Name" --all

# Apply accepted cues to rekordbox (requires rekordbox to be closed)
djcues apply <session-file.json>

# Preview what would be written
djcues apply <session-file.json> --dry-run

In the review UI:

  • Accept / Skip per track or use Accept All
  • Click a cue marker to select it, then use arrow keys to nudge by 1 bar
  • Press Delete to skip an individual cue
  • Memory cues auto-recalculate when you adjust their hot cue

Compare accuracy against curated tracks

djcues compare "Processed" --all

How It Works

  1. Phrase analysis (PSSI): rekordbox analyzes tracks into phrases (Intro, Up, Down, Chorus, Outro). djcues maps these to cue slots using heuristics — e.g., Drop aligns with the first Chorus after 20% of the track.

  2. Vocal detection (PVDI): rekordbox's vocal detection data (stored in .2EX ANLZ files) provides per-frame vocal confidence. djcues uses the first strong vocal onset to place the Vocal/Buildup cue.

  3. Waveform (PWV5): The color waveform detail data is extracted and rendered in the HTML visualizer for visual reference.

  4. Beat grid: All cue positions are snapped to the beat grid for precise alignment.

Safety

  • Auto-backup: djcues apply automatically backs up master.db before writing
  • Overwrite protection: Tracks with existing cues require explicit confirmation
  • Rekordbox must be closed: The apply command will not write while rekordbox is running
  • Read-only by default: propose, compare, viz, and review never modify the database
  • DB-only writes: Cues are written to master.db only (not ANLZ files). rekordbox handles ANLZ sync on USB export.

Configuration

Option Default Description
--offset 16 Memory cue offset in bars before hot cue
--loop-bars 4 Loop length in bars for Loop In / Loop Out

Project Structure

src/djcues/
    models.py       # Data model (Track, CuePoint, Phrase, BeatGrid)
    constants.py    # PSSI mood tables, cue system definition, color maps
    db.py           # Rekordbox database reader
    strategy.py     # Cue placement heuristics
    viz.py          # HTML timeline visualizer
    review.py       # Interactive review HTML + session management
    server.py       # Local HTTP server for review sessions
    writer.py       # DB backup and cue writes
    cli.py          # Click CLI (propose, compare, viz, review, apply)

License

BSD 3-Clause. See LICENSE.

Colophon

Under the hood, djcues leverages pyrekordbox to interact with the Rekordbox database. It also makes extensive use of analysis files from Rekordbox. Other dependencies include click and pytest.

This project was created in fleeting free moments with the help of Claude Opus 4.6 and Superpowers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djcues-0.1.0.tar.gz (594.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djcues-0.1.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file djcues-0.1.0.tar.gz.

File metadata

  • Download URL: djcues-0.1.0.tar.gz
  • Upload date:
  • Size: 594.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.15

File hashes

Hashes for djcues-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4e227d65a90c01463115aeb3e44e0d28a7bf006d425fb3d4bb81051a0df5865
MD5 eaa5195117e054cc956c29986781dfc9
BLAKE2b-256 dfe6e4e05a0582833a659e0521b2abc2361025ccf5a245166197e84560f70ca3

See more details on using hashes here.

File details

Details for the file djcues-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: djcues-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.15

File hashes

Hashes for djcues-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0470452df7f71d69c169af7f87b0cae3dda1b38389a0a0371e9829bf68ae4dac
MD5 a02393d43261019425454b31f6d00537
BLAKE2b-256 8c59ccd515ee524556993d12efb9d3f3a465f3f3960642329a8faa5faada3685

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page