AlphaSynth

AlphaSynth is one of the low level APIs that can be used if no full alphaTab API object with UI interaction can be used or is needed. It is the audio synthesis engine of alphaTab which is used to play a midi file using a generated midi file and a SoundFont as input.

This page describes all methods, properties and events exposed by this class. Most of the API methods exposed by the IAlphaSynth interface are also directly available on the normal API object. That's why many documentation pages delegate to the related documentation pages there.

NameSummary
Events
finishedJavaScript
Finished.net
This event is fired when the playback of the whole song finished.
midiLoadedJavaScript
MidiLoaded.net
This event is fired when the Midi needed for playback was loaded.
midiLoadFailedJavaScript
MidiLoadFailed.net
This event is fired when the loading of the Midi failed.
positionChangedJavaScript
PositionChanged.net
This event is fired when the playback state changed.
readyJavaScript
Ready.net
Fired when the player is ready to be interacted with.
readyForPlaybackJavaScript
ReadyForPlayback.net
This event is fired when all required data for playback is loaded and ready.
soundFontLoadedJavaScript
SoundFontLoaded.net
This event is fired when the SoundFont needed for playback was loaded.
soundFontLoadFailedJavaScript
SoundFontLoadFailed.net
This event is fired when the loading of the SoundFont failed.
stateChangedJavaScript
StateChanged.net
This event is fired when the playback state changed.
Methods
destroy()JavaScript
Destroy().net
Destroys the synthesizer and all related components.
loadMidiFile()JavaScript
LoadMidiFile().net
Triggers a load of the given midi file.
loadSoundFont()JavaScript
LoadSoundFont().net
Triggers a load of the soundfont from the given data.
pause()JavaScript
Pause().net
Pauses the playback of the current song.
play()JavaScript
Play().net
Starts the playback of the current song.
playPause()JavaScript
PlayPause().net
Toggles between play/pause depending on the current player state.
resetChannelStates()JavaScript
ResetChannelStates().net
Resets the mute/solo change of all channels.
setChannelMute()JavaScript
SetChannelMute().net
Mutes or unmutes a single midi channel.
setChannelSolo()JavaScript
SetChannelSolo().net
Flags a single midi channel to e played solo or not.
setChannelVolume()JavaScript
SetChannelVolume().net
Sets the current and initial volume of the given channel.
stop()JavaScript
Stop().net
Stops the playback of the current song, and moves the playback position back to the start.
Properties
isLoopingJavaScript
IsLooping.net
Whether the playback should automatically restart after it finished
isReadyJavaScript
IsReady.net
If the synthesizer is ready for interaction.
isReadyForPlaybackJavaScript
IsReadyForPlayback.net
If the synthesizer is ready for playback.
logLevelJavaScript
LogLevel.net
The log level to use within alphaSynth.
masterVolumeJavaScript
MasterVolume.net
The current master volume as percentage
metronomeVolumeJavaScript
MetronomeVolume.net
The metronome volume as percentage
playbackRangeJavaScript
PlaybackRange.net
The range of the song that should be played
playbackSpeedJavaScript
PlaybackSpeed.net
The current playback speed as percentage
stateJavaScript
State.net
The current player state.
tickPositionJavaScript
TickPosition.net
The position within the song in midi ticks
timePositionJavaScript
TimePosition.net
The position within the song in milliseconds