Search Results for

    Show / Hide Table of Contents

    Class ScaleUtilities

    Provides useful utilities for working with Scale.
    Inheritance
    object
    ScaleUtilities
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.MusicTheory
    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
    Type Name Description
    Scale scale Scale to get degree of.
    ScaleDegree degree ScaleDegree representing a degree of the scale.
    Returns
    Type Description
    NoteName NoteName which is the degree of the scale.
    Exceptions
    Type Condition
    ArgumentNullException scale is null.
    InvalidEnumArgumentException degree specified an invalid value.
    ArgumentOutOfRangeException degree is out of range for the scale.

    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
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • scale is null.
    • note is null.

    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
    Type Description
    IEnumerable<Note> Notes that belong to the scale.
    Exceptions
    Type Condition
    ArgumentNullException scale is null.

    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
    Type Description
    IEnumerable<NoteName> Note names that belong to the scale.
    Exceptions
    Type Condition
    ArgumentNullException scale is null.

    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
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • scale is null.
    • note is null.

    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
    Type Description
    NoteName NoteName which is the step of the scale.
    Exceptions
    Type Condition
    ArgumentNullException scale is null.
    ArgumentOutOfRangeException step is negative.

    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
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • scale is null.
    • note is null.
    In this article
    Back to top 2024 / Generated by DocFX