magenta-js
magenta-js copied to clipboard
Unable to use Tone.js OfflineAudioContext with Soundfont Player
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.