Skip to content

A JS percussion SoundFont that is compatible with MIDI.js

Notifications You must be signed in to change notification settings

notochord/percussion-soundfont.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a JS percussion SoundFont that is compatible with MIDI.js and soundfont-player.

Usage

The drum names are listed in drums.json. There are some issues with inconsistent hyphenation but it's officially that way on the MIDI website so.

With MIDI.js

I recommend against trying to make this work with MIDI.js for two reasons:

  • MIDI.js can only handle one SoundFont at a time, so you're stuck either using drums or other instruments (you might be able to change soundfontUrl between plugin loads, I haven't tried too hard to hack it).
  • I don't think it's possible to tell MIDI.js to play an instrument whose name isn't General MIDI. If the name of the instrument in this repo really needs to change to the name of a GM instrument let me know and we can probably make that happen.
MIDI.soundfontUrl = 'https://notochord.github.io/percussion-soundfont.js/';
MIDI.loadPlugin({
    instrument: "percussion",
    onsuccess: function() { }
});
Soundfont.instrument(new AudioContext(), 'https://notochord.github.io/percussion-soundfont.js/percussion-mp3.js')
  .then(drums => drums.play(64));

Credits

This is an adaptation of the GeneralUser SoundFont, and was converted to JS by letoribo in this repository. I just put the files in this repo for safekeeping, but letoribo gets all the credit for the actual conversion. Check out their project drums.herokuapp.com!

About

A JS percussion SoundFont that is compatible with MIDI.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published