tickCache
Description​
Gets the tick cache allowing lookup of midi ticks to beats. If the player is enabled, a midi file will be generated
for the loaded alphaTab.model.Score
for later playback. During this generation this tick cache is filled with the
exact midi ticks when beats are played.
The MidiTickLookup.findBeat
method allows a lookup of the beat related to a given input midi tick.
tickCacheJavaScript |
alphaTab('tickCache')jQuery |
TickCache.net |
tickCacheAndroid |
Types​
alphaTab.midi.MidiTickLookupJavaScript |
AlphaTab.Midi.MidiTickLookup.net |
alphaTab.midi.MidiTickLookupAndroid |
MidiTickLookup.findBeat Signatures​
Type | Values |
---|---|
findBeat(trackLookup: Set<number>, tick: number, currentBeatHint: MidiTickLookupFindBeatResult | null): MidiTickLookupFindBeatResult | nullJavaScript | Find the beat played at a given midi tick. |
MidiTickLookupFindBeatResult? FindBeat(AlphaTab.Core.EcmaScript.Set<double> trackLookup, double tick, AlphaTab.Midi.MidiTickLookupFindBeatResult? currentBeatHint = null).net | Find the beat played at a given midi tick. |
MidiTickLookupFindBeatResult? findBeat(trackLookup: alphaTab.core.ecmaScript.Set<Double>, tick: Double, currentBeatHint: alphaTab.midi.MidiTickLookupFindBeatResult? = null)Android | Find the beat played at a given midi tick. |
MidiTickLookup.findBeat Parameters​
Parameters | Type | Summary |
---|---|---|
trackLookupJavaScript | Set<number> | The tracks indices in which to search the played beat for. |
trackLookup.net | AlphaTab.Core.EcmaScript.Set<double> | The tracks indices in which to search the played beat for. |
trackLookupAndroid | alphaTab.core.ecmaScript.Set<Double> | The tracks indices in which to search the played beat for. |
tickJavaScript | double | The midi tick for which the beat should be looked up. |
tick.net | number | The midi tick for which the beat should be looked up. |
currentBeatHintJavaScript | AlphaTab.Midi.MidiTickLookupFindBeatResult | Used for optimized lookup during playback. By passing in a previous result lookup of the next one can be optimized using heuristics. (optional). |
currentBeatHint.net | alphaTab.midi.MidiTickLookupFindBeatResult | Used for optimized lookup during playback. By passing in a previous result lookup of the next one can be optimized using heuristics. (optional). |
currentBeatHintAndroid | alphaTab.midi.MidiTickLookupFindBeatResult | Used for optimized lookup during playback. By passing in a previous result lookup of the next one can be optimized using heuristics. (optional). |
Examples​
- JavaScript
- jQuery
- C#
- Android
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
const lookupResult = api.tickCache.findBeat(new Set([0, 1]), 100);
const currentBeat = lookupResult?.currentBeat;
Not available
var api = new AlphaTabApi<MyControl>(...);
var lookupResult = api.TickCache.FindBeat(new AlphaTab.Core.EcmaScript.Set(0, 1), 100);
var currentBeat = lookupResult?.CurrentBeat;
val api = AlphaTabApi<MyControl>(...)
val lookupResult = api.tickCache.findBeat(alphaTab.core.ecmaScript.Set(0, 1), 100);
val currentBeat = lookupResult?.CurrentBeat;