Skip to main content

midiEventsPlayedFilter

since 1.2.0

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.

midiEventsPlayedFilterJavaScript
alphaTab('midiEventsPlayedFilter')jQuery
MidiEventsPlayedFilter.net
midiEventsPlayedFilterAndroid

Types​

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

Default Value​

[]

Examples​

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