Zero dependencies
Pure ESM, nothing to install alongside it. Runs in browsers, Node, and Web Workers — no build step, no native modules, no GPU.
Pleco-Xa brings musical intelligence — BPM and beat tracking, spectral features, structural segmentation, effects, pitch tracking, and its signature loop detection — to anything that runs JavaScript. No build step, no dependencies, and it does things an offline library can’t: real-time streaming analysis and intelligent loop-point detection, running live in a browser tab.
import { beat_track, loop } from 'pleco-xa'
// Decode with Web Audio, then hand the samples to the libraryconst ctx = new AudioContext()const audio = await ctx.decodeAudioData(await (await fetch('song.mp3')).arrayBuffer())const y = audio.getChannelData(0)
// Musical timingconst { tempo, beats } = beat_track(y, audio.sampleRate)console.log(`${tempo.toFixed(1)} BPM, ${beats.length} beats`)
// The signature feature — find the best loop pointconst best = await loop.detect(audio, { strategy: 'fast' })console.log(`loop ${best.loopStart.toFixed(2)}s → ${best.loopEnd.toFixed(2)}s`)The analysis API is (Float32Array, sampleRate) everywhere, so the same code
runs in the browser, Node, and Web Workers.
Zero dependencies
Pure ESM, nothing to install alongside it. Runs in browsers, Node, and Web Workers — no build step, no native modules, no GPU.
Loop detection
The signature feature: intelligent loop-point finding with one entry point, four strategies, and a single honest confidence score.
Musical timing
Tempo and beat tracking, onset detection, and tempograms — numerically validated against committed reference fixtures.
Spectral features
STFT, mel spectrograms, MFCC, chroma, and the full family of spectral descriptors (centroid, bandwidth, rolloff, contrast, flatness).
Real-time
Worker-safe streaming analyzers and a live tempo tier — analysis an offline library structurally can’t do.
Pure-DSP vocal separation
Surprisingly capable source separation with no trained model, no weights, and no GPU. It runs in a browser tab.
Ready? Install and run your first analysis → or watch every example run live on your own audio in the gallery.