Skip to content
Stefa008Public

About

Make your tablet like a real cdj

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Virtual CDJ

Turn a tablet (even an old iPad Mini 2 / iOS 12, while any model works well, newer ones offer better performance. An iPad is highly recommended for the best experience, you can use any tablet running any operating system) into a Pioneer‑style CDJ player. The interface runs entirely in the browser; a tiny Python server (Mac is the best option now, but full linux support will be implemented in the future) lets you browse the host's files and read Rekordbox USB sticks. It also works fully standalone (open the HTML, load local files) with no server at all.

One deck per page: open ?deck=1, ?deck=2, … so each tablet/window runs a single lightweight deck. Built to stay smooth on 2013‑era hardware.


Features

Playback / engine

  • Native AudioBufferSourceNode engine — smooth audio + instant, touchstart buttons.
  • CUE, PLAY/PAUSE, play‑while‑holding‑CUE, pitch‑bend buttons, fast SEARCH.
  • Inverted tempo fader (up = −, down = +) with a magnetic center detent, range ±6 / ±10 / ±16 / WIDE (single cycling button), BPM −/+ fine nudge, volume.
  • LOOP IN/OUT, RELOOP, BEAT LOOP (N beats), BEAT JUMP, loop ÷2 / ×2 — with a fixed loop that does not drift.

Cues & loops

  • 8 colored HOT CUE pads, HOT vs GATE cue modes, DELETE to clear a pad.
  • A hot cue can store a saved loop (shows ↻; press to jump + re‑loop).
  • Cue/loop database: your cues, loops and grid edits are saved per track in the browser and restored automatically on reload — Export / Import as a JSON file.

Analysis & grid

  • Reads Rekordbox metadata from a USB stick: track list, playlists, BPM, key, hot cues, beat grid, artwork — plus a search box.
  • Standalone BPM analysis for your own files (onset‑flux autocorrelation with octave correction + downbeat detection) that also builds a beat grid.
  • Editable beat grid (GRID mode): drag to shift, BPM ±, ÷2/×2, SET beat to playhead, set DOWNBEAT.

UI

  • Layout modeled on the CDJ‑1500X; light / dark theme; fully in English.
  • Waveform (scrolling zoom + overview), beat grid, cue markers, remaining time, TEMPO %, BPM, KEY.
  • Auto‑detects a plugged‑in Rekordbox USB and shows a Server connected / Standalone indicator.

Files

File Purpose
VirtualCDJ.html The whole app (open it in the tablet browser)
cdj_server.py Python 3 server: serves the app, browses the disk, reads Rekordbox USB
rb_reader.py Parses a Rekordbox USB (export.pdb + ANLZ cues/grid)
rekordbox_pdb.py Kaitai‑generated parser for the Pioneer export.pdb (do not edit)

Requirements

  • Server host: a Mac or a Raspberry Pi with Python 3 (already included on both).
  • Tablet: any browser (designed for iOS 12 Safari and up).
  • For Rekordbox USB reading only: pip3 install kaitaistruct pyrekordbox.

Quick start (with server)

python3 cdj_server.py            # starts from your home folder, port 8777
# or:  python3 cdj_server.py /path/to/music 9000
  • On the host: http://localhost:8777/
  • From the tablet (same Wi‑Fi): http://<HOST-IP>:8777/ (the server prints the IP on start)
  • Pick a deck with ?deck=1, ?deck=2, …

Reading a Rekordbox USB

pip3 install kaitaistruct pyrekordbox

Plug the stick, open the deck's USB button → the app detects the Rekordbox library and shows playlists, tracks, BPM/key, your saved hot cues, beat grid and artwork.

Standalone (no server)

Just open VirtualCDJ.html in the browser and use FILE to load local tracks. The header shows Standalone mode; cues/loops are still saved locally and can be exported.


Raspberry Pi

sudo apt install -y python3-venv python3-numpy
cd Virt_CDJ && python3 -m venv venv
venv/bin/pip install kaitaistruct pyrekordbox
venv/bin/python cdj_server.py

Find the Pi's address with hostname -I, then open http://<PI-IP>:8777/ from the tablet. No firewall on the Pi, so tablets usually connect immediately.


Audio formats

MP3, WAV, AIFF, and (on capable devices) M4A/AAC, FLAC, OGG. Compressed formats a device can't decode (e.g. FLAC on iOS 12) are blocked with a clear message instead of failing silently.

Known limitations / not (yet) done

  • No key‑lock (Master Tempo): tempo changes pitch (vinyl‑style). Key‑lock without quality loss isn't feasible smoothly on iOS 12 (no AudioWorklet).
  • No SYNC / beat‑match / mixer between decks (one deck per page).
  • Beat grid model is constant‑tempo (fine for most electronic tracks).
  • No real jog scratch physics (replaced by pitch‑bend buttons).

Notes

  • macOS: to browse Desktop/Documents/external drives, grant Terminal → Full Disk Access.
  • If tablets can't connect on a Mac, it's almost always the macOS firewall — allow Python or turn it off while playing.

About

Make your tablet like a real cdj

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages