Skip to content
A functional music theory library for Javascript
TypeScript JavaScript
Branch: master
Clone or download
danigb Publish
 - @tonaljs/abc-notation@3.2.3
 - @tonaljs/array@3.2.3
 - @tonaljs/chord-dictionary@3.2.3
 - @tonaljs/chord@3.2.3
 - @tonaljs/interval@3.2.3
 - @tonaljs/midi@3.3.1
 - @tonaljs/mode@3.2.3
 - @tonaljs/note@3.2.4
 - @tonaljs/pcset@3.2.3
 - @tonaljs/progression@3.2.3
 - @tonaljs/range@3.2.4
 - @tonaljs/roman-numeral@3.2.3
 - @tonaljs/scale-dictionary@3.2.3
 - @tonaljs/scale@3.2.3
Latest commit 6d44518 Sep 11, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Scale module. Dictionary fixes Jun 28, 2019
packages Publish Sep 11, 2019
.gitignore Scale module. Dictionary fixes Jun 28, 2019
.travis.yml More fixes. Mode now is a Pcset. More FAQ documentation Jun 28, 2019 Use Named. Fix pcset normalized. Small fixes Jun 30, 2019
lerna.json Typescript Jun 27, 2019
package.json Correct types paths at package.json. Fixes #112 Sep 11, 2019
rollup.config.js Move key to external repo. Rename types. New package names Jun 27, 2019
tsconfig.json Typescript Jun 27, 2019
yarn.lock Add ranges back. Fixes #110 (#111) Sep 10, 2019


Build Status

tonal is a music theory library. Contains functions to manipulate tonal elements of music (note, intervals, chords, scales, modes, keys). It deals with abstractions (not actual music or sound).

tonal is implemented in Typescript and published as a collection of npm modules. It uses a functional programing style: all functions are pure, there is no data mutation, and entities are represented by data structures instead of objects.

⚠️ New v3 in Typescript 🎉

New version of tonal is written in Typescript.

Unfortunately, there's a lot of breaking changes. See migrate from v2 to learn about that changes.

🏘 We moved: modules v3 and forward are published in npm namespace. For example: @tonaljs/midi


import { note, interval, transpose, distance } from "@tonaljs/tonal";

note("A4").midi; // => 60
note("a4").freq; // => 440
note("c#2").accidentals; // => '#'
note("x").midi; // => undefined
interval("5P").semitones; // => 7
transpose("C4", "5P"); // => "G4"
distance("C4", "G4"); // => "5P"


The API documentation lives inside file of each module:


Read contributing document for (wip) instructions


This library takes inspiration from other music theory libraries:


MIT License

You can’t perform that action at this time.