logue / sf2synth.js

JavaScriptで書かれたSoundFontによるMIDI音源。GM Level2およびXG Lite相当の音源に対応。※Developブランチが実際動いているプログラムです。
https://logue.github.io/sf2synth.js/
MIT License
27 stars 5 forks source link

.sf2 file with multi Instruments #2

Closed JanVeb closed 2 years ago

JanVeb commented 2 years ago

Have .sf2 file that has many different instruments, by default it loads first instrument in its list, how to properly name other instruments? Adding instrument name, as they are named in .sf2 file doesn't work

sf.loadSoundFontFromURL('assets/piano/ArachnoSoundFont-Version1.0.sf2/Alto Sax').then(() => { sf.bank = sf.banks[0].id; sf.program = sf.programs[0].id; });

logue commented 2 years ago

This program is a MIDI sound module that receives MIDI signals and produces sound, which is equivalent to a receiver.

This program lists the instrument names included in SoundFont as they are. Since it is made on the assumption that it uses the GM standard (and its derivatives) SoundFont, if you load a SoundFont that does not comply with that standard, only that instrument will be displayed.

First, make sure that your SoundFont complies with the GM standard.

Also, since this program is like an emulator of the sound source itself, it is not supposed to be used to extract a single instrument from SoundFont. To the last, MIDI signals are sent from WebMidiLink senders (such as smfplayer.js, etc.) via Iframe via postMessage, and the received ones are pronounced.

Please refer to the following site for details. https://www.g200kg.com/en/docs/webmidilink/spec.html