Skip to content
/ tonal Public
forked from tonaljs/tonal

A functional music theory library for Javascript

Notifications You must be signed in to change notification settings

hyvyys/tonal

 
 

Repository files navigation

tonal

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

Example

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"

Documentation

The API documentation lives inside README.md file of each module:

Contributing

Read contributing document for (wip) instructions

Inspiration

This library takes inspiration from other music theory libraries:

License

MIT License

About

A functional music theory library for Javascript

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.9%
  • JavaScript 1.1%