tonal-transpose
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 music theory library.
You can install via npm: npm i --save tonal-transpose
API Reference
- transpose(a, b) ⇒
String
|Pitch
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.
- tr()
An alias for
transpose
- trFifths(tonic, number) ⇒
String
|Pitch
Transpose a tonic a number of perfect fifths. It can be partially applied.
String
| Pitch
transpose(a, b) ⇒ 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: String
| Pitch
- the transposed pitch or null if not valid parameters
Param | Type | Description |
---|---|---|
a | String | Pitch |
a note or interval |
b | String | Pitch |
a note or interavl |
tr()
An alias for transpose
String
| Pitch
trFifths(tonic, number) ⇒ Transpose a tonic a number of perfect fifths. It can be partially applied.
Kind: global function
Returns: String
| Pitch
- the transposed note
Param | Type | Description |
---|---|---|
tonic | Pitch | String |
|
number | Integer |
the number of times |
Example
0 1 2 3 4 // => ['C', 'G', 'D', 'A', 'E']// or using tonaltonal // => 'D5'