Share via


MidiPacket Class

Definition

Encapsulates a series of MIDI events.

public class MidiPacket : IDisposable
type MidiPacket = class
    interface IDisposable
Inheritance
MidiPacket
Implements

Remarks

When you consume a MidiPacket (because some data was received) you would use the Bytes property to get access to the underlying Midi data. The actual number of valid bytes is stored in the Length property and you should not read beyond that point.

When you produce MidiPackets, you can either create MidiPacket instances by providing both an IntPtr and a Length parameter to your own buffers, or you can provide a byte array as well as a range within the array that determines where the Midi data is stored.

Constructors

Name Description
MidiPacket(Int64, Byte[], Int32, Int32)
MidiPacket(Int64, Byte[])
MidiPacket(Int64, UInt16, IntPtr)

Fields

Name Description
Length

The number of bytes in the Bytes array

TimeStamp

Time for the event, use zero to mean now.

Properties

Name Description
ByteArray

Returns the 'bytes' array passed to the MidiPacket(Int64, Byte[]) constructor or the MidiPacket(Int64, Byte[], Int32, Int32) constructor.

BytePointer

Returns the 'bytes' pointer passed to the MidiPacket(Int64, UInt16, IntPtr) constructor.

Bytes

Methods

Name Description
Dispose()

Releases the resources used by the MidiPacket object.

Dispose(Boolean)

Releases the resources used by the MidiPacket object.

Finalize()

Applies to

See also