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

Loading new soundfont #74

Open
Treefrog74 opened this issue Feb 4, 2020 · 1 comment
Open

Loading new soundfont #74

Treefrog74 opened this issue Feb 4, 2020 · 1 comment

Comments

@Treefrog74
Copy link

Treefrog74 commented Feb 4, 2020

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
Copy link

Having the same problem. Can someone help?

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