Rites - Musical scales and tunings library
Installation
npm install rites
Example
var scale = ;// The third degree of a major scale with root frequency at low C (65.406Hz),// in the second octave i.e. bass E.scale;
API Documentation
Scales
Scale
degrees tuning=12;
Representation of a generic musical scale. Can be subclassed to produce specific scales.
Parameters:
- degrees -
Number[]
- Array of integer degrees - tuning -
Tuning
- The scale's tuning. Defaults to 12-tone ET.
ritesscaleScaleprototype;
Get the frequency of a note in the scale.
Parameters:
- degree -
Number
- The note's degree. - rootFrequency -
Number
- The root frequency of the scale. - octave -
Number
- The octave of the note.
Returns:
Number
- The frequency of the note in hz.
Major
;
Major scale.
Extends:
rites.scale.Scale
Major
;
Representation of a generic musical tuning. Can be subclassed to produce specific tunings.
Tunings
Tuning
semitones octaveRatio=2;
Parameters:
- semitones -
Number[]
- Array of semitone values for the tuning. - octaveRatio -
Number
- Frequency ratio for notes an octave apart.
EqualTemperamentTuning
pitchesPerOctave;
Extends:
rites.scale.Scale
Parameters:
- pitchesPerOctave -
Number
The number of notes in each octave.