Search Results for

    Show / Hide Table of Contents

    Class TimeSignature

    Represents time signature which is number of beats of specified length.
    Inheritance
    object
    TimeSignature
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Melanchall.DryWetMidi.Interaction
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class TimeSignature

    Constructors

    TimeSignature(int, int)

    Initializes a new instance of the TimeSignature with the specified numerator and denominator.
    Declaration
    public TimeSignature(int numerator, int denominator)
    Parameters
    Type Name Description
    int numerator Numerator of the time signature which defines number of beats.
    int denominator Denominator of the time signature which defines beat length.
    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    One of the following errors occurred:

    • numerator is zero or negative.
    • denominator is zero or negative.
    • denominator is not a power of two.

    Fields

    Default

    Default time signature which is 4/4.
    Declaration
    public static readonly TimeSignature Default
    Field Value
    Type Description
    TimeSignature

    Properties

    Denominator

    Gets denominator of the time signature which defines beat length.
    Declaration
    public int Denominator { get; }
    Property Value
    Type Description
    int

    Numerator

    Gets numerator of the time signature which defines number of beats.
    Declaration
    public int Numerator { get; }
    Property Value
    Type Description
    int

    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()

    Returns the hash code for this instance.
    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int A 32-bit signed integer hash code.
    Overrides
    object.GetHashCode()

    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()

    Operators

    operator ==(TimeSignature, TimeSignature)

    Determines if two TimeSignature objects are equal.
    Declaration
    public static bool operator ==(TimeSignature timeSignature1, TimeSignature timeSignature2)
    Parameters
    Type Name Description
    TimeSignature timeSignature1 The first TimeSignature to compare.
    TimeSignature timeSignature2 The second TimeSignature to compare.
    Returns
    Type Description
    bool true if the time signatures are equal, false otherwise.

    operator >(TimeSignature, TimeSignature)

    Indicates whether a specified TimeSignature is greater than another one.
    Declaration
    public static bool operator >(TimeSignature timeSignature1, TimeSignature timeSignature2)
    Parameters
    Type Name Description
    TimeSignature timeSignature1 The first TimeSignature to compare.
    TimeSignature timeSignature2 The second TimeSignature to compare.
    Returns
    Type Description
    bool true if the value of timeSignature1 is greater than the value of timeSignature2; otherwise, false.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • timeSignature1 is null.
    • timeSignature2 is null.

    operator >=(TimeSignature, TimeSignature)

    Indicates whether a specified TimeSignature is greater than or equal to another one.
    Declaration
    public static bool operator >=(TimeSignature timeSignature1, TimeSignature timeSignature2)
    Parameters
    Type Name Description
    TimeSignature timeSignature1 The first TimeSignature to compare.
    TimeSignature timeSignature2 The second TimeSignature to compare.
    Returns
    Type Description
    bool true if the value of timeSignature1 is greater than or equal to the value of timeSignature2; otherwise, false.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • timeSignature1 is null.
    • timeSignature2 is null.

    operator !=(TimeSignature, TimeSignature)

    Determines if two TimeSignature objects are not equal.
    Declaration
    public static bool operator !=(TimeSignature timeSignature1, TimeSignature timeSignature2)
    Parameters
    Type Name Description
    TimeSignature timeSignature1 The first TimeSignature to compare.
    TimeSignature timeSignature2 The second TimeSignature to compare.
    Returns
    Type Description
    bool false if the time signatures are equal, true otherwise.

    operator <(TimeSignature, TimeSignature)

    Indicates whether a specified TimeSignature is less than another one.
    Declaration
    public static bool operator <(TimeSignature timeSignature1, TimeSignature timeSignature2)
    Parameters
    Type Name Description
    TimeSignature timeSignature1 The first TimeSignature to compare.
    TimeSignature timeSignature2 The second TimeSignature to compare.
    Returns
    Type Description
    bool true if the value of timeSignature1 is less than the value of timeSignature2; otherwise, false.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • timeSignature1 is null.
    • timeSignature2 is null.

    operator <=(TimeSignature, TimeSignature)

    Indicates whether a specified TimeSignature is less than or equal to another one.
    Declaration
    public static bool operator <=(TimeSignature timeSignature1, TimeSignature timeSignature2)
    Parameters
    Type Name Description
    TimeSignature timeSignature1 The first TimeSignature to compare.
    TimeSignature timeSignature2 The second TimeSignature to compare.
    Returns
    Type Description
    bool true if the value of timeSignature1 is less than or equal to the value of timeSignature2; otherwise, false.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • timeSignature1 is null.
    • timeSignature2 is null.

    See Also

    TempoMap
    In this article
    Back to top 2024 / Generated by DocFX