Skip to main content

alphaTab.midi.IMidiFileHandler

A handler is responsible for writing midi events to a custom structure

 interface IMidiFileHandler

Methods​

addBend​

Add a bend to the generated midi file.

addBend(track: number, tick: number, channel: number, value: number): void
ParameterSummary
trackAll

The midi track on which the bend should change.

tickAll

The midi ticks when the bend should change.

channelAll

The midi channel on which the bend should change.

valueAll

The new bend for the selected track and channel.

addControlChange​

Adds a control change to the generated midi file.

addControlChange(track: number, tick: number, channel: number, controller: ControllerType, value: number): void
ParameterSummary
trackAll

The midi track on which the controller should change.

tickAll

The midi ticks when the controller should change.

channelAll

The midi channel on which the controller should change.

controllerAll

The midi controller that should change.

valueAll

The value to which the midi controller should change

addNote​

Adds a note to the generated midi file

addNote(track: number, start: number, length: number, key: number, velocity: number, channel: number): void
ParameterSummary
trackAll

The midi track on which the note should be played.

startAll

The midi ticks when the note should start playing.

lengthAll

The duration the note in midi ticks.

keyAll

The key of the note to play

velocityAll

The velocity which should be applied to the note (derived from the note dynamics).

channelAll

The midi channel on which the note should be played.

addNoteBend​

Add a bend specific to a note to the generated midi file. The note does not need to be started, if this event is signaled, the next time a note on this channel and key is played it will be affected. The note bend is cleared on a note-off for this key.

addNoteBend(track: number, tick: number, channel: number, key: number, value: number): void
ParameterSummary
trackAll

The midi track on which the bend should change.

tickAll

The midi ticks when the bend should change.

channelAll

(no description)

keyAll

(no description)

valueAll

The new bend for the selected note.

addProgramChange​

Add a program change to the generated midi file

addProgramChange(track: number, tick: number, channel: number, program: number): void
ParameterSummary
trackAll

The midi track on which the program should change.

tickAll

The midi ticks when the program should change.

channelAll

The midi channel on which the program should change.

programAll

The new program for the selected track and channel.

addRest​

Adds a rest to the generated midi file.

addRest(track: number, tick: number, channel: number): void
ParameterSummary
trackAll

The midi track on which the rest should be "played".

tickAll

The midi ticks when the rest is "playing".

channelAll

The midi channel on which the rest should be "played".

addTempo​

Add a tempo change to the generated midi file.

addTempo(tick: number, tempo: number): void
ParameterSummary
tickAll

The midi ticks when the tempo should change change.

tempoAll

The tempo as BPM

addTickShift​

Registers a general shift of the time-axis for the generate midi file.

addTickShift(tickShift: number): void
ParameterSummary
tickShiftAll

The shift in midi ticks by which all midi events beside the initial channel setups are shifted. This shift is applied in case grace beats

addTimeSignature​

Adds a time signature to the generated midi file

addTimeSignature(tick: number, timeSignatureNumerator: number, timeSignatureDenominator: number): void
ParameterSummary
tickAll

The midi ticks when this event should be happening.

timeSignatureNumeratorAll

The time signature numerator

timeSignatureDenominatorAll

The time signature denominator

finishTrack​

Indicates that the track is finished on the given ticks.

finishTrack(track: number, tick: number): void
ParameterSummary
trackAll

The track that was finished.

tickAll

The end tick for this track.