Search Results for

    Show / Hide Table of Contents

    Class NoteUtilities

    Provides utilities for working with the Note.
    Inheritance
    object
    NoteUtilities
    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 NoteUtilities

    Methods

    GetNoteName(SevenBitNumber)

    Gets name of the note presented by note number.
    Declaration
    public static NoteName GetNoteName(SevenBitNumber noteNumber)
    Parameters
    Type Name Description
    SevenBitNumber noteNumber Note number to get note name of.
    Returns
    Type Description
    NoteName Name of the note presented by noteNumber.

    GetNoteNumber(NoteName, int)

    Gets the note number for the specified note name and octave.
    Declaration
    public static SevenBitNumber GetNoteNumber(NoteName noteName, int octave)
    Parameters
    Type Name Description
    NoteName noteName Name of the note.
    int octave Number of the octave in scientific pitch notation.
    Returns
    Type Description
    SevenBitNumber Number of the note represented by specified name and octave.
    Remarks
    Octave number is specified in scientific pitch notation which means that 4 must be passed to octave to get the number of the middle C.
    Exceptions
    Type Condition
    InvalidEnumArgumentException noteName specified an invalid value.
    ArgumentException Note number is out of range for the specified note name and octave.

    GetNoteOctave(SevenBitNumber)

    Gets octave number of the note presented by note number in scientific pitch notation.
    Declaration
    public static int GetNoteOctave(SevenBitNumber noteNumber)
    Parameters
    Type Name Description
    SevenBitNumber noteNumber Note number to get octave of.
    Returns
    Type Description
    int Octave of the note presented by noteNumber.
    Remarks
    Octave number will be returned in scientific pitch notation which means that 4 will be returned for 60 note number.

    Transpose(NoteName, Interval)

    Transposes note name by the specified interval.
    Declaration
    public static NoteName Transpose(this NoteName noteName, Interval interval)
    Parameters
    Type Name Description
    NoteName noteName NoteName to transpose.
    Interval interval Interval to transpose by.
    Returns
    Type Description
    NoteName Note name which is noteName transposed by interval.
    Exceptions
    Type Condition
    InvalidEnumArgumentException noteName specified an invalid value.
    ArgumentNullException interval is null.
    In this article
    Back to top 2025 / Generated by DocFX