API / MusicTheory
Scale record
A scale on a tonic. Notes are spelled from the tonic by interval, so F# major has E# and Gb major has Cb.
Every scale's notes run from the tonic to the tonic an octave above, both included.
Constructors
Scale(Note root, ScaleType type)Creates a scale.
Throws ArgumentNullException root is null.
Throws ArgumentOutOfRangeException type is undefined.
Properties
Note Root { get; }The tonic.
ScaleType Type { get; }The scale type.
IReadOnlyList<Interval> Intervals { get; }The intervals above the tonic, from P1 to P8.
Methods
bool Contains(Note note)True when the scale contains a note with this spelling (any octave).
int? GetDegree(Note note)The 1-based degree of a note with this spelling (any octave), or null when absent.
IReadOnlyList<Scale> GetModes()The scale's modes, one per degree: index i starts on degree i + 1. Index 0 is this scale.
Throws InvalidOperationException The type is not in a heptatonic mode family.
Note GetNextNoteInScale(Note note)The scale note after
note, in the right octave: in C major, B4 is followed by C5. The octave of note is free; only its spelling must belong to the scale.Throws ArgumentException The note is not in the scale.
IEnumerable<Note> GetNotes()The notes from the tonic to its octave, both included: C major is C4 D4 E4 F4 G4 A4 B4 C5.
Throws InvalidOperationException A degree needs more than two accidentals (B## major).
string ToString()The scale as
C4 Major.Scale Transpose(Interval interval)The same scale on a tonic transposed by
interval.