# @tonaljs/pitch-note

> Parse intervals in shorthand notation

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

## Install

```sh
npm install @tonaljs/pitch-note
pnpm add @tonaljs/pitch-note
yarn add @tonaljs/pitch-note
bun add @tonaljs/pitch-note
```

## 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 | 6.1.0 |
| Published | 2025-01-03 |
| First published | 2023-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 23.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | danigb@gmail.com |
| Maintainers | danigb |
| Keywords | note, music, theory, interval, shorthand notation |

## Links

- npm: https://www.npmjs.com/package/@tonaljs/pitch-note
- npm.io page: https://npm.io/package/@tonaljs/pitch-note

## Dependencies (1)

- [@tonaljs/pitch](https://npm.io/package/@tonaljs/pitch.md) 5.0.2

## Recent versions

- 6.1.0 (latest) — 2025-01-03
- 6.0.0 — 2024-02-03
- 5.0.3 — 2024-02-03
- 5.0.1 — 2024-01-04
- 5.0.0 — 2023-11-29

## README

# @tonaljs/pitch-note ![tonal](https://img.shields.io/badge/@tonaljs-pitch_note-yellow.svg?style=flat-square) [![npm version](https://img.shields.io/npm/v/@tonaljs/pitch-note.svg?style=flat-square)](https://www.npmjs.com/package/@tonaljs/pitch-note)

> Pitch note support

## Usage

⚠️ It's probably you don't need to use this package directly. Use [tonal-note](/packages/note) instead.

```js
import { note } from "@tonaljs/pitch-note";

note("c4"); // => { name: 'C4', oct: 4, ...}
```

## API

### `note(name: string) => Note`

Given a note name, it returns an object with the following properties:

- name: the note name
- pc: the pitch class name
- letter: the note letter
- step: the letter number (0..6)
- acc: the note accidentals
- alt: the accidental number (..., -1 = 'b', 0 = '', 1 = '#', ...)
- oct: the octave (or null if not present)
- chroma: the note chroma (0..11)
- midi: the note midi or null if octave is not present
- freq: the note frequency in Hertzes, or null if the octave is note present

Example:

```js
note("ab4");
// =>
// {
//   name: "Ab4",
//   pc: "Ab",
//   letter: "A",
//   acc: "b",
//   step: 5,
//   alt: -1,
//   oct: 4,
//   chroma: 8,
//   midi: 68,
//   freq: 415.3046975799451,
// }
```

This function always returns an object:

```js
note("hello"); // => { empty: true, name: "" }
```

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