# @tonaljs/abc-notation

> Parse musical notes in abc notation

Latest version **4.9.1** (published 2025-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tonaljs/abc-notation
pnpm add @tonaljs/abc-notation
yarn add @tonaljs/abc-notation
bun add @tonaljs/abc-notation
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.9.1 |
| Published | 2025-01-03 |
| First published | 2019-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | danigb@gmail.com |
| Maintainers | danigb |
| Keywords | note, abc, notation, music, theory, @tonaljs |

## Links

- npm: https://www.npmjs.com/package/@tonaljs/abc-notation
- npm.io page: https://npm.io/package/@tonaljs/abc-notation

## Dependencies (2)

- [@tonaljs/pitch-note](https://npm.io/package/@tonaljs/pitch-note.md) 6.1.0
- [@tonaljs/pitch-distance](https://npm.io/package/@tonaljs/pitch-distance.md) 5.0.5

## Recent versions

- 4.9.1 (latest) — 2025-01-03
- 4.9.0 — 2024-07-23
- 4.8.3 — 2024-02-03
- 4.8.2 — 2024-02-03
- 4.8.1 — 2024-01-04
- 4.8.0 — 2022-11-29
- 4.7.3 — 2022-11-29
- 4.7.2 — 2022-11-29
- 4.7.1 — 2022-11-29
- 4.7.0 — 2022-11-28
- 4.6.10 — 2022-11-18
- 4.6.5 — 2021-09-05
- 4.6.2 — 2021-07-12
- 4.5.1 — 2020-11-05
- 4.5.0 — 2020-11-04
- … 10 more at https://npm.io/package/@tonaljs/abc-notation/versions

## README

# @tonaljs/abc-notation ![tonal](https://img.shields.io/badge/@tonaljs-abc_notation-yellow.svg?style=flat-square) [![npm version](https://img.shields.io/npm/v/@tonaljs/abc-notation.svg?style=flat-square)](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)

---
_Source: https://npm.io/package/@tonaljs/abc-notation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
