Search Results for

    Show / Hide Table of Contents

    Class ChordProgression

    Represents a chord progression as a set of chords.
    Inheritance
    object
    ChordProgression
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Melanchall.DryWetMidi.MusicTheory
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class ChordProgression

    Constructors

    ChordProgression(params Chord[])

    Initializes a new instance of the ChordProgression with the specified chords.
    Declaration
    public ChordProgression(params Chord[] chords)
    Parameters
    Type Name Description
    Chord[] chords Chords of the chord progression.
    Exceptions
    Type Condition
    ArgumentNullException chords is null.
    ArgumentException chords contains null.

    ChordProgression(IEnumerable<Chord>)

    Initializes a new instance of the ChordProgression with the specified chords.
    Declaration
    public ChordProgression(IEnumerable<Chord> chords)
    Parameters
    Type Name Description
    IEnumerable<Chord> chords Chords of the chord progression.
    Exceptions
    Type Condition
    ArgumentNullException chords is null.
    ArgumentException chords contains null.

    Properties

    Chords

    Gets the chords of the chord progression.
    Declaration
    public IEnumerable<Chord> Chords { get; }
    Property Value
    Type Description
    IEnumerable<Chord>

    Methods

    Equals(object)

    Determines whether the specified object is equal to the current object.
    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj The object to compare with the current object.
    Returns
    Type Description
    bool true if the specified object is equal to the current object; otherwise, false.
    Overrides
    object.Equals(object)

    GetHashCode()

    Serves as the default hash function.
    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int A hash code for the current object.
    Overrides
    object.GetHashCode()

    Parse(string, Scale)

    Converts the string representation of a chord progression to its ChordProgression equivalent.
    Declaration
    public static ChordProgression Parse(string input, Scale scale)
    Parameters
    Type Name Description
    string input A string containing a chord progression to convert.
    Scale scale Scale to resolve chords.
    Returns
    Type Description
    ChordProgression A ChordProgression equivalent to the chord progression contained in input.
    Exceptions
    Type Condition
    ArgumentException input is null or contains white-spaces only.
    FormatException input has invalid format.

    ToString()

    Returns a string that represents the current object.
    Declaration
    public override string ToString()
    Returns
    Type Description
    string A string that represents the current object.
    Overrides
    object.ToString()

    TryParse(string, Scale, out ChordProgression)

    Converts the string representation of a chord progression to its ChordProgression equivalent. A return value indicates whether the conversion succeeded.
    Declaration
    public static bool TryParse(string input, Scale scale, out ChordProgression chordProgression)
    Parameters
    Type Name Description
    string input A string containing a chord progression to convert.
    Scale scale Scale to resolve chords.
    ChordProgression chordProgression When this method returns, contains the ChordProgression equivalent of the chord progression contained in input, if the conversion succeeded, or null if the conversion failed. The conversion fails if the input is null or Empty, or is not of the correct format. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.
    Returns
    Type Description
    bool true if input was converted successfully; otherwise, false.

    Operators

    operator ==(ChordProgression, ChordProgression)

    Determines if two ChordProgression objects are equal.
    Declaration
    public static bool operator ==(ChordProgression chordProgression1, ChordProgression chordProgression2)
    Parameters
    Type Name Description
    ChordProgression chordProgression1 The first ChordProgression to compare.
    ChordProgression chordProgression2 The second ChordProgression to compare.
    Returns
    Type Description
    bool true if the chord progressions are equal, false otherwise.

    operator !=(ChordProgression, ChordProgression)

    Determines if two ChordProgression objects are not equal.
    Declaration
    public static bool operator !=(ChordProgression chordProgression1, ChordProgression chordProgression2)
    Parameters
    Type Name Description
    ChordProgression chordProgression1 The first ChordProgression to compare.
    ChordProgression chordProgression2 The second ChordProgression to compare.
    Returns
    Type Description
    bool false if the chord progressions are equal, true otherwise.
    In this article
    Back to top 2024 / Generated by DocFX