Since: 1.2.0-alpha.100

midiEventsPlayedFilter

Description

Gets or sets the midi events which will trigger the midiEventsPlayed event. With this filter set you can enable that alphaTab will signal any midi events as they are played by the synthesizer. This allows reacing on various low level audio playback elements like notes/rests played or metronome ticks.

Refer to the related guide to learn more about this feature.

Types

alphaTab.midi.MidiEventType[]JavaScript
IList<AlphaTab.Midi.MidiEventType>.net

Default Value

[]

Examples

var api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.midiEventsPlayedFilter = [alphaTab.midi.MidiEventType.SystemExclusive2];
api.midiEventsPlayed.on(function(e) {
for(const midi of e.events) {
if(midi.isMetronome) {
console.log('Metronome tick ' + midi.metronomeNumerator);
}
}
});