Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Problems when attempting to play a custom soundfont #93

Open
karmaral opened this issue Jan 27, 2022 · 1 comment
Open

Problems when attempting to play a custom soundfont #93

karmaral opened this issue Jan 27, 2022 · 1 comment

Comments

@karmaral
Copy link

Hello! I generated a custom soundfont using MIDI.js tools, and placed it inside my public folder (I'm using Svelte)
When creating the new instrument, I tried the following:
let inst = Soundfont.instrument(ac, 'http://localhost:8080/soundfonts/acoustic_grand_piano-mp3.js');
let inst = Soundfont.instrument(ac, './soundfonts/acoustic_grand_piano-mp3.js');

And they both throw:

Uncaught TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer
    at ArrayBuffer.slice (<anonymous>)
    at AudioContext.<anonymous> (index.js:68:64)

Do you have any idea what it could be?

Here's the generated js file too, just in case
acoustic_grand_piano-mp3.txt

Thank you!

@luisscholl
Copy link

Hi, I have the same problem. Some info for reproducing the problematic file.

OS: Windows 10

  1. Installed oggenc2, lame, fluidsynth, ruby, Node.js
  2. Cloned MIDI.js
  3. Installed all npm packages for generator/nodejs/packageWAVs.js
  4. gem install midilib
  5. Created directories "generator/ruby/soundfont" and "generator/sf2"
  6. Placed sf2 file into generator/sf2
  7. Edited soundfont_builder.rb such that
OGGENC = "oggenc2"
LAME = "lame"
FLUIDSYNTH = "fluidsynth"
  1. Executed ruby soundfont_builder.rb from generator/ruby

Any help would be appreciated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants