Skip to main content

onBeatCursorUpdating

Description​

Updates whenever the currently beat cursor is updating its start and end location from which it starts and animates to. This method is tightly coupled to how alphaTab internally handles the beat cursor display. alphaTab looks up the current and next beat to which the beat cursor needs to transition in a specific amount of time.

In some occations the cursor will transition to the end of the bar instead of the next beat.

onBeatCursorUpdating(startBeat: BeatBounds, endBeat: BeatBounds | undefined, cursorMode: MidiTickLookupFindBeatResultCursorMode, actualBeatCursorStartX: number, actualBeatCursorEndX: number, actualBeatCursorTransitionDuration: number): void
ParameterSummary
startBeatAll

the information about the beat where the cursor is starting its animation.

endBeatAll

the information about the beat where the cursor is ending its animation.

cursorModeAll

how the cursor is transitioning (e.g. to end of bar or to the location of the next beat)

actualBeatCursorStartXAll

the exact start position of the beat cursor animation. Depending on the exact time of the player, this position might be relatively adjusted.

actualBeatCursorEndXAll

the exact end position of the beat cursor animation. Depending on the exact time of the player and cursor mode, this might be beyond the expected bounds. To ensure a smooth cursor experience (no jumping/flicking back and forth), alphaTab optimizes the used end position and animation durations.

actualBeatCursorTransitionDurationAll

The duration of the beat cursor transition in milliseconds. Similar to the start and end positions, this duration is adjusted accordingly to ensure that the beat cursor remains smoothly at the expected position for the currently played time.