Loading instruments in music21j

Call music21.miditools.loadSoundfont(name, callback) with the instrument name. The callback receives an Instrument object you can assign to a stream’s .instrument property. The note will play with that sound when the rendered notation is clicked (or when triggered in another way).

Example: clarinet



Click the staff to hear it (audio loads after the soundfont arrives).

Pick another instrument

Choose one of the soundfonts below; the same C♯5 whole note will be re-rendered with that sound.

Instrument

No instrument selected yet.