Skip to main content

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
finishedAndroid
This event is fired when the playback of the whole song finished.
midiEventsPlayedJavaScript
MidiEventsPlayed.net
midiEventsPlayedAndroid
The midi events which will trigger the `midiEventsPlayed` event
midiLoadFailedJavaScript
MidiLoadFailed.net
midiLoadFailedAndroid
This event is fired when the loading of the Midi failed.
midiLoadedJavaScript
MidiLoaded.net
midiLoadedAndroid
This event is fired when the Midi needed for playback was loaded.
playbackRangeChangedJavaScript
PlaybackRangeChanged.net
playbackRangeChangedAndroid
This event is fired when the playback range changed.
positionChangedJavaScript
PositionChanged.net
positionChangedAndroid
This event is fired when the playback state changed.
readyJavaScript
Ready.net
readyAndroid
Fired when the player is ready to be interacted with.
readyForPlaybackJavaScript
ReadyForPlayback.net
readyForPlaybackAndroid
This event is fired when all required data for playback is loaded and ready.
soundFontLoadFailedJavaScript
SoundFontLoadFailed.net
soundFontLoadFailedAndroid
This event is fired when the loading of the SoundFont failed.
soundFontLoadedJavaScript
SoundFontLoaded.net
soundFontLoadedAndroid
This event is fired when the SoundFont needed for playback was loaded.
stateChangedJavaScript
StateChanged.net
stateChangedAndroid
This event is fired when the playback state changed.
Methods
destroy()JavaScript
Destroy().net
destroy()Android
Destroys the synthesizer and all related components.
loadMidiFile()JavaScript
LoadMidiFile().net
loadMidiFile()Android
Triggers a load of the given midi file.
loadSoundFont()JavaScript
LoadSoundFont().net
loadSoundFont()Android
Triggers a load of the soundfont from the given data.
pause()JavaScript
Pause().net
pause()Android
Pauses the playback of the current song.
play()JavaScript
Play().net
play()Android
Starts the playback of the current song.
playPause()JavaScript
PlayPause().net
playPause()Android
Toggles between play/pause depending on the current player state.
resetChannelStates()JavaScript
ResetChannelStates().net
resetChannelStates()Android
Resets the mute/solo change of all channels.
setChannelMute()JavaScript
SetChannelMute().net
setChannelMute()Android
Mutes or unmutes a single midi channel.
setChannelSolo()JavaScript
SetChannelSolo().net
setChannelSolo()Android
Flags a single midi channel to e played solo or not.
setChannelVolume()JavaScript
SetChannelVolume().net
setChannelVolume()Android
Sets the current and initial volume of the given channel.
stop()JavaScript
Stop().net
stop()Android
Stops the playback of the current song, and moves the playback position back to the start.
Properties
countInVolumeJavaScript
CountInVolume.net
countInVolumeAndroid
The volume of the count-in metronome ticks
isLoopingJavaScript
IsLooping.net
isLoopingAndroid
Whether the playback should automatically restart after it finished
isReadyJavaScript
IsReady.net
isReadyAndroid
If the synthesizer is ready for interaction.
isReadyForPlaybackJavaScript
IsReadyForPlayback.net
isReadyForPlaybackAndroid
If the synthesizer is ready for playback.
logLevelJavaScript
LogLevel.net
logLevelAndroid
The log level to use within alphaSynth.
masterVolumeJavaScript
MasterVolume.net
masterVolumeAndroid
The current master volume as percentage
metronomeVolumeJavaScript
MetronomeVolume.net
metronomeVolumeAndroid
The metronome volume as percentage
midiEventsPlayedFilterJavaScript
MidiEventsPlayedFilter.net
midiEventsPlayedFilterAndroid
The midi events which will trigger the `midiEventsPlayed` event
playbackRangeJavaScript
PlaybackRange.net
playbackRangeAndroid
The range of the song that should be played
playbackSpeedJavaScript
PlaybackSpeed.net
playbackSpeedAndroid
The current playback speed as percentage
stateJavaScript
State.net
stateAndroid
The current player state.
tickPositionJavaScript
TickPosition.net
tickPositionAndroid
The position within the song in midi ticks
timePositionJavaScript
TimePosition.net
timePositionAndroid
The position within the song in milliseconds