-
-
Notifications
You must be signed in to change notification settings - Fork 8
Description
I attempted using the hookPlayerMIDIEventsByName method but I'm getting this error. How do I go about fixing this?
synth = new JSSynth.AudioWorkletNodeSynthesizer(); synth.init(context.sampleRate); if (!node) { node = synth.createAudioNode(context); node.connect(context.destination); synth.hookPlayerMIDIEventsByName('myHookPlayerEvents', { secondSFont: soundfontbuffer }); }
I added this code to js-synthesizer.worklet.min.js
AudioWorkletGlobalScope.myHookPlayerEvents = function (s, type, event, data) { if (type === 0xc0) { if (event.getProgram() === 0) { s.midiProgramSelect(event.getChannel(), data.secondSFont, 0, 0); return true; } } return false; };
js-synthesizer.min.js:312 Uncaught (in promise) Error: Name not found
at js-synthesizer.worklet.min.js:1298
at T (js-synthesizer.worklet.min.js:1199)
at js-synthesizer.worklet.min.js:1188