Search Results for

    Show / Hide Table of Contents

    Class TempoMap

    Represents a tempo map of a MIDI file. More info in the Tempo map article.
    Inheritance
    object
    TempoMap
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Interaction
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class TempoMap

    Fields

    Default

    The default tempo map which uses 4/4 time signature and tempo of 500,000 microseconds per quarter note.
    Declaration
    public static readonly TempoMap Default
    Field Value
    Type Description
    TempoMap

    Properties

    TimeDivision

    Gets the time division used by a tempo map.
    Declaration
    public TimeDivision TimeDivision { get; }
    Property Value
    Type Description
    TimeDivision

    Methods

    Clone()

    Clones the current TempoMap.
    Declaration
    public TempoMap Clone()
    Returns
    Type Description
    TempoMap An instance of the TempoMap which is a clone of the current one.

    Create(TimeDivision)

    Creates an instance of the TempoMap with the specified time division using default tempo (120 BPM) and default time signature (4/4).
    Declaration
    public static TempoMap Create(TimeDivision timeDivision)
    Parameters
    Type Name Description
    TimeDivision timeDivision Time division of the tempo map.
    Returns
    Type Description
    TempoMap TempoMap with the specified time division.
    Exceptions
    Type Condition
    ArgumentNullException timeDivision is null.

    Create(TimeDivision, Tempo)

    Creates an instance of the TempoMap with the specified time division and tempo using default time signature (4/4).
    Declaration
    public static TempoMap Create(TimeDivision timeDivision, Tempo tempo)
    Parameters
    Type Name Description
    TimeDivision timeDivision Time division of the tempo map.
    Tempo tempo Tempo of the tempo map.
    Returns
    Type Description
    TempoMap TempoMap with the specified time division and tempo.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • timeDivision is null.
    • tempo is null.

    Create(TimeDivision, Tempo, TimeSignature)

    Creates an instance of the TempoMap with the specified time division, tempo and time signature.
    Declaration
    public static TempoMap Create(TimeDivision timeDivision, Tempo tempo, TimeSignature timeSignature)
    Parameters
    Type Name Description
    TimeDivision timeDivision Time division of the tempo map.
    Tempo tempo Tempo of the tempo map.
    TimeSignature timeSignature Time signature of the tempo map.
    Returns
    Type Description
    TempoMap TempoMap with the specified time division, tempo and time signature.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • timeDivision is null.
    • tempo is null.
    • timeSignature is null.

    Create(TimeDivision, TimeSignature)

    Creates an instance of the TempoMap with the specified time division and time signature using default tempo (120 BPM).
    Declaration
    public static TempoMap Create(TimeDivision timeDivision, TimeSignature timeSignature)
    Parameters
    Type Name Description
    TimeDivision timeDivision Time division of the tempo map.
    TimeSignature timeSignature Time signature of the tempo map.
    Returns
    Type Description
    TempoMap TempoMap with the specified time division and time signature.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • timeDivision is null.
    • timeSignature is null.

    Create(Tempo)

    Creates an instance of the TempoMap with the specified tempo using default time division (96 ticks per quarter note).
    Declaration
    public static TempoMap Create(Tempo tempo)
    Parameters
    Type Name Description
    Tempo tempo Tempo of the tempo map.
    Returns
    Type Description
    TempoMap TempoMap with the specified tempo.
    Exceptions
    Type Condition
    ArgumentNullException tempo is null.

    Create(Tempo, TimeSignature)

    Creates an instance of the TempoMap with the specified tempo and time signature using default time division (96 ticks per quarter note).
    Declaration
    public static TempoMap Create(Tempo tempo, TimeSignature timeSignature)
    Parameters
    Type Name Description
    Tempo tempo Tempo of the tempo map.
    TimeSignature timeSignature Time signature of the tempo map.
    Returns
    Type Description
    TempoMap TempoMap with the specified tempo and time signature.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • tempo is null.
    • timeSignature is null.

    Create(TimeSignature)

    Creates an instance of the TempoMap with the specified time signature using default time division (96 ticks per quarter note).
    Declaration
    public static TempoMap Create(TimeSignature timeSignature)
    Parameters
    Type Name Description
    TimeSignature timeSignature Time signature of the tempo map.
    Returns
    Type Description
    TempoMap TempoMap with the specified time signature.
    Exceptions
    Type Condition
    ArgumentNullException timeSignature is null.

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

    GetTempoAtTime(ITimeSpan)

    Returns tempo at the specified time.
    Declaration
    public Tempo GetTempoAtTime(ITimeSpan time)
    Parameters
    Type Name Description
    ITimeSpan time Time to get tempo at.
    Returns
    Type Description
    Tempo Tempo at the time of time.
    Exceptions
    Type Condition
    ArgumentNullException time is null.

    GetTempoChanges()

    Returns the collection of tempo changes.
    Declaration
    public IEnumerable<ValueChange<Tempo>> GetTempoChanges()
    Returns
    Type Description
    IEnumerable<ValueChange<Tempo>> Collection of tempo changes.

    GetTimeSignatureAtTime(ITimeSpan)

    Returns time signature at the specified time.
    Declaration
    public TimeSignature GetTimeSignatureAtTime(ITimeSpan time)
    Parameters
    Type Name Description
    ITimeSpan time Time signature to get tempo at.
    Returns
    Type Description
    TimeSignature Time signature at the time of time.
    Exceptions
    Type Condition
    ArgumentNullException time is null.

    GetTimeSignatureChanges()

    Returns the collection of time signature changes.
    Declaration
    public IEnumerable<ValueChange<TimeSignature>> GetTimeSignatureChanges()
    Returns
    Type Description
    IEnumerable<ValueChange<TimeSignature>> Collection of time signature changes.
    In this article
    Back to top 2024 / Generated by DocFX