note-harmonizer
note-harmonizer
is a module with a function to harmonize notes, create harmonizers (like chords, for example) or get relative intervals from a collection of notes:
var harmonize = // harmonize a note // => ['G2', 'B2', 'D3'] // create an harmonizervar maj7Chord = var // => ['A4', 'C#5', 'E5', 'G#5'] // get relative intervals // => ['P1', 'm3', 'P5', 'm7']
This is part of tonal
Install
Via npm: npm i --save note-harmonizer
Usage
Harmonize notes
You can harmonize notes using a collection of intervals. If the note is a pitch class (a note without octave), the result is a collection of pitch classes:
// => ['C2', 'Eb2', 'G2', 'Bb2', 'D3'] // => ['C', 'Eb', 'G', 'Bb', 'D']
You can harmonize from a list of notes (the first is considered to be the tonic):
// => ['A', 'C#', 'E']var domChord = // => ['D', 'F#', 'G', 'C']
Create harmonizers
Like most tonal functions, it can be partially applied (very useful to create chord-like structures):
var m7 = // => ['C', 'Eb', 'G', 'Bb']
Get intervals
If false
is passed as tonic, you can extract intervals:
// => ['1P', '3m', '5P', '7m']
Filter pitches
Finally, it tonic is null
you get the notes or intervals without transformation:
// => ['C2', 'D4', null, '4P']
License
MIT License