@tonaljs/abc-notation

Parse musical notes in abc notation

Usage no npm install needed!

<script type="module">
  import tonaljsAbcNotation from 'https://cdn.skypack.dev/@tonaljs/abc-notation';
</script>

README

@tonaljs/abc-notation tonal npm version

Convert note names between scientific and abc notation

Usage

ES6:

import { AbcNotation } from "@tonaljs/tonal";

nodejs:

const { AbcNotation } = require("@tonaljs/tonal");

API

abcToScientificNotation(noteNameInAbc: string) => string

AbcNotation.abcToScientificNotation("c"); // => "C5"

scientificToAbcNotation(noteNameInScientific: string) => string

AbcNotation.scientificToAbcNotation("C#4"); // => "^C"

transpose(note: string, interval: string) => string

Transpose an note in abc notation:

AbcNotation.transpose("=C", "P19"); // => "g'"

distance(from: string, to: string) => string

Find the interval between two notes in abc notation:

AbcNotation.distance("=C", "g"); // => "12P"

References