diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index 59227ee..491bf6e 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -103,7 +103,13 @@ } } try { - await _synthInstance.soundBankManager.addSoundBank(buffer, sfId); + // Clone buffer before sending to worklet (avoids transfer neutering) + const bufCopy = buffer.slice(0); + await _synthInstance.soundBankManager.addSoundBank(bufCopy, sfId); + await _synthInstance.isReady; + // Force program 0 on channel 0 to activate loaded bank + this.controllerChange(0, 0, 0); + this.programChange(0, 0); _currentSfId = sfId; console.log("[SonicSF] SoundFont loaded:", sfId); } catch (e) {