# tonaljs/tonal

A music theory library for Javascript

Repository: https://github.com/tonaljs/tonal
Canonical: https://ross.abutalabs.com/products/tonal
Homepage: https://tonaljs.github.io/tonal/docs
Language: TypeScript
License Family: other
Topics: music-theory, javascript, music, functional, scale, chords, key-signatures, interval, transpose, chord-progression, typescript
Last push: 2026-07-28T04:06:59+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 35, longevity 100
- inputs: {"age_days": 4065, "days_push": 36, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4223, forks 252 (observed 2026-08-28T04:08:39.336853+00:00)

## What it is
Tonal is a TypeScript music theory library for JavaScript that provides pure functions to manipulate notes, intervals, chords, scales, modes, and keys. It deals with musical abstractions rather than actual sound, and is published as a collection of modular npm packages usable in Node or the browser.

## Use cases
- convert note names to midi numbers and frequencies
- transpose notes and chords by intervals
- get the notes of a scale or chord
- detect or name chords from note collections
- compute chord inversions and scale degrees
- work with key signatures, modes, and roman numeral progressions
- parse ABC notation in a web app

## When to choose
- you need music theory calculations (notes, chords, scales, keys) in JavaScript or TypeScript
- you want a small, modular, dependency-free library with a functional API
- you're building a music education tool, chord app, or theory-based generator in the browser or Node

## When to avoid
- you need audio playback, synthesis, or sound generation - Tonal handles abstractions only
- you need real-time MIDI hardware I/O or DAW integration
- you need notation engraving or score rendering

## Facets
- artifact type: library
- maturity: stable
- function: parser, serialization, developer-tools
- domain: audio, web-development, frontend, education
- platform: browser, cross-platform
- tags: music-theory, chords, scales, intervals, transposition, typescript, functional-programming, midi, key-signatures, chord-progressions, nodejs, web-server

## Member repositories
- tonaljs/tonal (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:39.336853+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:23.378973+00:00, confidence not recorded.
  - readme: https://github.com/tonaljs/tonal (fetched 2026-08-28T04:08:39.336853+00:00, sha 9d4958db1a15)
  - homepage: https://tonaljs.github.io/tonal/docs (fetched 2026-08-29T09:12:35.518589+00:00, sha 093e520312f1)
  - registry_npm: https://registry.npmjs.org/tonal (fetched 2026-08-29T09:12:35.521014+00:00, sha 80d6660727f2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
