MIDI.js Soundfonts
MIDI.js is a fantastic library for MIDI sequencing and playback in Javascript. It comes packaged with a soundfont-generator that is unfortunately a little difficult to get up and running (requires installation of Ruby, Node.js, FluidSynth, Lame, etc.)
This project contains pre-rendered General MIDI soundfonts that can be used immediately with MIDI.js.
Soundfonts Available
- Fluid Soundfont
- Musyng Kite Soundfont
- FatBoy Soundfont
- Tabla Soundfont
- Tabla is a popular Indian percussion instrument. Not all notes contain sound in Tabla.sf2, sounds are mapped on notes C4 to E6. Use sound font software like Viena or
sforzando
to find details of each sound and MIDI key.
- Generated from Tabla.sf2 (4.06 MB uncompressed)
- Instrument names as .json file here
- URL prefix to fetch files: https://gleitz.github.io/midi-js-soundfonts/Tabla/
- Note: Tabla is not standard MIDI instrument, you need to map it to an appropriate instrument in your program. For example, you can map it to
synth_drum
:
MIDI.loadPlugin({
soundfontUrl: "https://gleitz.github.io/midi-js-soundfonts/Tabla/"
instrument: "synth_drum",
onsuccess: function() { console.log("Tabla loaded as instrument synth_drum") }
});
MIDI.noteOn(0, 60, 127); // On channel 0 (default), play note C4 (id 60) with max velocity (127)
Notes
- Fork of MIDI.js with parallized soundfont generation available here.
- You can fetch Soundfont files directly from this repository, so you can access them directly from a browser. Use the prefix URL followed by the instrument name. For example: https://gleitz.github.io/midi-js-soundfonts/FluidR3_GM/marimba-mp3.js