Ctrl+K

MidiEvent

Declaration

public sealed class Strawberry.Sound.Midi.MidiEvent

Represents a single parsed MIDI event with absolute timing. Events are sorted by AbsoluteTicks after track merging. TimeSeconds is computed from the tempo map after parsing.

Properties

AbsoluteTicks

Absolute tick position from the start of the file.

long AbsoluteTicks { get set }

TimeSeconds

Time in seconds from the start of the file (computed from tempo map).

double TimeSeconds { get set }

Type

Type of the MIDI event (channel voice, meta, sysex).

MidiEventType Type { get set }

Channel

MIDI channel (0-15) for channel voice messages.

int Channel { get set }

Data1

First data byte: note number, controller number, program number, or pitch wheel LSB depending on event type.

int Data1 { get set }

Data2

Second data byte: velocity, controller value, or pitch wheel MSB depending on event type. Zero for single-byte messages.

int Data2 { get set }

MetaType

Meta event subtype (only valid when Type == Meta).

MidiMetaType MetaType { get set }

MetaData

Raw bytes of meta event data (only valid when Type == Meta).

byte[] MetaData { get set }

SysExData

Raw bytes of SysEx data (only valid when Type == SysEx or SysExContinuation).

byte[] SysExData { get set }

Methods

ToString override

string ToString()