alphaTab.midi.IMidiFileHandler
A handler is responsible for writing midi events to a custom structure
interface IMidiFileHandlerMethods​
addBend​
Add a bend to the generated midi file.
- JavaScript
- C#
- Kotlin
addBend(track: number, tick: number, channel: number, value: number): voidvoid AddBend(double track, double tick, double channel, double value)fun addBend(track: Double, tick: Double, channel: Double, value: Double): Unit| Parameter | Summary |
|---|---|
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.
- JavaScript
- C#
- Kotlin
addControlChange(track: number, tick: number, channel: number, controller: ControllerType, value: number): voidvoid AddControlChange(double track, double tick, double channel, ControllerType controller, double value)fun addControlChange(track: Double, tick: Double, channel: Double, controller: ControllerType, value: Double): Unit| Parameter | Summary |
|---|---|
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
- JavaScript
- C#
- Kotlin
addNote(track: number, start: number, length: number, key: number, velocity: number, channel: number): voidvoid AddNote(double track, double start, double length, double key, double velocity, double channel)fun addNote(track: Double, start: Double, length: Double, key: Double, velocity: Double, channel: Double): Unit| Parameter | Summary |
|---|---|
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.
- JavaScript
- C#
- Kotlin
addNoteBend(track: number, tick: number, channel: number, key: number, value: number): voidvoid AddNoteBend(double track, double tick, double channel, double key, double value)fun addNoteBend(track: Double, tick: Double, channel: Double, key: Double, value: Double): Unit| Parameter | Summary |
|---|---|
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
- JavaScript
- C#
- Kotlin
addProgramChange(track: number, tick: number, channel: number, program: number): voidvoid AddProgramChange(double track, double tick, double channel, double program)fun addProgramChange(track: Double, tick: Double, channel: Double, program: Double): Unit| Parameter | Summary |
|---|---|
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.
- JavaScript
- C#
- Kotlin
addRest(track: number, tick: number, channel: number): voidvoid AddRest(double track, double tick, double channel)fun addRest(track: Double, tick: Double, channel: Double): Unit| Parameter | Summary |
|---|---|
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.
- JavaScript
- C#
- Kotlin
addTempo(tick: number, tempo: number): voidvoid AddTempo(double tick, double tempo)fun addTempo(tick: Double, tempo: Double): Unit| Parameter | Summary |
|---|---|
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.
- JavaScript
- C#
- Kotlin
addTickShift(tickShift: number): voidvoid AddTickShift(double tickShift)fun addTickShift(tickShift: Double): Unit| Parameter | Summary |
|---|---|
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
- JavaScript
- C#
- Kotlin
addTimeSignature(tick: number, timeSignatureNumerator: number, timeSignatureDenominator: number): voidvoid AddTimeSignature(double tick, double timeSignatureNumerator, double timeSignatureDenominator)fun addTimeSignature(tick: Double, timeSignatureNumerator: Double, timeSignatureDenominator: Double): Unit| Parameter | Summary |
|---|---|
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.
- JavaScript
- C#
- Kotlin
finishTrack(track: number, tick: number): voidvoid FinishTrack(double track, double tick)fun finishTrack(track: Double, tick: Double): Unit| Parameter | Summary |
|---|---|
trackAll | The track that was finished. |
tickAll | The end tick for this track. |