Repository navigation
Audio Analysis and DSP
PulseDeck performs all audio indexing, DSP analysis, and dual-deck playback locally on your machine with zero cloud dependencies.
Whenever new or modified tracks appear in watched folders (and Automatically Analyze New Tracks is enabled in Settings), AnalysisManager processes pending tracks sequentially in a dedicated Web Worker (analyzer.worker.ts) so the UI and audio playback stay smooth:
-
Streaming & Decode: Fetches audio cleanly from main-process
media://track/<id>(supporting HTTP206byte ranges) and decodes PCM viaAudioContext.decodeAudioData. -
Mono Downmix & Resampling: Mixes multi-channel audio down to mono and resamples to
22,050 Hzusing box-averaged pre-filtering when downsampling to suppress aliasing. -
200-Bar Waveform Peaks: Computes peak amplitude across
200slices normalized to[0..1], driving both the bottom PlayerBar scrubber and the Dual-Deck waveforms. -
Intro & Outro Silence Cues: Scans start and end RMS envelopes (
25 mswindows) to mark smartintroCueSecandoutroCueSecboundaries so Auto-Mix avoids dead silence at track edges. -
Gated Loudness (ReplayGain) & Energy Score:
- Computes integrated active loudness over
400 msoverlapping blocks with-60 dBFSabsolute and-10 dBrelative gating. - Derives
replaygainDbtargeting-14 dBFS(clamped within-12 dB .. +12 dB). - Combines active loudness (
72%) and short-window25 mstransient dynamic punch (28%) into a0..1Energy score.
- Computes integrated active loudness over
- BPM Detection: Uses spectral flux / onset strength with autocorrelation and comb-filter tempo refinement (preserving existing embedded BPM tags when already valid, unless re-analyzed).
-
Musical Key & Camelot Wheel Mapping (
1A–12B): Computes a12-bin chromagram via in-place Radix-2 FFT across Hann-windowed frames and correlates pitch-class profiles against Krumhansl-Schmuckler major & minor templates (CthroughB), mapping the result to DJ Camelot notation (1A–12B).
All computed fields are persisted back to SQLite (library.db) and preserved across untouched rescans.
Both Deck A and Deck B have dedicated Web Audio DSP chains inside DualDeckEngine.ts feeding a shared master bus:
[ Deck A AudioBufferSourceNode ] [ Deck B AudioBufferSourceNode ]
│ │
▼ ▼
LowShelf EQ (250 Hz) LowShelf EQ (250 Hz)
│ │
▼ ▼
Peaking EQ (1,000 Hz) Peaking EQ (1,000 Hz)
│ │
▼ ▼
HighShelf EQ (4,000 Hz) HighShelf EQ (4,000 Hz)
│ │
▼ ▼
Color Filter (LPF / Bypass / HPF) Color Filter (LPF / Bypass / HPF)
│ │
▼ ▼
ReplayGain Trim GainNode ReplayGain Trim GainNode
│ │
▼ ▼
Channel Volume GainNode Channel Volume GainNode
│ │
▼ ▼
Crossfade GainNode Crossfade GainNode
└───────────────────────────┬───────────────────────────┘
▼
Master GainNode
│
▼
DynamicsCompressor Safety Limiter
│
▼
AnalyserNode (Spectrum Visualizer)
│
▼
AudioContext.destination
- Master Safety Limiter: Prevents clipping when two loud tracks overlap or EQ/filters are boosted; toggleable in Settings → Audio Output & DSP.
- ReplayGain Normalization: Balances perceived volume across older and modern mastered tracks automatically; toggleable live during playback.
-
Click-Free Parameter Scheduling: Uses
cancelAndHoldAtTime+ smoothlinearRampToValueAtTime/ 64-point float curves to avoid audio pops on crossfades, manual seeks, EQ changes, and filter sweeps. -
AudioBuffer Lifecycle Cleanup: Releases completed
AudioBufferSourceNodeinstances and stale buffers immediately once a deck finishes or transitions.
PulseDeck enforces Electron security hardening (contextIsolation: true, nodeIntegration: false, sandbox: true, webSecurity: true) and never exposes arbitrary filesystem paths to the renderer. Instead, a custom media:// protocol handles:
-
media://track/<id>— Validates the track ID in SQLite, restricts streaming strictly to active indexed audio files, sets accurate audio MIME types, and handles HTTP206 Partial Contentbyte-range requests. -
media://artwork/<filename>— Confines access strictly insideuserData/artwork/to block path traversal.
PulseDeck v1.3.0 · Repository · Releases · Report an Issue · MIT License
Getting Started
Mixing & Audio
Tags & Lyrics
Customization & Help