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

jazzify

v1.0.0

Published

A rules-based jazz theory engine for chord identification, key detection, and harmonic analysis

Readme

Jazzify

npm version License: MIT

This is a JavaScript port of lucainiaoge's Jazzify, an open-source rule-based jazzification system.

Jazzify is rule-based. Apart from its capability to serve as an engine of computational jazz music theory, Jazzify is able to accomplish tasks including chord-symbol identification, key detection, chord extension, and chord-to-voicing.

Features

Chord Symbol Identification

Jazzify is able to convert list of pitches into its corresponding jazz chord symbol, in format (root_note, chord_type, bass_note).

Key Detection

Jazzify is able to give the (function, key) guesses for each chord, given a chord progression. For example, given chord progression [C, D, F, G, G-, C7, F], Jazzify is able to output [(T,C), (DD,C), (S,C), (D,C), (S,F), (D,F), (T,F)].

Jazzify takes account of tonic (T), dominant (D), subdominant (S), double-dominant (DD), and Napoleon (N) functions. Other functions like the leading seventh can be converted into the existing categories.

Chord Extension

Jazzify is able to suggest contextually appropriate chord extensions based on harmonic function and key context.

Installation

npm install jazzify

Quick Start

import { identifyChord, detectKey, PitchNames } from 'jazzify';

// Identify a chord from MIDI notes
const chordName = identifyChord([60, 64, 67, 70]);
console.log(chordName); // ["C-dominant-seventh"]

// Identify using pitch names
const notes = PitchNames.listPitchNameToNum(['C4', 'E4', 'G4', 'Bb4']);
console.log(identifyChord(notes)); // ["C-dominant-seventh"]

// Analyze a chord progression (ii-V-I in C major)
const progression = [
  [62, 65, 69],      // Dm
  [67, 71, 74, 77],  // G7
  [60, 64, 67]       // C
];
const analysis = detectKey(progression);
console.log(analysis.keys);      // ["C-Major", "C-Major", "C-Major"]
console.log(analysis.functions); // ["subdominant", "dominant", "tonic"]

API Reference

Chord Identification

identifyChord(notes)

Identify a chord from an array of MIDI note numbers.

import { identifyChord } from 'jazzify';

identifyChord([60, 64, 67]);           // ["C-Major"]
identifyChord([60, 63, 67]);           // ["C-Minor"]
identifyChord([60, 64, 67, 71]);       // ["C-Major-seventh"]
identifyChord([60, 64, 67, 70]);       // ["C-dominant-seventh"]
identifyChord([60, 63, 66]);           // ["C-diminished"]
identifyChord([60, 64, 68]);           // ["C-augmented"]

notesToChordSymbol(notes, detectInversion, listAll, returnMidiNum)

Get detailed chord analysis with root, quality, and bass.

import { notesToChordSymbol } from 'jazzify';

// Basic usage
const result = notesToChordSymbol([60, 64, 67]);
// [{ root: 60, quality: "Major", bass: null }]

// Detect inversions (E in bass = C/E)
const inverted = notesToChordSymbol([64, 67, 72], true);
// Returns both root position and inversion interpretations

Key Detection

detectKey(chordProgression)

Analyze a chord progression to determine keys and harmonic functions.

import { detectKey } from 'jazzify';

// Analyze a ii-V-I-IV progression
const chords = [
  [62, 65, 69],     // Dm
  [67, 71, 74],     // G
  [60, 64, 67],     // C
  [65, 69, 72]      // F
];

const analysis = detectKey(chords);
console.log(analysis.functions); // ["subdominant", "dominant", "tonic", "subdominant"]
console.log(analysis.keys);      // ["C-Major", "C-Major", "C-Major", "C-Major"]

Chord Extensions

getExtensions(chordType, chordRoot, key)

Get contextually appropriate chord extensions based on harmonic context.

import { getExtensions, ChordSymbols } from 'jazzify';

// Get extensions for a ii chord (Dm) in C major
getExtensions(ChordSymbols.MINOR, 2, 0);  // ["Minor-ninth"]

// Get extensions for a V chord (G) in C major
getExtensions(ChordSymbols.MAJOR, 7, 0);  // ["dominant-13th", "dominant-seventh"]

Pitch Utilities

import { PitchNames } from 'jazzify';

// Convert pitch names to MIDI numbers
PitchNames.listPitchNameToNum(['C4', 'E4', 'G4']); // [60, 64, 67]

// Convert MIDI to pitch name
PitchNames.midiToPitchName(60); // "C4"

// Pitch name to MIDI
PitchNames.pitchNameToMidi('C4'); // 60

CLI

Jazzify includes an interactive CLI for chord analysis:

npx jazzify
🎹 Welcome to Jazzify CLI - Jazz Theory Analysis Tool

jazzify > C4 E4 G4
  Notes: C4 E4 G4 (MIDI: 60, 64, 67)
  Chord: C-Major

jazzify > C4 E4 G4 Bb4
  Notes: C4 E4 G4 Bb4 (MIDI: 60, 64, 67, 70)
  Chord: C-dominant-seventh

jazzify > key
  ═══ Key Analysis ═══
  1. C-Major              │ subdominant  │ C-Major
  2. C-dominant-seventh   │ dominant     │ C-Major

Module Exports

Core Modules

  • Intervals - Musical interval constants and utilities
  • PitchNames - Pitch name/MIDI conversion utilities
  • Scales - Scale definitions
  • ChordSymbols - Chord quality constants

Main Functions

  • identifyChord - Simple chord identification
  • notesToChordSymbol - Detailed chord analysis
  • detectKey - Key and harmonic function analysis
  • getExtensions - Context-aware chord extensions

Supported Chord Types

Jazzify recognizes a comprehensive set of jazz chord qualities:

| Category | Chord Types | |----------|-------------| | Major | Major, Major 7th, Major 9th, Major 6th, Major 6/9, Major #11 | | Minor | Minor, Minor 7th, Minor 9th, Minor 6th, Minor 6/9, Minor-Major 7th | | Dominant | Dominant 7th, Dominant 9th, Dominant 11th, Dominant 13th, Altered | | Suspended | Sus4, Sus2, Sus 7th, Sus 13th | | Diminished | Diminished, Diminished 7th, Half-diminished 7th | | Augmented | Augmented, Augmented Major 7th |

ESM and CommonJS

Jazzify supports both ES modules and CommonJS:

// ES Modules
import { identifyChord } from 'jazzify';

// CommonJS
const { identifyChord } = require('jazzify');

TypeScript

TypeScript declarations are included for full type support.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Credits

This is a JavaScript port of the original Jazzify Python library created by lucainiaoge. The original system includes additional capabilities such as melody swingification, walking bass generation, and bossa nova style transformation.

JavaScript port by Elijah Melton.

License

MIT