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

@pepperhorn/chordl-listen

v0.1.0

Published

Live microphone chord identification — chroma template matching that hands pitch sets to chordl's resolver

Readme

@pepperhorn/chordl-listen

Live microphone chord identification. Turns mic input into a stream of stable chord symbols, which are handed to chordl's resolver for spelling — this package never invents chord names itself.

Pipeline

mic ─▶ AnalyserNode FFT ─▶ chroma (12-bin) ─▶ template match ─▶ stabilizer ─▶ chord symbol ─▶ chordl resolver
  • capture — ChordListener opens the mic via getUserMedia and reads an AnalyserNode FFT each frame.
  • chromaFromSpectrum folds the FFT magnitude spectrum into a 12-bin pitch-class profile. It uses the platform FFT rather than a heavier CQT / Essentia.js dependency; the module is isolated behind a Float32Array → number[12] contract, so a higher-fidelity front-end can be swapped in without touching the matcher.
  • matchChord correlates the chroma against every (root × quality) template by cosine similarity. Many pitch-class sets are genuinely ambiguous (a rootless Am7 and C6 are the same four notes); ties resolve to the simpler / more common quality.
  • ChordStabilizer debounces the per-frame guesses into "chord changed" events — a chord must hold for a few frames before it is emitted, and a held chord fires once, not every frame.
  • toChordSymbol formats a candidate as a chordl chord string ("Dm7").

Usage

import { ChordListener, toChordSymbol } from "@pepperhorn/chordl-listen";

const listener = new ChordListener({
  onChord: (chord) => console.log("heard", toChordSymbol(chord), chord.confidence),
});
await listener.start(); // prompts for mic permission
// ...
listener.stop();

The detection/stabilizer/resolve modules are pure and unit-tested; only ChordListener touches Web Audio.

Score follow-along (scaffolded, not yet wired)

SequenceFollower implements forward-only sequence alignment for automatic page turning — matching the live chord stream against a known ExpectedChord[] sequence. It is not beat tracking (no tempo, no beat grid). It is tested in isolation but not yet connected to any UI.

Notes / limitations

  • Single source (one instrument or mic). No polyphonic source separation.
  • Chroma detection is octave- and bass-agnostic, so inversions and slash chords aren't distinguished, and enharmonically-equal voicings (e.g. Am7 vs C6) resolve to the conventional reading.