# tonal-transpose

> Music note transposition

Latest version **0.69.7** (published 2017-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install tonal-transpose
pnpm add tonal-transpose
yarn add tonal-transpose
bun add tonal-transpose
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.69.7 |
| Published | 2017-07-08 |
| First published | 2016-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | danigb |
| Maintainers | danigb |
| Keywords | note, transpose, numbers, tonal |

## Links

- npm: https://www.npmjs.com/package/tonal-transpose
- npm.io page: https://npm.io/package/tonal-transpose

## Dependencies (1)

- [tonal-pitch](https://npm.io/package/tonal-pitch.md) ^0.69.7

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.69.7 (latest) — 2017-07-08
- 0.60.0 (alpha-1) — 2016-11-15
- 0.69.6 — 2017-05-05
- 0.69.4 — 2017-04-04
- 0.69.3 — 2017-04-04
- 0.69.2 — 2017-04-04
- 0.69.0 — 2017-02-16
- 0.66.0 — 2016-11-20
- 0.65.0 — 2016-11-17
- 0.64.0 — 2016-11-16
- 0.61.0 — 2016-11-16
- 0.50.5 — 2016-07-14
- 0.50.4 — 2016-07-14
- 0.50.3 — 2016-05-07
- 0.50.2 — 2016-05-07

## README

# tonal-transpose [![npm version](https://img.shields.io/npm/v/tonal-transpose.svg)](https://www.npmjs.com/package/tonal-transpose)

[![tonal](https://img.shields.io/badge/tonal-transpose-yellow.svg)](https://www.npmjs.com/browse/keyword/tonal)

`tonal-transpose` is a collection of functions to transpose music notes using note names and interval names. It can be used to add intervals.

This is part of [tonal](https://www.npmjs.com/package/tonal) music theory library.

You can install via npm: `npm i --save tonal-transpose`

## API Reference

<dl>
<dt><a href="#transpose">transpose(a, b)</a> ⇒ <code>String</code> | <code>Pitch</code></dt>
<dd><p>Transpose notes. Can be used to add intervals. At least one of the parameter
is expected to be an interval. If not, it returns null.</p>
</dd>
<dt><a href="#tr">tr()</a></dt>
<dd><p>An alias for <code>transpose</code></p>
</dd>
<dt><a href="#trFifths">trFifths(tonic, number)</a> ⇒ <code>String</code> | <code>Pitch</code></dt>
<dd><p>Transpose a tonic a number of perfect fifths. It can be partially applied.</p>
</dd>
</dl>

<a name="transpose"></a>

## transpose(a, b) ⇒ <code>String</code> &#124; <code>Pitch</code>
Transpose notes. Can be used to add intervals. At least one of the parameter
is expected to be an interval. If not, it returns null.

**Kind**: global function  
**Returns**: <code>String</code> &#124; <code>Pitch</code> - the transposed pitch or null if not valid parameters  

| Param | Type | Description |
| --- | --- | --- |
| a | <code>String</code> &#124; <code>Pitch</code> | a note or interval |
| b | <code>String</code> &#124; <code>Pitch</code> | a note or interavl |

<a name="tr"></a>

## tr()
An alias for `transpose`

**Kind**: global function  
<a name="trFifths"></a>

## trFifths(tonic, number) ⇒ <code>String</code> &#124; <code>Pitch</code>
Transpose a tonic a number of perfect fifths. It can be partially applied.

**Kind**: global function  
**Returns**: <code>String</code> &#124; <code>Pitch</code> - the transposed note  

| Param | Type | Description |
| --- | --- | --- |
| tonic | <code>Pitch</code> &#124; <code>String</code> |  |
| number | <code>Integer</code> | the number of times |

**Example**  
```js
import { trFifths } from 'tonal-transpose'
[0, 1, 2, 3, 4].map(trFifths('C')) // => ['C', 'G', 'D', 'A', 'E']
// or using tonal
tonal.trFifths('G4', 1) // => 'D5'
```

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