alphaTab.synth.IAlphaSynth
The public API interface for interacting with the synthesizer.
interface IAlphaSynthPropertiesโ
countInVolumeโ
Gets or sets volume of the metronome during count-in. (range: 0.0-3.0, default 0.0 - no count in)
- JavaScript
- C#
- Kotlin
countInVolume: number;double CountInVolume { get; set; }var countInVolume: DoublecurrentPositionโ
The latest time information of the played song.
- JavaScript
- C#
- Kotlin
readonly currentPosition: PositionChangedEventArgs;PositionChangedEventArgs CurrentPosition { get; }val currentPosition: PositionChangedEventArgsisLoopingโ
Gets or sets whether the playback should automatically restart after it finished.
- JavaScript
- C#
- Kotlin
isLooping: boolean;bool IsLooping { get; set; }var isLooping: BooleanisReadyโ
Gets or sets whether the synthesizer is ready for interaction. (output and worker are initialized)
- JavaScript
- C#
- Kotlin
readonly isReady: boolean;bool IsReady { get; }val isReady: BooleanisReadyForPlaybackโ
Gets or sets whether the synthesizer is ready for playback. (output, worker are initialized, soundfont and midi are loaded)
- JavaScript
- C#
- Kotlin
readonly isReadyForPlayback: boolean;bool IsReadyForPlayback { get; }val isReadyForPlayback: BooleanloadedMidiInfoโ
The information about the main song loaded (does not account for "one time midis" or "count in").
- JavaScript
- C#
- Kotlin
readonly loadedMidiInfo?: PositionChangedEventArgs;PositionChangedEventArgs LoadedMidiInfo { get; }val loadedMidiInfo: PositionChangedEventArgslogLevelโ
Gets or sets the loging level.
masterVolumeโ
Gets or sets the current master volume as percentage. (range: 0.0-3.0, default 1.0)
- JavaScript
- C#
- Kotlin
masterVolume: number;double MasterVolume { get; set; }var masterVolume: DoublemetronomeVolumeโ
Gets or sets the metronome volume. (range: 0.0-3.0, default 0.0)
- JavaScript
- C#
- Kotlin
metronomeVolume: number;double MetronomeVolume { get; set; }var metronomeVolume: DoublemidiEventsPlayedFilterโ
Gets or sets the midi events which will trigger the midiEventsPlayed event.
- JavaScript
- C#
- Kotlin
midiEventsPlayedFilter: MidiEventType[];IList<MidiEventType> MidiEventsPlayedFilter { get; set; }var midiEventsPlayedFilter: alphaTab.collections.List<MidiEventType>outputโ
Gets the output used by alphaSynth.
- JavaScript
- C#
- Kotlin
playbackRangeโ
Gets or sets the range of the song that should be played. Set this to null to play the whole song.
- JavaScript
- C#
- Kotlin
playbackRange: PlaybackRange | null;PlaybackRange? PlaybackRange { get; set; }var playbackRange: PlaybackRange?playbackSpeedโ
Gets or sets the current playback speed as percentage. (range: 0.125-8.0, default: 1.0)
- JavaScript
- C#
- Kotlin
playbackSpeed: number;double PlaybackSpeed { get; set; }var playbackSpeed: Doublereadyโ
This event is fired when the player is ready to be interacted with.
- JavaScript
- C#
- Kotlin
readyForPlaybackโ
This event is fired when all required data for playback is loaded and ready.
- JavaScript
- C#
- Kotlin
readonly readyForPlayback: IEventEmitter;IEventEmitter ReadyForPlayback { get; }val readyForPlayback: IEventEmitterstateโ
Gets the current player state.
- JavaScript
- C#
- Kotlin
tickPositionโ
Gets or sets the position within the song in midi ticks.
- JavaScript
- C#
- Kotlin
tickPosition: number;double TickPosition { get; set; }var tickPosition: DoubletimePositionโ
Gets or sets the position within the song in milliseconds.
- JavaScript
- C#
- Kotlin
timePosition: number;double TimePosition { get; set; }var timePosition: DoubleMethodsโ
applyTranspositionPitchesโ
Applies the given transposition pitches to be used during playback.
- JavaScript
- C#
- Kotlin
applyTranspositionPitches(transpositionPitches: Map<number, number>): voidvoid ApplyTranspositionPitches(Map<double, double> transpositionPitches)fun applyTranspositionPitches(transpositionPitches: alphaTab.collections.DoubleDoubleMap<Double, Double>): Unit| Parameter | Summary |
|---|---|
transpositionPitchesAll | a map defining the transposition pitches for midi channel. |
destroyโ
Destroys the synthesizer and all related components
- JavaScript
- C#
- Kotlin
destroy(): voidvoid Destroy()fun destroy(): UnitloadBackingTrackโ
Loads the synchronization information from the given score (used for backing tracks and external media).
| Parameter | Summary |
|---|---|
scoreAll | (no description) |
loadMidiFileโ
Loads the given midi file structure.
| Parameter | Summary |
|---|---|
midiAll | (no description) |
loadSoundFontโ
Loads a soundfont from the given data
- JavaScript
- C#
- Kotlin
loadSoundFont(data: Uint8Array, append: boolean): voidvoid LoadSoundFont(Uint8Array data, bool append)fun loadSoundFont(data: Uint8Array, append: Boolean): Unit| Parameter | Summary |
|---|---|
dataAll | a byte array to load the data from |
appendAll | Whether to fully replace or append the data from the given soundfont. |
pauseโ
Pauses the playback if was running
- JavaScript
- C#
- Kotlin
pause(): voidvoid Pause()fun pause(): Unitplayโ
Starts the playback if possible
- JavaScript
- C#
- Kotlin
play(): booleanbool Play()fun play(): BooleanReturnsโ
true if the playback was started, otherwise false. Reasons for not starting can be that the player is not ready or already playing.
playOneTimeMidiFileโ
Stops any ongoing playback and plays the given midi file instead.
| Parameter | Summary |
|---|---|
midiAll | The midi file to play |
playPauseโ
Starts the playback if possible, pauses the playback if was running
- JavaScript
- C#
- Kotlin
playPause(): voidvoid PlayPause()fun playPause(): UnitresetChannelStatesโ
Resets the mute/solo state of all channels
- JavaScript
- C#
- Kotlin
resetChannelStates(): voidvoid ResetChannelStates()fun resetChannelStates(): UnitresetSoundFontsโ
Resets all loaded soundfonts as if they were not loaded.
- JavaScript
- C#
- Kotlin
resetSoundFonts(): voidvoid ResetSoundFonts()fun resetSoundFonts(): UnitsetChannelMuteโ
Sets the mute state of a channel.
- JavaScript
- C#
- Kotlin
setChannelMute(channel: number, mute: boolean): voidvoid SetChannelMute(double channel, bool mute)fun setChannelMute(channel: Double, mute: Boolean): Unit| Parameter | Summary |
|---|---|
channelAll | The channel number |
muteAll | true if the channel should be muted, otherwise false. |
setChannelSoloโ
Gets the solo state of a channel.
- JavaScript
- C#
- Kotlin
setChannelSolo(channel: number, solo: boolean): voidvoid SetChannelSolo(double channel, bool solo)fun setChannelSolo(channel: Double, solo: Boolean): Unit| Parameter | Summary |
|---|---|
channelAll | The channel number |
soloAll | true if the channel should be played solo, otherwise false. |
setChannelTranspositionPitchโ
Sets the transposition pitch of a given channel. This pitch is additionally applied beside the
ones applied already via applyTranspositionPitches .
- JavaScript
- C#
- Kotlin
setChannelTranspositionPitch(channel: number, semitones: number): voidvoid SetChannelTranspositionPitch(double channel, double semitones)fun setChannelTranspositionPitch(channel: Double, semitones: Double): Unit| Parameter | Summary |
|---|---|
channelAll | The channel number |
semitonesAll | The number of semitones to apply as pitch offset. |
setChannelVolumeโ
Gets or sets the current and initial volume of the given channel.
- JavaScript
- C#
- Kotlin
setChannelVolume(channel: number, volume: number): voidvoid SetChannelVolume(double channel, double volume)fun setChannelVolume(channel: Double, volume: Double): Unit| Parameter | Summary |
|---|---|
channelAll | The channel number. |
volumeAll | The volume of of the channel (0.0-1.0) |
stopโ
Stopps the playback
- JavaScript
- C#
- Kotlin
stop(): voidvoid Stop()fun stop(): UnitupdateSyncPointsโ
Updates the points used to synchronize the backing track with the synthesized audio for correct cursor placement.
- JavaScript
- C#
- Kotlin
updateSyncPoints(syncPoints: BackingTrackSyncPoint[]): voidvoid UpdateSyncPoints(IList<BackingTrackSyncPoint> syncPoints)fun updateSyncPoints(syncPoints: alphaTab.collections.List<BackingTrackSyncPoint>): Unit| Parameter | Summary |
|---|---|
syncPointsAll | (no description) |
Eventsโ
finishedโ
This event is fired when the playback of the whole song finished.
This event is fired when the playback of the whole song finished.
- JavaScript
- C#
- Kotlin
midiEventsPlayedโ
The event is fired when certain midi events were sent to the audio output device for playback.
The event is fired when certain midi events were sent to the audio output device for playback.
- JavaScript
- C#
- Kotlin
readonly midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>;IEventEmitterOfT<MidiEventsPlayedEventArgs> MidiEventsPlayed { get; }val midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>midiLoadedโ
This event is fired when the Midi file needed for playback was loaded.
This event is fired when the Midi file needed for playback was loaded.
- JavaScript
- C#
- Kotlin
readonly midiLoaded: IEventEmitterOfT<PositionChangedEventArgs>;IEventEmitterOfT<PositionChangedEventArgs> MidiLoaded { get; }val midiLoaded: IEventEmitterOfT<PositionChangedEventArgs>midiLoadFailedโ
This event is fired when the loading of the Midi file failed.
This event is fired when the loading of the Midi file failed.
- JavaScript
- C#
- Kotlin
readonly midiLoadFailed: IEventEmitterOfT<Error>;IEventEmitterOfT<System.Exception> MidiLoadFailed { get; }val midiLoadFailed: IEventEmitterOfT<kotlin.Throwable>playbackRangeChangedโ
The event is fired when the playback range within the player was updated.
The event is fired when the playback range within the player was updated.
- JavaScript
- C#
- Kotlin
readonly playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>;IEventEmitterOfT<PlaybackRangeChangedEventArgs> PlaybackRangeChanged { get; }val playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>positionChangedโ
This event is fired when the current playback position of/ the song changed.
This event is fired when the current playback position of/ the song changed.
- JavaScript
- C#
- Kotlin
readonly positionChanged: IEventEmitterOfT<PositionChangedEventArgs>;IEventEmitterOfT<PositionChangedEventArgs> PositionChanged { get; }val positionChanged: IEventEmitterOfT<PositionChangedEventArgs>soundFontLoadedโ
This event is fired when the SoundFont needed for playback was loaded.
This event is fired when the SoundFont needed for playback was loaded.
- JavaScript
- C#
- Kotlin
readonly soundFontLoaded: IEventEmitter;IEventEmitter SoundFontLoaded { get; }val soundFontLoaded: IEventEmittersoundFontLoadFailedโ
This event is fired when the loading of the SoundFont failed.
This event is fired when the loading of the SoundFont failed.
- JavaScript
- C#
- Kotlin
readonly soundFontLoadFailed: IEventEmitterOfT<Error>;IEventEmitterOfT<System.Exception> SoundFontLoadFailed { get; }val soundFontLoadFailed: IEventEmitterOfT<kotlin.Throwable>stateChangedโ
This event is fired when the playback state changed.
This event is fired when the playback state changed.
- JavaScript
- C#
- Kotlin
readonly stateChanged: IEventEmitterOfT<PlayerStateChangedEventArgs>;IEventEmitterOfT<PlayerStateChangedEventArgs> StateChanged { get; }val stateChanged: IEventEmitterOfT<PlayerStateChangedEventArgs>