danigb / soundfont-player

Quick soundfont loader and player for browser
MIT License
453 stars 60 forks source link

Loading new soundfont #74

Open Treefrog74 opened 4 years ago

Treefrog74 commented 4 years ago

Please forgive me if I am not able to best ask this question - I am a relative novice and can't seem to figure this out.

I'm writing a p5.js sketch that uses the Soundfont player. I am wanting to load/use a different soundfont of my own creation. I have used the MIDI.js soundfont generator to render the soundfont into the .js format.

Before placing this newly created file into a repository, I was trying to load a different soundfont using the following line:

Soundfont.instrument (ac, "marimba-mp3.js", { from: "http://gleitz.github.io/midi-js-soundfonts/FatBoy/" }).then(function(play_marimba) { marimba = play_marimba})

I could not get the sound to load this way. As far as I know I have followed what you said to do in the readme file.

I also wondered if there was a way just to load the marimba-mp3.js file right into my sketch, but I couldn't figure that out either.

Sorry if my question is not clear enough.

Any help or clarification would be greatly appreciated!

Leo

from the README: You can load your own Soundfont files passing the .js path or url:

Soundfont.instrument(ac, '/soundfonts/clavinet-mp3.js').then(...) // or Soundfont.instrument(ac, 'clavinet-mp3.js', { from: 'server.com/soundfonts/' })

marian-simonca commented 1 year ago

Having the same problem. Can someone help?