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
errorAll

This event is fired when an error within alphatab occurred.

postRenderFinishedAll

This event is fired when the rendering of the whole music sheet is finished, and all handlers of renderFinished ran.

renderFinishedAll

This event is fired when the rendering of the whole music sheet is finished.

renderStartedAll

This event is fired when the rendering of the whole music sheet is starting.

resizeAll

This event is fired when alphaTab was resized and is about to rerender the music notation.

scoreLoadedAll

This event is fired whenever a new song is loaded.

settingsUpdatedAll

This event is fired when a settings update was requested.

Events - Player
activeBeatsChangedAll

This event is fired when the currently active beats across all tracks change.

beatMouseDownAll

This event is fired whenever a the user presses the mouse button on a beat.

beatMouseMoveAll

This event is fired whenever the user moves the mouse over a beat after the user already pressed the button on a beat.

beatMouseUpAll

This event is fired whenever the user releases the mouse after a mouse press on a beat.

midiEventsPlayedAll

This event is fired when the synthesizer played certain midi events.

midiLoadAll

This event is fired when a Midi file is being loaded.

midiLoadedAll

This event is fired when the Midi file needed for playback was loaded.

noteMouseDownAll

This event is fired whenever a the user presses the mouse button on a note head/number.

noteMouseMoveAll

This event is fired whenever the user moves the mouse over a note after the user already pressed the button on a note.

noteMouseUpAll

This event is fired whenever the user releases the mouse after a mouse press on a note.

playbackRangeChangedAll

This event is fired when the playback range changed.

playedBeatChangedAll

This event is fired when the played beat changed.

playerFinishedAll

This event is fired when the playback of the whole song finished.

playerPositionChangedAll

This event is fired when the current playback position of the song changed.

playerReadyAll

This event is fired when all required data for playback is loaded and ready.

playerStateChangedAll

This event is fired when the playback state changed.

soundFontLoadJavaScript

This event is fired when the SoundFont is being loaded.

soundFontLoadedAll

This event is fired when the SoundFont needed for playback was loaded.

Methods - Core
destroyAll

Destroys the alphaTab control and restores the initial state of the UI.

downloadMidiJavaScript

Generates an SMF1.0 file and downloads it

printJavaScript

Opens a popup window with the rendered music notation for printing.

renderAll

Initiates a re-rendering of the current setup.

renderScoreAll

Initiates a rendering of the given score.

renderTracksAll

Renders the given list of tracks.

texAll

Tells alphaTab to render the given alphaTex.

updateSettingsAll

Applies any changes that were done to the settings object.

Methods - Player
changeTrackMuteAll

Changes the given tracks to be muted or not.

changeTrackSoloAll

Changes the given tracks to be played solo or not.

changeTrackTranspositionPitchAll

Changes the pitch transpose applied to the given tracks.

changeTrackVolumeAll

Changes the volume of the given tracks.

enumerateOutputDevicesAll

Loads and lists the available output devices which can be used by the player.

exportAudioAll

Starts the audio export for the currently loaded song.

getOutputDeviceAll

The currently configured output device if changed via setOutputDevice.

loadAll

Initiates a load of the score using the given data.

loadMidiForScoreAll

Re-creates the midi for the current score and loads it.

loadSoundFontAll

Triggers a load of the soundfont from the given data.

loadSoundFontFromUrlJavaScript

Triggers a load of the soundfont from the given URL.

pauseAll

Pauses the playback of the current song.

playAll

Starts the playback of the current song.

playBeatAll

Triggers the play of the given beat.

playNoteAll

Triggers the play of the given note.

playPauseAll

Toggles between play/pause depending on the current player state.

resetSoundFontsAll

Unloads all presets from previously loaded SoundFonts.

scrollToCursorAll

Initiates a scroll to the cursor.

setOutputDeviceAll

Changes the output device which should be used for playing the audio (player must be enabled).

stopAll

Stops the playback of the current song, and moves the playback position back to the start.

updateSyncPointsAll

Triggers an update of the sync points for the current score after modification within the data model

Properties - Core
boundsLookupAll

The tick cache allowing lookup of midi ticks to beats.

canvasElementAll

The UI container that will hold all rendered results.

containerAll

The UI container that holds the whole alphaTab control.

rendererAll

The score renderer used for rendering the music sheet.

scoreAll

The score holding all information about the song being rendered

settingsAll

The settings that are used for rendering the music notation.

tracksAll

The list of the tracks that are currently rendered.

uiFacadeAll

The UI facade used for interacting with the user interface (like the browser).

Properties - Player
actualPlayerModeAll

The actual player mode which is currently active.

countInVolumeAll

The volume of the count-in metronome ticks.

endTickAll

The total length of the song in midi ticks.

endTimeAll

The total length of the song in milliseconds.

isLoopingAll

Whether the playback should automatically restart after it finished.

isReadyForPlaybackAll

Whether the player is ready for starting the playback.

masterVolumeAll

The current master volume as percentage (0-1).

metronomeVolumeAll

The metronome volume as percentage (0-1).

midiEventsPlayedFilterAll

The midi events which will trigger the midiEventsPlayed event

playbackRangeAll

The range of the song that should be played.

playbackSpeedAll

The current playback speed as percentage

playerAll

The alphaSynth player used for playback.

playerStateAll

The current player state.

tickCacheAll

The tick cache allowing lookup of midi ticks to beats.

tickPositionAll

The position within the song in midi ticks.

timePositionAll

The position within the song in milliseconds