Search Results for

    Show / Hide Table of Contents

    Class MidiEvent

    Represents a MIDI file event stored in a track chunk.
    Inheritance
    object
    MidiEvent
    ChannelEvent
    MetaEvent
    SysExEvent
    SystemCommonEvent
    SystemRealTimeEvent
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Core
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public abstract class MidiEvent
    Remarks

    See https://midi.org/standard-midi-files-specification for detailed MIDI file specification.

    Constructors

    MidiEvent(MidiEventType)

    Initializes a new instance of the MidiEvent with the specified event type.
    Declaration
    protected MidiEvent(MidiEventType eventType)
    Parameters
    Type Name Description
    MidiEventType eventType The type of event.

    Fields

    UnknownContentSize

    Constant for content's size of events that don't have size information stored.
    Declaration
    public const int UnknownContentSize = -1
    Field Value
    Type Description
    int

    Properties

    DeltaTime

    Gets or sets delta-time of the event.
    Declaration
    public long DeltaTime { get; set; }
    Property Value
    Type Description
    long
    Remarks
    Delta-time represents the amount of time before the following event. If the first event in a track occurs at the very beginning of a track, or if two events occur simultaneously, a delta-time of zero is used. Delta-time is in some fraction of a beat (or a second, for recording a track with SMPTE times), as specified by the file's time division.
    Exceptions
    Type Condition
    ArgumentOutOfRangeException Delta-time is negative.

    EventType

    Gets the type of the event.
    Declaration
    public MidiEventType EventType { get; }
    Property Value
    Type Description
    MidiEventType

    Methods

    Clone()

    Clones event by creating a copy of it.
    Declaration
    public MidiEvent Clone()
    Returns
    Type Description
    MidiEvent Copy of the event.

    CloneEvent()

    Clones event by creating a copy of it.
    Declaration
    protected abstract MidiEvent CloneEvent()
    Returns
    Type Description
    MidiEvent Copy of the event.

    Equals(MidiEvent, MidiEvent)

    Determines whether two specified MidiEvent objects have the same content.
    Declaration
    public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2)
    Parameters
    Type Name Description
    MidiEvent midiEvent1 The first event to compare, or null.
    MidiEvent midiEvent2 The second event to compare, or null.
    Returns
    Type Description
    bool true if the midiEvent1 is equal to the midiEvent2; otherwise, false.

    Equals(MidiEvent, MidiEvent, MidiEventEqualityCheckSettings)

    Determines whether two specified MidiEvent objects have the same content.
    Declaration
    public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2, MidiEventEqualityCheckSettings settings)
    Parameters
    Type Name Description
    MidiEvent midiEvent1 The first event to compare, or null.
    MidiEvent midiEvent2 The second event to compare, or null.
    MidiEventEqualityCheckSettings settings Settings according to which events should be compared.
    Returns
    Type Description
    bool true if the midiEvent1 is equal to the midiEvent2; otherwise, false.

    Equals(MidiEvent, MidiEvent, MidiEventEqualityCheckSettings, out string)

    Determines whether two specified MidiEvent objects have the same content using the specified comparison settings.
    Declaration
    public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2, MidiEventEqualityCheckSettings settings, out string message)
    Parameters
    Type Name Description
    MidiEvent midiEvent1 The first event to compare, or null.
    MidiEvent midiEvent2 The second event to compare, or null.
    MidiEventEqualityCheckSettings settings Settings according to which events should be compared.
    string message Message containing information about what exactly is different in midiEvent1 and midiEvent2.
    Returns
    Type Description
    bool true if the midiEvent1 is equal to the midiEvent2; otherwise, false.

    Equals(MidiEvent, MidiEvent, out string)

    Determines whether two specified MidiEvent objects have the same content.
    Declaration
    public static bool Equals(MidiEvent midiEvent1, MidiEvent midiEvent2, out string message)
    Parameters
    Type Name Description
    MidiEvent midiEvent1 The first event to compare, or null.
    MidiEvent midiEvent2 The second event to compare, or null.
    string message Message containing information about what exactly is different in midiEvent1 and midiEvent2.
    Returns
    Type Description
    bool true if the midiEvent1 is equal to the midiEvent2; otherwise, false.
    In this article
    Back to top 2024 / Generated by DocFX