magenta-js icon indicating copy to clipboard operation
magenta-js copied to clipboard

Unable to use Tone.js OfflineAudioContext with Soundfont Player

Open this-fifo opened this issue 11 months ago • 0 comments

Hey Magenta Team!

I've recently encountered an issue where I'm trying to use the Tone.js library for offline audio rendering with Magenta's Soundfont player.

I am using Tone.js for sequencing and playing music, and specifically, I'm using the Tone.js OfflineAudioContext to render the audio offline for downloading the song.

The issue arises in that the Soundfont Player seems to use Tone.js's global context, which is a different instance than the OfflineAudioContext provided by Tone.Offline. This results in an error when trying to connect nodes from these two different AudioContexts.

Uncaught (in promise) DOMException: AudioNode.connect: Can't connect nodes from different AudioContexts

I'd appreciate any guidance or advice on what to do here, I feel like I hit a wall and I'm not sure if I'm approaching this the right way anymore.

this-fifo avatar Mar 07 '24 17:03 this-fifo