Class ScaleUtilities
Provides useful utilities for working with
Scale.
Inheritance
ScaleUtilities
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class ScaleUtilities
Methods
GetAscendingNotes(Scale, Note)
Gets notes that belong to a musical scale in ascending order starting with the specified
root note.
Declaration
public static IEnumerable<Note> GetAscendingNotes(this Scale scale, Note rootNote)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to get notes of. |
Note |
rootNote |
Note to start a sequence of scale's notes with. |
Returns
Type |
Description |
IEnumerable<Note> |
Notes that belong to the scale in ascending order starting with
the rootNote . |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
scale is null . -
rootNote is null .
|
GetDegree(Scale, ScaleDegree)
Gets
NoteName corresponding to the specified degree of a musical scale.
Declaration
public static NoteName GetDegree(this Scale scale, ScaleDegree degree)
Parameters
Returns
Exceptions
GetDescendingNotes(Scale, Note)
Gets notes that belong to a musical scale in descending order starting with the specified
root note.
Declaration
public static IEnumerable<Note> GetDescendingNotes(this Scale scale, Note rootNote)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to get notes of. |
Note |
rootNote |
Note to start a sequence of scale's notes with. |
Returns
Type |
Description |
IEnumerable<Note> |
Notes that belong to the scale in descending order starting with
the rootNote . |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
scale is null . -
rootNote is null .
|
GetNextNote(Scale, Note)
Gets a note that belongs to a musical scale next to the specified note.
Declaration
public static Note GetNextNote(this Scale scale, Note note)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to get the next note of. |
Note |
note |
Note to get a note next to. |
Returns
Type |
Description |
Note |
A note next to the note that belongs to the
scale . |
Exceptions
GetNotes(Scale)
Gets all MIDI notes that belong to the specified scale.
Declaration
public static IEnumerable<Note> GetNotes(this Scale scale)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to get notes of. |
Returns
Exceptions
GetNotesNames(Scale)
Returns infinite collection of note names that belong to the specified scale.
Declaration
public static IEnumerable<NoteName> GetNotesNames(this Scale scale)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to get note names of. |
Returns
Exceptions
GetPreviousNote(Scale, Note)
Gets a note that belongs to a musical scale previous to the specified note.
Declaration
public static Note GetPreviousNote(this Scale scale, Note note)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to get the previous note of. |
Note |
note |
Note to get a note previous to. |
Returns
Type |
Description |
Note |
A note previous to the note that belongs to the
scale . |
Exceptions
GetStep(Scale, int)
Gets
NoteName corresponding to the specified step of a musical scale.
Declaration
public static NoteName GetStep(this Scale scale, int step)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to get step of. |
int |
step |
Step of the scale. |
Returns
Exceptions
IsNoteInScale(Scale, Note)
Checks if the specified note belongs to a scale or not.
Declaration
public static bool IsNoteInScale(this Scale scale, Note note)
Parameters
Type |
Name |
Description |
Scale |
scale |
Scale to check the note. |
Note |
note |
Note to check if it belongs to the scale
or not. |
Returns
Type |
Description |
bool |
true if note belongs to the scale ;
otherwise, false . |
Exceptions