Is there an existing issue for this?
Current Behavior
Calling api.playBeat(beat) or api.playNote(note) silently fails to produce audio, even though:
api.isReadyForPlayback is true
api.playerState is Paused (0)
- The SoundFont has loaded (
soundFontLoaded fired)
- Transport playback via
api.play() / api.playPause() works correctly on the same API instance with the same SoundFont
and score
- No exception is thrown by playBeat/playNote
- The alphaSynth.playOneTimeMidiFile message reaches the synth worker (verified via the postMessage path)
The worker output emits no samples. Reproduces on both player.outputMode = WebAudioAudioWorklets (default) and
WebAudioScriptProcessor.
Additional bug found while debugging: AlphaSynthWebWorkerApi.loadedMidiInfo getter is self-referential:
get loadedMidiInfo() {
return this.loadedMidiInfo; // infinite recursion
}
This causes RangeError: Maximum call stack size exceeded whenever the API-side midiLoaded EventEmitterOfT is subscribed after a midi has been loaded — because its fireOnRegister callback reads this._player.loadedMidiInfo. The getter should return this._loadedMidiInfo`.
Expected Behavior
api.playBeat(beat) reproduces the beat's notes through the active SoundFont preset for the track that owns the beat, identical to what transport playback would emit if the cursor were positioned at that beat.
api.loadedMidiInfo returns the cached PositionChangedEventArgs without recursion, so midiLoaded.on(...)
registrations succeed after the first midi load.
Steps To Reproduce
- Create
AlphaTabApi instance with player.enablePlayer = true and a valid SoundFont URL.
- Load a score (any .gp/.gp5 import, or a manually built Score).
- Wait for
readyForPlayback event.
- Confirm transport:
api.play() — audio is audible. Pause/stop.
- Call
api.playBeat(api.score.tracks[0].staves[0].bars[0].voices[0].beats[0]).
- Observed: no audio output. Expected: audio of the beat.
Link to jsFiddle, CodePen, Project
No response
Version and Environment
- @coderline/alphatab 1.8.2 (npm)
- Bundled via Vite 5 in a React 18.3 app, ESM build (alphaTab.core.mjs)
- Self-hosted SoundFonts (tested with GeneralUser-GS.sf2, FluidR3Mono_GM.sf3, MS_Basic.sf3, and the alphaTab CDN
Sonivox)
- Same-origin asset serving (no CORS issues)
- Player settings: enablePlayer: true, enableCursor: true, enableUserInteraction: true, scrollMode: 'Continuous'
Platform
Web
Anything else?
No response
Is there an existing issue for this?
Current Behavior
Calling
api.playBeat(beat)orapi.playNote(note)silently fails to produce audio, even though:api.isReadyForPlaybackis trueapi.playerStateis Paused (0)soundFontLoadedfired)api.play()/api.playPause()works correctly on the same API instance with the same SoundFontand score
The worker output emits no samples. Reproduces on both player.outputMode = WebAudioAudioWorklets (default) and
WebAudioScriptProcessor.
Additional bug found while debugging:
AlphaSynthWebWorkerApi.loadedMidiInfogetter is self-referential:This causes
RangeError: Maximum call stack size exceeded whenever the API-side midiLoaded EventEmitterOfT is subscribed after a midi has been loaded— because itsfireOnRegistercallback readsthis._player.loadedMidiInfo. The getter should returnthis._loadedMidiInfo`.Expected Behavior
api.playBeat(beat)reproduces the beat's notes through the active SoundFont preset for the track that owns the beat, identical to what transport playback would emit if the cursor were positioned at that beat.api.loadedMidiInforeturns the cachedPositionChangedEventArgswithout recursion, somidiLoaded.on(...)registrations succeed after the first midi load.
Steps To Reproduce
AlphaTabApiinstance withplayer.enablePlayer = trueand a valid SoundFont URL.readyForPlaybackevent.api.play()— audio is audible. Pause/stop.api.playBeat(api.score.tracks[0].staves[0].bars[0].voices[0].beats[0]).Link to jsFiddle, CodePen, Project
No response
Version and Environment
Platform
Web
Anything else?
No response