Skip to main content

alphaTab.midi.MidiFile

Represents a midi file with a single track that can be played via AlphaSynth

 class MidiFile

Propertiesโ€‹

divisionโ€‹

Gets or sets the division per quarter notes.

division: number;

eventsโ€‹

Gets a list of midi events sorted by time.

readonly events: MidiEvent[];

formatโ€‹

Gets or sets the midi file format to use.

tickShiftโ€‹

An indicator by how many midi-ticks the song contents are shifted. Grace beats at start might require a shift for the first beat to start at 0. This information can be used to translate back the player time axis to the music notation.

tickShift: number;

tracksโ€‹

Gets a list of midi tracks.

readonly tracks: MidiTrack[];

Methodsโ€‹

addEventโ€‹

Adds the given midi event a the correct time position into the file.

addEvent(e: MidiEvent): void
ParameterSummary
eAll

(no description)

toBinaryโ€‹

Writes the midi file into a binary format.

toBinary(): Uint8Array

Returnsโ€‹

The binary midi file.

writeToโ€‹

Writes the midi file as binary into the given stream.

writeTo(s: IWriteable): void
ParameterSummary
sAll

(no description)

Returnsโ€‹

The stream to write to.

writeVariableIntโ€‹

(no description)

static writeVariableInt(s: IWriteable, value: number): void
ParameterSummary
sAll

(no description)

valueAll

(no description)