Skip to main content

API

On many platforms an alphaTab API object can be used to bootstrap alphaTab within your UI. It takes over all responsibilities of linking your actions to the UI. Namely this object is called AlphaTabApi (Web) or AlphaTabApiBase<> (.net). This page describes all methods, properties and events exposed by this API object.

NameSummary
Events - Core
errorJavaScriptalphaTab.errorjQuery
alphaTab.errorHTML
Error.net
errorAndroid
This event is fired when an error within alphatab occurred.
postRenderFinishedJavaScriptalphaTab.postRenderFinishedjQuery
alphaTab.postRenderFinishedHTML
PostRenderFinished.net
postRenderFinishedAndroid
This event is fired when the rendering of the whole music sheet is finished, and all handlers of RenderFinished ran.
renderFinishedJavaScriptalphaTab.renderFinishedjQuery
alphaTab.renderFinishedHTML
RenderFinished.net
renderFinishedAndroid
This event is fired when the rendering of the whole music sheet is finished.
renderStartedJavaScriptalphaTab.renderStartedjQuery
alphaTab.renderStartedHTML
RenderStarted.net
renderStartedAndroid
This event is fired when the rendering of the whole music sheet is starting.
resizeJavaScriptalphaTab.resizejQuery
alphaTab.resizeHTML
Resize.net
resizeAndroid
This event is fired when alphaTab was resized and is about to rerender the music notation.
scoreLoadedJavaScriptalphaTab.scoreLoadedjQuery
alphaTab.scoreLoadedHTML
ScoreLoaded.net
scoreLoadedAndroid
This event is fired whenever a new song is loaded
Events - Player
activeBeatsChangedJavaScriptalphaTab.activeBeatsChangedjQuery
alphaTab.activeBeatsChangedHTML
ActiveBeatsChanged.net
activeBeatsChangedAndroid
This event is fired when the currently active beats across all tracks change.
beatMouseDownJavaScriptalphaTab.beatMouseDownjQuery
alphaTab.beatMouseDownHTML
BeatMouseDown.net
beatMouseDownAndroid
This event is fired whenever a the user presses the mouse button on a beat.
beatMouseMoveJavaScriptalphaTab.beatMouseMovejQuery
alphaTab.beatMouseMoveHTML
BeatMouseMove.net
beatMouseMoveAndroid
This event is fired whenever the user moves the mouse over a beat after the user already pressed the button on a beat.
beatMouseUpJavaScriptalphaTab.beatMouseUpjQuery
alphaTab.beatMouseUpHTML
BeatMouseUp.net
beatMouseUpAndroid
This event is fired whenever the user releases the mouse after a mouse press on a beat.
midiEventsPlayedJavaScriptalphaTab.midiEventsPlayedjQuery
alphaTab.midiEventsPlayedHTML
MidiEventsPlayed.net
midiEventsPlayedAndroid
The midi events which will trigger the `midiEventsPlayed` event
midiLoadJavaScriptalphaTab.midiLoadjQuery
alphaTab.midiLoadHTML
MidiLoad.net
midiLoadAndroid
This event is fired when a Midi file is being loaded.
midiLoadedJavaScriptalphaTab.midiLoadedjQuery
alphaTab.midiLoadedHTML
MidiLoaded.net
midiLoadedAndroid
This event is fired when the Midi file needed for playback was loaded.
noteMouseDownJavaScriptalphaTab.noteMouseDownjQuery
alphaTab.noteMouseDownHTML
NoteMouseDown.net
noteMouseDownAndroid
This event is fired whenever a the user presses the mouse button on a note head/number.
noteMouseMoveJavaScriptalphaTab.noteMouseMovejQuery
alphaTab.noteMouseMoveHTML
NoteMouseMove.net
noteMouseMoveAndroid
This event is fired whenever the user moves the mouse over a note after the user already pressed the button on a note.
noteMouseUpJavaScriptalphaTab.noteMouseUpjQuery
alphaTab.noteMouseUpHTML
NoteMouseUp.net
noteMouseUpAndroid
This event is fired whenever the user releases the mouse after a mouse press on a note.
playbackRangeChangedJavaScriptalphaTab.playbackRangeChangedjQuery
alphaTab.playbackRangeChangedHTML
PlaybackRangeChanged.net
playbackRangeChangedAndroid
This event is fired when the playback range changed.
playedBeatChangedJavaScriptalphaTab.playedBeatChangedjQuery
alphaTab.playedBeatChangedHTML
PlayedBeatChanged.net
playedBeatChangedAndroid
This event is fired when the played beat changed.
playerFinishedJavaScriptalphaTab.playerFinishedjQuery
alphaTab.playerFinishedHTML
PlayerFinished.net
playerFinishedAndroid
This event is fired when the playback of the whole song finished.
playerPositionChangedJavaScriptalphaTab.playerPositionChangedjQuery
alphaTab.playerPositionChangedHTML
PlayerPositionChanged.net
playerPositionChangedAndroid
This event is fired when the playback state changed.
playerReadyJavaScriptalphaTab.playerReadyjQuery
alphaTab.playerReadyHTML
PlayerReady.net
playerReadyAndroid
This event is fired when all required data for playback is loaded and ready.
playerStateChangedJavaScriptalphaTab.playerStateChangedjQuery
alphaTab.playerStateChangedHTML
PlayerStateChanged.net
playerStateChangedAndroid
This event is fired when the playback state changed.
soundFontLoadJavaScriptalphaTab.soundFontLoadjQuery
alphaTab.soundFontLoadHTML
SoundFontLoad.net
soundFontLoadAndroid
This event is fired when the SoundFont is being loaded.
soundFontLoadedJavaScriptalphaTab.soundFontLoadedjQuery
alphaTab.soundFontLoadedHTML
SoundFontLoaded.net
soundFontLoadedAndroid
This event is fired when the SoundFont needed for playback was loaded.
Methods - Core
alphaTab()jQueryInitializes AlphaTab.
destroy()JavaScriptalphaTab('destroy')jQuery
Destroy().net
destroy()Android
Destroys the alphaTab control and restores the initial state of the UI.
downloadMidi()JavaScriptalphaTab('downloadMidi')jQueryGenerates an SMF1.0 file and downloads it
load()JavaScriptalphaTab('load')jQuery
Load().net
load()Android
Initiates a load of the score using the given data.
print()JavaScriptalphaTab('print')jQueryOpens a popup window with the rendered music notation for printing.
render()JavaScriptalphaTab('render')jQuery
Render().net
render()Android
Initiates a re-rendering of the current setup.
renderScore()JavaScriptalphaTab('renderScore')jQuery
RenderScore().net
renderScore()Android
Initiates a rendering of the given score.
renderTracks()JavaScriptalphaTab('renderTracks')jQuery
RenderTracks().net
renderTracks()Android
Initiates a rendering of the given tracks.
tex()JavaScriptalphaTab('tex')jQuery
Tex().net
tex()Android
Tells alphaTab to render the given alphaTex.
updateSettings()JavaScriptalphaTab('updateSettings')jQuery
UpdateSettings().net
updateSettings()Android
Applies any changes that were done to the settings object and informs the Renderer about any new values to consider.
Methods - Player
changeTrackMute()JavaScriptalphaTab('muteTracks')jQuery
ChangeTrackMute().net
changeTrackMute()Android
Changes the given tracks to be muted or not.
changeTrackSolo()JavaScriptalphaTab('soloTracks')jQuery
ChangeTrackSolo().net
changeTrackSolo()Android
Changes the given tracks to be played solo or not.
changeTrackVolume()JavaScriptalphaTab('trackVolume')jQuery
ChangeTrackVolume().net
changeTrackVolume()Android
Changes the volume of the given tracks.
loadSoundFont()JavaScriptalphaTab('loadSoundFont')jQuery
LoadSoundFont().net
loadSoundFont()Android
Triggers a load of the soundfont from the given data.
pause()JavaScriptalphaTab('pause')jQuery
Pause().net
pause()Android
Pauses the playback of the current song.
play()JavaScriptalphaTab('play')jQuery
Play().net
play()Android
Starts the playback of the current song.
playBeat()JavaScriptalphaTab('playBeat')jQuery
PlayBeat().net
playBeat()Android
Triggers the play of the given beat.
playNote()JavaScriptalphaTab('playNote')jQuery
PlayNote().net
playNote()Android
Triggers the play of the given note.
playPause()JavaScriptalphaTab('playPause')jQuery
PlayPause().net
playPause()Android
Toggles between play/pause depending on the current player state.
resetSoundFonts()JavaScriptalphaTab('resetSoundFonts')jQuery
ResetSoundFonts().net
resetSoundFonts()Android
Unloads all presets from previously loaded SoundFonts.
stop()JavaScriptalphaTab('stop')jQuery
Stop().net
stop()Android
Stops the playback of the current song, and moves the playback position back to the start.
Properties - Core
containerJavaScriptalphaTab('container')jQuery
Container.net
containerAndroid
The UI container that holds the whole alphaTab control.
rendererJavaScriptalphaTab('renderer')jQuery
Renderer.net
rendererAndroid
The score renderer used for rendering the music sheet. This is the low-level API responsible for the actual rendering chain.
scoreJavaScriptalphaTab('score')jQuery
Score.net
scoreAndroid
The score holding all information about the song being rendered
settingsJavaScriptalphaTab('settings')jQuery
Settings.net
settingsAndroid
The settings that are used for rendering the music notation
alphaTab('api')jQueryReturns the underlying API object.
tracksJavaScriptalphaTab('tracks')jQuery
Tracks.net
tracksAndroid
A list of the tracks that should be rendered based on the Score and TrackIndexes properties
Properties - Player
countInVolumeJavaScriptalphaTab('countInVolume')jQuery
CountInVolume.net
countInVolumeAndroid
The volume of the count-in metronome ticks
isLoopingJavaScriptalphaTab('looping')jQuery
IsLooping.net
isLoopingAndroid
Whether the playback should automatically restart after it finished
isReadyForPlaybackJavaScriptalphaTab('isReadyForPlayback')jQuery
IsReadyForPlayback.net
isReadyForPlaybackAndroid
Whether the player is ready for starting the playback.
masterVolumeJavaScriptalphaTab('masterVolume')jQuery
MasterVolume.net
masterVolumeAndroid
The current master volume as percentage
metronomeVolumeJavaScriptalphaTab('metronomeVolume')jQuery
MetronomeVolume.net
metronomeVolumeAndroid
The metronome volume as percentage
midiEventsPlayedFilterJavaScriptalphaTab('midiEventsPlayedFilter')jQuery
MidiEventsPlayedFilter.net
midiEventsPlayedFilterAndroid
The midi events which will trigger the `midiEventsPlayed` event
playbackRangeJavaScriptalphaTab('playbackRange')jQuery
PlaybackRange.net
playbackRangeAndroid
The range of the song that should be played
playbackSpeedJavaScriptalphaTab('playbackSpeed')jQuery
PlaybackSpeed.net
playbackSpeedAndroid
The current playback speed as percentage
playerJavaScriptalphaTab('player')jQuery
Player.net
playerAndroid
The alphaSynth player used for playback. This is the low-level API to the Midi synthesizer used for playback.
playerStateJavaScriptalphaTab('playerState')jQuery
PlayerState.net
playerStateAndroid
The current player state
tickCacheJavaScriptalphaTab('tickCache')jQuery
TickCache.net
tickCacheAndroid
The tick cache allowing lookup of midi ticks to beats.
tickPositionJavaScriptalphaTab('tickPosition')jQuery
TickPosition.net
tickPositionAndroid
The position within the song in midi ticks
timePositionJavaScriptalphaTab('timePosition')jQuery
TimePosition.net
timePositionAndroid
The position within the song in milliseconds