@tonaljs/abc-notation
Version:
Parse musical notes in abc notation
52 lines (32 loc) • 1.11 kB
Markdown
# @tonaljs/abc-notation  [](https://www.npmjs.com/package/@tonaljs/abc-notation)
> Convert note names between scientific and abc notation
## Usage
ES6:
```js
import { AbcNotation } from "tonal";
```
nodejs:
```js
const { AbcNotation } = require("tonal");
```
## API
#### `abcToScientificNotation(noteNameInAbc: string) => string`
```js
AbcNotation.abcToScientificNotation("c"); // => "C5"
```
#### `scientificToAbcNotation(noteNameInScientific: string) => string`
```js
AbcNotation.scientificToAbcNotation("C#4"); // => "^C"
```
#### `transpose(note: string, interval: string) => string`
Transpose an note in abc notation:
```js
AbcNotation.transpose("=C", "P19"); // => "g'"
```
#### `distance(from: string, to: string) => string`
Find the interval between two notes in abc notation:
```js
AbcNotation.distance("=C", "g"); // => "12P"
```
## References
- [ABC Notation](https://en.wikipedia.org/wiki/ABC_notation)