The ScaleTemplate object which defines the scale type that this scale uses.
The root of the scale. Can also take pitch names, see the pitch method for more information.
How many pitches are in the scale.
The name of the scale
The pitches which make up the scale, ordered ascending by scale degree from the scale's root, with each pitch within the range 0 - 11.
For example, the pitches collection for F major would be: [5, 7, 9, 10, 0, 2, 4]
The root pitch of the scale.
The template which the scale is built from.
Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.
Returns true if the passed in pitch belongs to the scale. Can also take pitch names, see the pitch method for more information.
For example:
cMajor.contains(7) //returns true
cMajor.contains('Db7') //returns false
cMajor.contains('A8') //returns true
Returns the scale degree of the passed in pitch, or -1 if it's not contained. Can also take pitch names, see the pitch function for more information.
Returns a pitch near to the passed in pitch, but which should fit better with the notes within the scale.
Returns a new pitch number.
The pitch which we want to fit to the scale. Can also take pitch names, see the pitch method for more information.
Optional
options: Partial<FitPitchOptions>The options allow us to configure how we want the pitch to be fitted to the scale.
Returns a new Scale object that is parallel to the current scale.
For example, eMinor.getRelativeScale(shimi.ScaleTemplate.dorian)
would return an E dorian scale.
The template which we want the parallel scale to be of. If the calling scale already has that template, then the method just returns the calling scale object.
The degree method accepts a numerical scale degree, and returns the numerical pitch value which it corresponds to.
The degree of the scale to fetch. This starts counting from root = 1.
If degree is greater than scale.length, then how much higher it is will determine how many octaves it shifts up in its search. For example:
cMajor.degree(3, 2) //returns 40
cMajor.degree(10, 2) //returns 52
cMajor.degree(17, 2) //returns 64
Similarly, if degree is less than 1, then how much lower it is will determine how many octaves it shifts down in its search.
The octave of the scale root, which the returned pitch is calculated in relation to.
Takes a numerical pitch value and returns a string representation of that pitch, that makes sense relative to the scale.
For example:
cMajor.getPitchName(7) //returns 'G'
cMajor.getPitchName('E') //returns 'E'
cMinor.getPitchName('E') //returns 'E♮'
The pitch to get the string representation of. Can also take pitch names, see the pitch method for more information.
Whether to show a number after the name showing which octave we're in.
Returns a new Scale object that is relative to the current scale, according to how the template.relativityToMajor properties have been set up.
For example, eMinor.getRelativeScale(shimi.ScaleTemplate.dorian)
would return an A dorian scale.
The template which we want the relative scale to be of. If the calling scale already has that template, then the method just returns the calling scale object.
The pitchesInRange method takes 2 numerical values, and returns all scale pitches which exist within that range. The search is inclusive of the passed in pitch parameters. Can also take pitch names, see the pitch method for more information.
Note, if lowPitch > highPitch, then rather than throw an error, lowPitch & highPitch are swapped in their roles.
The low pitch to compare against.
The high pitch to compare against.
Generated using TypeDoc
The Scale class defines the collection of pitches that make up a specific scale.