npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pleco-xa

v2.0.5

Published

Browser-native audio analysis engine: musical timing, BPM/beat tracking, spectral features, and intelligent loop detection

Downloads

250

Readme

npm version min+gzip ~89 kB zero dependencies types included license: MIT

Browser-native audio analysis for JavaScript — BPM & beat tracking, spectral features, structural segmentation, and intelligent loop detection. Zero dependencies. TypeScript declarations included.

pleco-xa brings musical intelligence to anything that runs JavaScript — the browser, Node, Web Workers, the edge. Tempo and beat tracking; mel / MFCC / chroma / spectral descriptors; structural segmentation; DTW & sequence alignment; effects; pitch tracking; pure-DSP vocal separation; and its signature loop detection — with zero runtime dependencies and no build step required. 47 CI-gated test suites (420 tests) run on every PR and push to main, with loop detection locked against committed golden fixtures on real audio.

Install

npm install pleco-xa

Two ways to import

The barrel — everything, tree-shakeable:

import { beat_track, loop, stft, feature } from 'pleco-xa'

Per-namespace subpaths — pull only the domain you need:

import { mfcc, chroma_stft, spectral_centroid } from 'pleco-xa/feature'
import { detect } from 'pleco-xa/loop'
import { hz_to_note, hz_to_midi } from 'pleco-xa/convert'
import { dtw, viterbi } from 'pleco-xa/sequence'

TypeScript declarations ship for the barrel and all 19 subpaths — editor autocomplete works out of the box, no @types/… package needed.

Quickstart

import { beat_track, loop } from 'pleco-xa'

const ctx = new AudioContext()
const audio = await ctx.decodeAudioData(await (await fetch('song.mp3')).arrayBuffer())
const y = audio.getChannelData(0)

const { tempo, beats } = beat_track(y, audio.sampleRate)
const best = await loop.detect(audio, { strategy: 'fast' })
console.log(tempo, best.loopStart, best.loopEnd)

In Node, decode a WAV with the built-in decodeWav and call the same functions — the analysis API is (Float32Array, sampleRate) everywhere.

Subpaths

| Import from | What it gives you | | --- | --- | | pleco-xa/feature | mfcc, chroma, melspectrogram, spectral centroid / bandwidth / rolloff / contrast / flatness, rms, zcr | | pleco-xa/loop | loop detection — one entry point, four strategies, one honest confidence | | pleco-xa/convert | hz ↔ midi ↔ note, time ↔ frames ↔ samples, hz ↔ mel, amplitude ↔ dB | | pleco-xa/segment | recurrence matrix, agglomerative & Laplacian segmentation | | pleco-xa/sequence | DTW, Viterbi, RQA, event/interval matching | | pleco-xa/decompose | HPSS, nn_filter, softmask, fingerprint vocal separation | | pleco-xa/effects | time-stretch, pitch-shift, remix, trim, split | | pleco-xa/filters | mel & chroma filter banks | | pleco-xa/bpm | tempo engine | | pleco-xa/notation | note / key / interval / svara notation | | pleco-xa/recurrence · pleco-xa/linalg · pleco-xa/cluster · pleco-xa/intervals · pleco-xa/playback · pleco-xa/audioio · pleco-xa/file · pleco-xa/fileio · pleco-xa/io | recurrence, eigensolvers, k-means, interval theory, playback controllers, codecs, streaming readers, WAV I/O |

Highlights

  • Zero dependencies, pure ESM — runs in browsers, Node, and Web Workers.
  • ~89 kB min+gzip for the entire engine — the feature subpath alone under 8 kB. No WASM, no model download.
  • TypeScript declarations for the barrel and all 19 subpaths.
  • 47 CI-gated test suites (420 tests) — loop points locked against committed golden fixtures on real audio (±10 ms).
  • Loop detection — the signature feature.
  • Real-time streaming analyzers and a live tempo tier.
  • Pure-DSP vocal separation — no model, no weights, no GPU.

For AI agents

A machine-readable capability map ships with this package: llms.txt (package root) — the full function index, per-task routing, contracts, and verified recipes in one skim. The complete guides also ship inside the npm package under docs/. Also served at plecoxa.com/llms.txt.

Documentation

Full guides, a per-function API reference, and an interactive gallery where every one of 50 demos runs live in your browser: plecoxa.com.

License

MIT — created and maintained by Cameron Brooks. See NOTICE for third-party algorithm attributions.