Guide & Support
AI DJ Pro — Complete Technical Guide
Combined reference for architecture, sessions, library, mixing, session alignment, stems, deck effects, crowd requests, MC, AI tools, faders, configuration, and troubleshooting.
New to AI DJ Pro?
Prefer plain language? The user guide covers the same workflows without technical jargon — perfect for first-time DJs and party hosts.
1. Big picture
AI DJ is a local-first DJ application: your music stays on your machine, playback and mixing run in the desktop app, and a Python DJ brain on your PC chooses tracks, drives auto-mix timing, and generates host (MC) announcements. Optional cloud APIs (OpenAI, ElevenLabs) power AI search, set planning, and voice — but core playback does not require them.
Plain-language guide for first-time DJs and party hosts — no technical jargon required.
Simple User GuideDivision of labour
| Layer | Responsibility |
|---|---|
| Electron client | Dual decks (A/B), crossfader, waveforms, transport, library UI, MC audio playback, volume ducking during MC |
| WebSocket server | Session state, track queue, smart next-track picks, MC text generation, TTS orchestration, crowd queue, license checks |
| HTTP file server | Serves local files from your music folder; proxies YouTube streams for in-browser playback |
| Crowd HTTP server | Simple web form on your LAN so guests can request songs from their phones |
The client and server talk over ws://127.0.0.1:8765. The UI must stay connected for crowd requests and server-driven auto mix to work.
2. Components and ports
| Port | Service | Purpose |
|---|---|---|
| 8765 | WebSocket (AIDJ_WS_PORT) | All DJ commands and real-time updates |
| 8766 | HTTP (AIDJ_HTTP_PORT) | Local audio files, /health, YouTube stream proxy |
| 8767 | Crowd HTTP (AIDJ_CROWD_HTTP_PORT) | Guest song-request form (LAN) |
Key source files
| Area | File |
|---|---|
| Backend hub | aidj_server.py |
| Feature helpers | aidj_features.py |
| Waveform / mix cues | waveform_analysis.py |
| Library AI search | library_ai_search.py |
| AI set builder | ai_set_builder.py |
| MC templates / AI lines | mc_brain.py |
| Desktop UI logic | electron_mock/renderer.js |
| Electron shell | electron_mock/main.js |
| Waveform rendering | electron_mock/ProfessionalWaveform.js |
Production vs development
- Installed app: Electron spawns bundled aidj-server.exe, waits for http://127.0.0.1:8766/health, then opens the UI.
- Development: Run python aidj_server.py and npm start in electron_mock/ separately.
Default music folder on first install: Documents\AI DJ\Music (Windows) or ~/Documents/AI DJ/Music (macOS).
3. First run and data storage
Setup wizard
On first successful library load, a 4-step setup wizard may appear (unless you already completed it):
- Music folder — point at your MP3/M4A/FLAC library
- API keys — optional OpenAI / ElevenLabs for AI and MC voice
- Crowd requests — LAN URL and QR code for guests
- Analyze a track — BPM/key for beat grid and auto cues
Completion is stored in browser localStorage as AIDJ_SETUP_COMPLETE.
Where data lives (Windows example)
%APPDATA%\AI_DJ_Demo_Pro\
| Data | Location |
|---|---|
| App config | aidj_config.json |
| Track genres / metadata | track_metadata.json |
| Waveform cache | waveform_cache/ |
| Crowd blocklist | crowd/blocklist.json |
| License blob | Encrypted, via license_storage.py |
| Server log | aidj-server.log (packaged) |
The client also mirrors the library in IndexedDB (AIDJLibrary) so reopening the library panel can show tracks immediately while refreshing from the server in the background.
4. The music library
Scanning local files
On startup (and when you change the music folder), the server scans AIDJ_MUSIC_DIR for: .mp3, .m4a, .flac, .wav, .ogg, .aac
For each file it builds a library item with title, artist, duration, BPM and musical key (Camelot), genre, album art, beat grid origin, and mix cue.
Library panel (client)
- Search, filter by genre / BPM / Camelot / date added
- Sort and drag-to-reorder (playlist order)
- Double-click — set as starting track or play (mode-dependent)
- Right-click — queue next (auto mode)
- Genre editing, AI genre detect, dedications, remove from playlist
- In manual mode: Load Deck A / B buttons per row
- In auto mode (session active): live/next deck indicators on rows
Request full library sync: client sends get_library → server responds with { type: "library", tracks: [...] }.
Saved playlists & analysis tools
Save the current library view to IndexedDB (named playlists) and reload later. Wire-format playlists from YouTube preserve order; sequential queue mode plays them in list order instead of smart reordering.
| Action | What it does |
|---|---|
| Analyze missing BPM | Batch BPM, beat grid, Camelot for tracks that lack them |
| Detect genre (AI) | OpenAI one-word genre for a single track |
| Analysis queue | Full waveform + cue analysis for all tracks missing data |
5. YouTube and streaming
Single track import
Paste a URL → Load YouTube (Add) or Replace. Server uses yt-dlp + FFmpeg to download (or stream), analyzes BPM/key, adds to state.lib, and pushes library_update to the client.
Playlist import (stream mode)
- Resolve — yt_playlist_resolve returns track list without downloading everything
- Load — yt_playlist_load adds entries as stream URLs: http://127.0.0.1:8766/stream/youtube?id=VIDEO_ID
- Background preload — parallel BPM/key/genre for tracks that need metadata
Replace during a live session: the library swaps, but the currently playing track keeps going until it ends or you skip — the new list does not hijack the mix mid-song.
Playback URLs
- Local files → file:// or http://127.0.0.1:8766/... (served from music dir only — path traversal blocked)
- YouTube → stream proxy on 8766
First play of a YouTube stream may take 15–30 seconds while the pipeline starts.
6. Running a session
Start
- Load a library (local folder and/or YouTube playlist).
- Optionally double-click a starting track in the library.
- Press Start → client sends { type: "start" }.
- Server sets started = true and the player loop picks the first track (crowd queue, DJ-selected starting track, or first in queue).
- Server sends incoming → client loads that track on deck A or B and begins playback (auto mix).
During the session
- Pause — freezes client audio and server track clock.
- Next Track (auto only) — skip to next pick with a crossfade.
- Energy slider — crowd energy 0–100; biases BPM targets for smart selection.
- End — goodbye MC (optional) → music fade out → session reset.
Stop
- Client: { type: "stop" }
- Optional goodbye MC → client plays TTS wav
- Server: fade_out (default ~8s) → client fades gains → fade_complete
- Server: stop_ack — library queue reset, stats finalized
Decks A and B
Two logical decks alternate in auto mode. Server toggles state.deck between A and B each transition. Live deck = on air; other deck = preloaded with the next track before the crossfade.
7. Auto mix vs manual mix
Toggle via mix control mode (stored in localStorage, synced to server as mix_control_mode).
| Auto mix | Manual mix | |
|---|---|---|
| Track advance | Server timer + skip; sends incoming | You load decks from library; server holds queue |
| incoming messages | Loaded and crossfaded | Ignored |
| Next Track button | Active | Disabled |
| Crossfader | Automated (gains follow live deck) | You blend Deck A ↔ B (center = both full) |
| Phrase / Bar / Phase lock | Active | Not used for server transitions |
| Library | Browse, queue, indicators | Load Deck A / B per row |
| MC | Server premix/postmix/interval | Intro when you press play on a deck |
| Deck effects / hot cues | Available on both decks | Same — primary tool for live performance |
Use auto for hands-off hosting; manual when you want full DJ control with the crossfader.
Manual crossfader curve
- Center — both gainA and gainB at full level (~80% peak headroom).
- Left of center — Deck A stays full; Deck B fades out toward the left extreme.
- Right of center — Deck B stays full; Deck A fades out toward the right extreme.
This matches hardware DJ mixers with a wide overlap at center. Saved position is in client memory; switching back to auto resets the fader to the live deck.
8. How a transition works
Auto mix is a cooperation between server timing and client audio engineering.
Server side
After sending incoming, the server waits roughly track duration minus overlap. While paused, that clock does not advance. On timeout or skip, it calls pick_next_track(), flips deck, sends the next incoming.
Client side (playOnDeck)
- Resolve crossfade length — manual Xfade fader seconds, or auto from outgoing waveform analysis.
- Resolve mix-in point (Set Cue mode: manual seconds, or auto/drop/chorus from waveform).
- Snap cue to Phrase or Bar grid (see Session alignment controls, section 11).
- Beat-align incoming to outgoing (tempo + phase) at mix start.
- Schedule crossfade; run phase lock during overlap.
- Update UI: waveforms, deck titles, library deck indicators.
Shock mix (hard transitions)
When Shock mix is enabled (checkbox under the waveforms, next to Align on mix), the client may replace a normal crossfade with a shock transition:
- Outgoing deck spinback (playback rate ramps down + spinback SFX).
- Outgoing gain drops quickly; incoming drops in on the beat.
| Mode | Condition |
|---|---|
| BPM | Incoming vs outgoing BPM differs by more than ~8% |
| Genre | Genres are incompatible for a smooth blend (genresCompatibleForMix) |
| Both | Either condition qualifies (default) |
Runs on natural track end and when you press Next Track (not blocked by quick-fade). Requires genre metadata for genre-based detection. Client: evaluateShockTransition() / crossfadeToShockTransition() in renderer.js. Persisted: localStorage keys aidj_auto_shock_transition, aidj_shock_mix_trigger. Shock mix is auto mode only — disabled in manual mix.
Crossfade audio graph
audioA ──► gainA ──┐
├──► gainMusicDuck ──► gainMaster ──► speakers
audioB ──► gainB ──┘
audioMC ──► gainMC ──► (parallel, for host voice)MC ducking lowers gainMusicDuck during announcements so the crossfader gains on A/B are untouched.
9. Smart track selection and set arc
When AIDJ_SMART_SELECTION=1 (default), the server does not pick tracks randomly. find_best_next_track() scores candidates.
Pick priority
- Manually queued track (queue_next / right-click in library)
- Crowd queue (FIFO, approved requests)
- Sequential playlist — if enabled, next in wire order
- Smart selection — scored best match
- Fallback — first available track ≠ current
| Factor | Typical weight | Notes |
|---|---|---|
| BPM closeness | ~35% | Tolerance AIDJ_BPM_TOL (default 6) |
| Camelot key | ~30% | Harmonic mixing; optional hard filter |
| Genre | ~15% | Match or compatible families |
| Energy curve | ~20% | Set arc phase + crowd energy slider |
| Diversity | ~10% | Prefer different artists |
| Recent history | — | Avoid last N tracks (AIDJ_AVOID_RECENT) |
Set arc (energy curve)
Set arc dropdown → server energy_arc_mode. See Session alignment controls (section 11) for how Set arc differs from Phrase, Bar, and Phase lock.
| Mode | Behaviour |
|---|---|
| Auto | Phases by tracks played: build → peak → cooldown (defaults: 3 + 5 tracks) |
| Warm up | Force build phase — gentler, rising BPM |
| Peak | Force peak — high energy maintenance |
| Cool down | Force wind-down — lower BPM bias |
Crowd energy slider (0–100) further nudges target BPM within each phase. Harmonic filter in the library (Δ column vs live deck key) is a UI filter for browsing; smart selection uses its own key logic server-side.
10. Waveforms, cues, and beat alignment
Server analyzes audio (librosa + FFmpeg) to produce peak waveform segments (multi-band colours on deck display), beat grid (BPM + beat_grid_origin), and mix cue (structural mix-in point). Results cached under waveform_cache/ by file hash.
Set Cue modes (client)
| Mode | Mix-in point |
|---|---|
| Manual | Fixed seconds from track start (fader 1–30s) |
| Auto Cue | Waveform structural cue + grid snap |
| Drop | Emphasis on drop detection |
| Chorus | Emphasis on chorus / lift |
Full detail on the faders and mode dropdowns: see section 18 — Xfade, Next, and Set Cue faders.
Xfade modes
| Mode | Fade timing |
|---|---|
| Manual | Fixed seconds from crossfade fader |
| Auto Xfade | Fade starts where outgoing waveform drops (matches Set Cue philosophy) |
Session alignment toolbar
Phrase, Bar, Phase lock, and Set arc — documented in Session alignment controls (section 11). The beat bar dots (1–2–3–4) show live beat position on the playing deck.
11. Session alignment controls
These settings sit in the top control bar (next to Start, Pause, and Next Track). They apply in auto mix mode only — not when you are blending decks manually with the crossfader.
Phrase
Options: 16, 24, 32, 48, 64 beats (default: 32). Align mixes to longer musical phrases on the outgoing track's analyzed beat grid.
Phrase controls when the next crossfade is allowed to start (the app waits for the next phrase boundary when possible) and where the incoming track's mix cue snaps (aligned to the same phrase length on the incoming grid). At 128 BPM, 32 beats is roughly 15 seconds (about 8 bars in 4/4) — a common DJ phrase length.
| Setting | Effect |
|---|---|
| Shorter (16–24) | Tighter, more frequent transitions |
| 32 | Balanced default — musical without feeling rushed |
| Longer (48–64) | Mixes land on bigger section changes |
If waiting for a full phrase would run past the waveform fade window, the app falls back to Bar, then to a single beat, so the mix still happens in time. Saved in browser localStorage (persists across sessions on this machine).
Bar
Options: 4 or 8 beats (default: 4). Finer beat-grid alignment when a full phrase is not used or as a fallback.
- 4 = one bar (four beats in 4/4)
- 8 = two bars
Bar affects the same two things as Phrase — crossfade timing and cue snap — but on a shorter grid. Use 8 for slightly looser bar-line mixes; 4 for tighter alignment to every bar. Saved in browser localStorage.
Phase lock
Options: Off, Low, Medium, High (default: Medium in code; UI may show High if you changed it). Keep beats locked during the crossfade overlap.
While both decks are audible, the app briefly nudges the incoming deck's tempo so its beat phase matches the outgoing deck. When the fade finishes, tempo returns to normal.
| Setting | Effect |
|---|---|
| Off | No beat pulling during the blend |
| Low | Gentle correction |
| Medium | Balanced |
| High | Strongest lock — beats line up fastest; more noticeable tempo micro-adjustments |
Phase lock does not change which song plays next or when the fade is scheduled — only how tightly the beats align while the two tracks overlap. Saved in browser localStorage.
Set arc
Options: Auto, Warm up, Peak, Cool down (default: Auto). Tell the server which energy curve to use when choosing the next track in smart / auto playback.
This does not control crossfade length, cue points, or beat alignment. It influences BPM and energy of upcoming picks (and related smart-selection logic). Saved on the server for the active session (sent over WebSocket when you change the dropdown).
| Mode | Behavior |
|---|---|
| Auto | Natural set flow over time: build energy early, maintain a peak, then cool down. Track count drives the phase. |
| Warm up | Stay in build mode — gentler, rising energy |
| Peak | Stay in peak mode — high-energy selections |
| Cool down | Wind the set down — lower-energy selections |
How they work together
Outgoing track playing
│
▼
Phrase / Bar ──► wait for grid boundary (when possible)
│
▼
Incoming track cue snapped to same grid idea
│
▼
Crossfade starts (timing also follows waveform / Xfade settings)
│
▼
Phase lock ──► micro-tempo on incoming deck during overlap
│
▼
Set arc ──► (parallel) server picks next track for following transition| Control | Affects | Scope |
|---|---|---|
| Phrase | Long-grid mix start + cue snap | Client (auto mix) |
| Bar | Short-grid mix start + cue snap / fallback | Client (auto mix) |
| Phase lock | Beat alignment during overlap | Client (auto mix) |
| Set arc | Next-track energy / BPM bias | Server |
Related settings (not in this toolbar)
- Xfade → Manual / Auto Xfade — whether fade length is fixed (fader) or driven by waveform analysis. See section 18.
- Next — fade length when pressing Next Track early. See section 18.
- Set Cue — how mix-in points on tracks are detected (works with Phrase/Bar for snap length). See section 18.
- Shock mix — spinback + hard drop on big BPM/genre jumps (under waveforms, auto mode only). See section 8 and /guide/user#shock-mix.
- Deck effects / hot cues — per-deck knobs and C1–C8 cues. See section 20.
- Manual mix mode — Phrase, Bar, and Phase lock are for auto mix; in manual mode you load decks and blend yourself.
Tips
- Start with Phrase 32, Bar 4, Phase lock Medium or High, Set arc Auto for typical club/party sets.
- Raise Phrase if mixes feel too busy; lower it if you want quicker turnover.
- Use Set arc → Warm up at the start of an event or Cool down for last hour — without touching mix timing controls.
12. The MC (host) system
The MC is an optional AI/host voice that speaks between or over tracks.
Generation pipeline
- Prompt — event context, venue, track title, energy, dedication, Mem0 memories (optional).
- Line source — OpenAI (AIDJ_LIVE_AI_MC) and/or script templates (default, hype, smooth, wedding, etc.).
- TTS — ElevenLabs if API key configured; else local pyttsx3.
- Delivery — server sends { type: "mc", text, wav_path, duck_enabled, duck_level } → client plays audioMC.
| Trigger | When |
|---|---|
| intro | Session welcome |
| premix | Before track (if enabled + seconds configured) |
| postmix | Shortly after track starts |
| interval | Every N minutes (mc_interval_min) |
| goodbye | Session end |
| manual | Test button or manual deck intro (manual mix) |
Ducking & settings
While MC speaks, music volume ramps down via gainMusicDuck (default ~30%). On end, music restores and client sends mc_done so the server can continue timing.
- Event prompt, venue name, DJ name
- Enable/disable MC, interval minutes, premix/postmix delay seconds
- Template set vs live AI lines; language, tone, voice
- Dedicate — one-shot shout-out tied to a specific library track
Rapid Next Track presses temporarily disable skip to prevent chaos. MC announcements can delay skip processing so crossfade timing stays musical.
Deep dive into OpenAI prompting, Mem0, ElevenLabs, Event Prompt customization, banned phrases, and troubleshooting.
Read the full MC System guide13. Crowd song requests
Guests on the same Wi‑Fi open the crowd page (default http://<your-LAN-IP>:8767/).
Guest flow
- Enter song search (artist + title) and optional dedication/name.
- Optional PIN (AIDJ_CROWD_REQUEST_PIN).
- Content filters block explicit, commercial, and movie-trailer style queries.
Server processing
- Fuzzy match local library (AIDJ_CROWD_MIN_MATCH_SCORE, default 0.52).
- Optional AI verification for borderline queries.
- If no match → YouTube search + download/stream for crowd.
- Queue in crowd_play_queue or pending approval if AIDJ_CROWD_REQUIRE_APPROVAL=1.
DJ tools: Crowd link and QR in the top bar, approve/reject pending requests, blocklist for repeat bad queries. Crowd tracks show REQUEST badge in library; play with priority after manual queue.
14. AI features
All AI features require OPENAI_API_KEY unless noted. Keys are stored via server config (not logged).
Library AI Search
Natural-language search: "1980s wedding opener", lyric queries, theme/era/mood. Returns matches from your library plus YouTube suggestions. WebSocket: library_ai_search → library_ai_search_result.
AI Set Builder
Plans a full 6–40 track set from a prompt with energy flow (warmup → build → peak → cooldown), BPM/key smoothing, and marks library vs YouTube import needs. WebSocket: ai_set_builder → ai_set_builder_result.
Genre detection & MC
- Genre: ID3 tags → heuristics → AI detect (OpenAI) → manual override
- MC lines: OpenAI + optional Mem0 for venue-specific memories
- ElevenLabs v3 emotional tags optional for richer TTS
15. Client ↔ server communication
URL: ws://127.0.0.1:8765 (configurable via AIDJ_WS_PORT). On connect: license status, API config, energy arc, mix control mode, MC context. Reconnect with exponential backoff if server restarts.
Important client → server messages
| Message | Purpose |
|---|---|
| start / pause / stop | Session transport |
| cmd + skip | Next track (auto) |
| mix_control_mode | Auto vs manual |
| get_library / set_music_dir | Library sync |
| yt_add / yt_playlist_resolve / yt_playlist_load | YouTube |
| set_starting_track / queue_next | DJ overrides |
| set_energy_arc / energy | Set arc + crowd energy |
| library_ai_search / ai_set_builder | AI tools |
| analyze_track / analyze_missing_bpm / start_analysis_queue | Analysis |
| mc_context / mc_advanced / mc_dedication_set | MC settings |
| crowd_request_action / crowd_blocklist_add | Crowd moderation |
| manual_live_track | Manual mode: tell server what's live |
| fade_complete / mc_done | Client acknowledgements |
Important server → client messages
| Message | Purpose |
|---|---|
| library / library_update | Full or partial library sync |
| incoming | Load and mix next track (auto) |
| next_track | Preview of upcoming pick |
| mc | Host audio + ducking params |
| pause_ack / stop_ack / fade_out | Session control |
| yt_import_progress / playlist_preload_* | YouTube pipeline status |
| library_ai_search_result / ai_set_builder_result | AI responses |
| crowd_queue / crowd_request_ack | Crowd UI |
| log | Live log ticker |
| license_status / license_required | Licensing |
Many operations are license-gated (start, library load, YouTube, AI search, set builder, etc.). Set LICENSE_DISABLE=1 in dev config to bypass. Max WebSocket frame size: 32 MiB (large libraries with embedded art).
16. Configuration reference
Config merges: environment variables → user aidj_config.json → bundled aidj_config.json.
Core
| Variable | Default | Meaning |
|---|---|---|
| AIDJ_WS_PORT | 8765 | WebSocket |
| AIDJ_HTTP_PORT | 8766 | File/stream HTTP |
| AIDJ_CROWD_HTTP_PORT | 8767 | Crowd form |
| AIDJ_MUSIC_DIR | (see §2) | Library root |
| AIDJ_OVERLAP_SEC | 8 | Overlap hint for track timing |
| AIDJ_STOP_FADE_SEC | 8 | End-of-session fade |
Selection / energy
| Variable | Default | Meaning |
|---|---|---|
| AIDJ_SMART_SELECTION | 1 | Enable smart next-track scoring |
| AIDJ_BPM_TOL | 6 | BPM match tolerance |
| AIDJ_REQUIRE_KEY_MATCH | 0 | Hard-filter incompatible keys |
| AIDJ_REQUIRE_GENRE_MATCH | 0 | Hard-filter genre mismatches |
| AIDJ_AVOID_RECENT | 5 | Recent track memory |
| AIDJ_ENERGY_CURVE | 1 | Energy phase BPM biasing |
| AIDJ_ENERGY_BUILD | 3 | Tracks in build phase |
| AIDJ_ENERGY_PEAK | 5 | Tracks in peak phase |
YouTube / preload
| Variable | Default | Meaning |
|---|---|---|
| AIDJ_FFMPEG_DIR | auto | FFmpeg + ffprobe for yt-dlp |
| AIDJ_PRELOAD_CONCURRENCY | 4 | Parallel metadata preload threads |
| AIDJ_PRELOAD_AI_GENRE | (see config) | AI genre during playlist preload |
Crowd
| Variable | Default | Meaning |
|---|---|---|
| AIDJ_CROWD_HTTP | 1 | Enable crowd server |
| AIDJ_CROWD_REQUEST_PIN | — | Optional guest PIN |
| AIDJ_CROWD_REQUIRE_APPROVAL | 0 | Hold requests for DJ approve |
| AIDJ_CROWD_MIN_MATCH_SCORE | 0.52 | Library fuzzy match threshold |
| AIDJ_CROWD_BLOCK_EXPLICIT | 1 | Block explicit YouTube imports |
| AIDJ_CROWD_BLOCK_COMMERCIAL | 1 | Block ad-like content |
| AIDJ_CROWD_BLOCK_MOVIE | 1 | Block film/trailer content |
AI / voice
| Variable | Meaning |
|---|---|
| OPENAI_API_KEY | Library search, set builder, genre, MC |
| ELEVEN_API_KEY / ELEVEN_VOICE_ID | MC TTS voice |
| AIDJ_LIVE_AI_MC | Enable live AI MC lines |
| AIDJ_LLM_MODEL | OpenAI model (e.g. gpt-4o-mini) |
Client-only (localStorage)
| Key | Meaning |
|---|---|
| mixControlMode | auto / manual |
| aidj_mix_phrase_beats | Phrase length (16–64) |
| aidj_mix_bar_beats | Bar length (4 or 8) |
| aidj_phase_lock_strength | Phase lock 0–3 |
| aidj_auto_shock_transition | Shock mix enabled |
| aidj_shock_mix_trigger | Shock mix trigger: both / bpm / genre |
| AIDJ_SETUP_COMPLETE | Setup wizard done |
17. License and troubleshooting
License
Online validation (Gumroad / Paddle / FastSpring / generic REST) + offline crypto + trusted keys. UI modals for activation; periodic re-check (~12h). Dev bypass: LICENSE_DISABLE=1 in config.
Common issues
| Symptom | Check |
|---|---|
| WebSocket error / 1006 | Is aidj_server.py running on 8765? |
| No audio from YouTube | FFmpeg path (AIDJ_FFMPEG_DIR), yt-dlp, server console errors |
| ffprobe Win32 error | Broken ffprobe on PATH; use bundled electron_mock/resources/ffmpeg |
| Crowd page unreachable | Firewall, same Wi‑Fi, correct LAN IP, port 8767 |
| Library always loading | Server connected? IndexedDB cache should show tracks while syncing |
| Resume plays wrong track | Server pause clock fix — restart server after updates |
| MC silent | ElevenLabs quota/key, or pyttsx3 fallback on system |
Logs
- Packaged: %APPDATA%\AI_DJ_Demo_Pro\aidj-server.log
- Dev: terminal running python aidj_server.py
- Client: in-app log panel + browser DevTools console
18. Xfade, Next, and Set Cue faders
Three vertical faders sit in the session control bar (beside Master volume), each with an optional mode dropdown. They control when the outgoing track fades, how long the blend lasts, and where the incoming track starts — all on the client in auto mix mode.
In manual mix mode, these faders are disabled (dimmed). You load decks yourself and blend with the horizontal crossfader instead.
Where they live
Session bar (auto mix) ├── Master volume ├── Xfade fader + Manual / Auto Xfade dropdown ├── Next fader (no dropdown) └── Set Cue fader + Manual / Auto Cue / Drop / Chorus dropdown
Each fader has an LED strip that lights segments proportionally to the current value (2–30s range for Xfade and Next; 1–30s for Set Cue in manual mode).
Overview — what each control does
| Control | Used when | Controls |
|---|---|---|
| Xfade | Track plays out naturally to the mix point | Fade start (Auto Xfade) and fade length (Manual) for end-of-track transitions |
| Next | You press Next Track | Fade length for an early skip (Manual Xfade only) |
| Set Cue | Every incoming track load | Mix-in point — where the new track begins on the deck |
Xfade fader
UI: vertical slider 2–30 seconds (default 8s) + dropdown Manual / Auto Xfade.
- Manual (default): fader sets fixed crossfade length. Fade starts at effective track end − fade length (trailing silence ignored). Orange Fade marker on live deck waveform.
- Auto Xfade: fader disabled. Analyzer finds where energy drops in the tail. Label shows fade start time and duration, e.g. 3:42 · 12s. Deck time counts down to fade instead of to mix.
- Applies to automatic transitions — not directly when you press Next Track (that uses the Next fader).
- Saved in localStorage (xfadeMode for dropdown). Fader position is session UI state (default 8s on load).
Next fader
UI: vertical slider 2–30 seconds (default 8s). Label reads Next 8s or Next Auto. Controls fade timing when you press Next Track before the song would naturally mix out.
| Xfade mode | Next fader | Behavior on Next Track |
|---|---|---|
| Manual | Active — sets skip fade length | Crossfade starts immediately (no phrase wait) using Next seconds |
| Auto Xfade | Disabled — label Next Auto | Uses waveform-based fade logic, triggered now instead of at the tail |
| Xfade | Next | |
|---|---|---|
| Trigger | Automatic at end-of-track fade point | Next Track button (or server skip) |
| Beat alignment | Waits for Phrase/Bar boundary when possible | Immediate — skips phrase wait (quickFade) |
| Fade length source (Manual) | Xfade fader | Next fader |
Tip: Use a shorter Next (e.g. 4–6s) for quick DJ-style skips; use a longer Xfade (e.g. 12–16s) for smooth end-of-track blends.
Set Cue fader
| Mode | Mix-in detection |
|---|---|
| Manual | You set seconds from track start (fader 1–30s) |
| Auto Cue | General structural mix point from waveform |
| Drop | Emphasis on drop / impact |
| Chorus | Emphasis on chorus / lift |
- Manual: incoming tracks start at that offset (e.g. 1s skips silence; 32s jumps to a breakdown).
- Auto/Drop/Chorus: mix-in from server waveform analysis, aligned to outgoing fade using current Xfade length, snapped to Phrase or Bar grid.
- First track of a session always plays from 0:00 (no cue skip on the opener).
- Live deck: orange Fade line. Incoming deck: green Mix line.
- Auto modes need waveform data — run Analyze missing BPM if label stays …
- Saved in localStorage (cueMode for dropdown).
How the three work together
- Outgoing fade window — Xfade (Manual or Auto) decides when and how long the live track blends out.
- Incoming entry point — Set Cue decides where the next track starts.
- Alignment — In auto cue modes, Set Cue is shifted so the incoming mix point matches the outgoing fade window.
- Grid snap — Phrase and Bar (section 11) refine when the crossfade starts and where the cue lands.
- Phase lock — keeps beats aligned during the overlap (separate control).
End-to-end: natural mix vs Next Track
Natural mix: Live deck → fade trigger (Xfade) → client skip → server incoming → load other deck at Set Cue → beat-aligned crossfade → new live deck Next Track (early skip): Next Track pressed → server incoming immediately → quickFade=true → Next fader length (Manual) or Auto Xfade → crossfade starts now (no phrase wait)
The server's playback timer (AIDJ_OVERLAP_SEC, default 8s) is a rough overlap hint for when to send the next incoming after a transition; the client faders govern the actual audible blend.
Quick reference
| Control | Fader range | Dropdown | Active when |
|---|---|---|---|
| Xfade | 2–30s | Manual / Auto Xfade | Fader active in Manual only; auto mix |
| Next | 2–30s | — | Fader active when Manual Xfade; auto mix |
| Set Cue | 1–30s | Manual / Auto / Drop / Chorus | Fader active in Manual only; auto mix |
| Mode combo | Typical use |
|---|---|
| Manual Xfade + Auto Cue | Fixed fade length; smart mix-in points |
| Auto Xfade + Auto Cue | Fully waveform-driven transitions (recommended after analysis) |
| Manual Xfade + Manual Set Cue | Full manual timing — predictable, repeatable |
| Any + Manual mix | Faders disabled — use deck crossfader |
19. Stem separation (Demucs)
AI DJ can split local tracks into four stems using Demucs htdemucs (vocals, drums, bass, other).
Architecture
- aidj-stems (Windows: aidj-stems.exe; macOS: aidj-stems binary) — bundled worker (PyTorch + Demucs + NumPy). Runs as a subprocess only; the main server never imports torch.
- Cache — per-user folder with four WAV files + meta.json per track hash: %AppData%\AI_DJ_Demo_Pro\stems\<hash>\ (Windows) or ~/Library/Application Support/AI_DJ_Demo_Pro/stems/<hash>/ (macOS).
- HTTP — stems stream at http://127.0.0.1:8766/stems/<cache_key>/<role>.wav.
- Queue — one separation job at a time (CPU/GPU heavy).
Both Windows and macOS installers bundle the stem worker when the PyInstaller build step succeeds (build-installer.bat / build-installer.sh step [2b/6]).
Using stems on decks
Each deck has V / D / B / O pads, a Full mix / Stems toggle, and a status chip.
- Load a local file (not a YouTube stream).
- Click Separate stems in the library row, or wait for background prepare on load.
- When status shows Stems ready, click Full mix to switch to Stems.
- Click pads to mute; Alt+click to solo a stem.
Waveform and BPM analysis still use the full mix file.
MC ducking with stems
When Stems mode is active on a playing deck, MC volume ducking lowers vocals only on that deck instead of ducking the entire mix.
First run & installer size
- First separation downloads htdemucs weights (~80 MB) into the torch hub cache. CPU works; CUDA or Apple Silicon GPU may be used when available.
- The stem worker adds roughly 1.5–2 GB to the installer (PyTorch + Demucs). Build the worker on the same OS and CPU architecture you ship.
Development (from source)
pip install -r requirements-stems.txt python aidj_server.py
In dev, the server runs stem_worker.py via your Python interpreter instead of the bundled aidj-stems binary.
Stem troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Stems unavailable / worker not found | Stem worker not bundled or build step [2b/6] failed | Rebuild installer; confirm electron_mock/resources/aidj-stems/ exists before electron-builder |
| No module named numpy.core.multiarray | Old stem worker missing NumPy binaries | Rebuild with --collect-all numpy and PyInstaller ≥ 6.14.1 |
| Separation stuck / failed | Missing FFmpeg, corrupt file, or out of disk/RAM | Ensure bundled ffmpeg is present; try a local MP3/WAV; check server log |
| YouTube track | Stems require a decoded local file | Download or use a file from your music folder |
| Very slow | Demucs on CPU | Normal for long tracks; only one job runs at a time |
Plain-language walkthrough for V / D / B / O pads, MC + stems, and common fixes.
Simple User Guide — Stem separation20. Deck effects, hot cues, and manual crossfader
Per-deck performance tools live in the Electron client (renderer.js, EchoEffect.js). They work in auto and manual mix.
Effects signal path
eqMix (post-EQ) ──┬──► dry bus ──► effectsOutput ──► analysers ──► gainMusicDuck
│
└──► parallel wet effects ──► wet mix ──┘Each deck has 12 effect sends in two UI rows plus a separate Filter panel (low/high/band-pass when enabled).
| Knob | Audio behavior |
|---|---|
| Reverb | Convolution reverb (generated impulse) |
| Delay | Feedback delay; D.Time / D.Feedback knobs |
| Flanger | Short modulated delay |
| Phaser | All-pass filter chain |
| Echo | Stereo ping-pong delay (EchoEffect.js) — BPM-synced, damped feedback |
| Spiral | LFO-modulated short delay |
| Slip Roll | Tight looping delay |
| Robot | Ring-mod style timbre |
| Mob Saw | Saw LFO → resonant low-pass |
| Mob Tri | Triangle LFO → band-pass |
Echo (electron_mock/EchoEffect.js): dual delay lines with cross-feedback, high-pass on input, low-pass on feedback and wet path. Delay time maps from dotted-eighth to quarter note using deckABPM / deckBBPM when known.
FX bypass toggle
Round FX buttons (deckFxToggleA / deckFxToggleB) appear under the channel fader when the Effects panel is expanded. They toggle effectsAEnabled / effectsBEnabled — wet gains go to zero while knob values are preserved.
Hot cues
- 8 slots per deck (C1–C8); was 4 in earlier builds.
- Shift+click or Shift+1…8 stores the current playhead.
- Cues persist per track URL in localStorage.
- HOT_CUE_COUNT = 8 in renderer.js.
MIDI
Effect and filter knobs are exposed to the MIDI learn system (same pattern as EQ). Hot cue MIDI actions use deck-specific note/CC mappings.
Plain-language walkthrough for effect knobs, FX bypass, filters, and C1–C8 cues.
Simple User Guide — Deck effects & hot cuesQuick workflows
Party (auto, hands-off)
- Load YouTube playlist or local folder.
- Run Analyze missing BPM if needed.
- Set Set arc → Auto, MC on with event prompt.
- Enable crowd QR.
- Start — let smart selection and crossfades run.
Club segment (manual)
- Switch to manual mix mode.
- Load tracks on Deck A / B from library.
- Blend with crossfader (center = both decks full); use hot cues and deck effects.
- MC intro fires when you play a deck.
Planned wedding set
- AI Set Builder — "wedding cocktail 2h, 90s–today, no explicit".
- Review results, import missing YouTube tracks.
- Load as queue with sequential mode.
- Warm up set arc at start; switch to Peak for dancing.
Still need help?
Contact our support team for licensing, setup, or technical questions.
