💾 Archived View for thrig.me › blog › 2023 › 10 › 02 › MIDI-bank-select.gmi captured on 2024-07-09 at 01:11:21. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-12-28)

-=-=-=-=-=-=-

MIDI Bank Select

MIDI bank selections are somewhat weird in that a bank change has no effect until a patch change comes along. The bank is thus a bit of hidden state that influences the next patch change. Hopefully a synthesizer will come with documentation as to what banks are available. SoundFont files may also contain banks.

            122     White Noise Wave
            127     Shooting Star
    BNK 13  48      Woodwind Choir
            80      Square Lead 3
            81      Saw Lead 3
            88      Night Vision
    BNK 16  25      Mandolin
    BNK 120 0       Standard Drums
            1       Standard 2 Drums

The poor, lonely mandolin. SoundFont files use the RIFF format, so it's not impossible to parse them to see what presets they contain. Or you could use a Digital Audio Workstation if you like clicking, lots and lots of clicking.

/music/soundfont/sflist.pl

    $ doas pkg_add generaluser-gs-soundfont
    ...
    $ sflist /usr/local/share/generaluser-gs/GeneralUser_GS.sf2 > gu.txt

gu.txt

Probably this should instead be in JSON format for easy use by other tools. Or at least better machine parsable? Anyways, bank changes can be done with control change 0 message (plus some number for the suitable bank), followed by a patch change to actually make use of a preset in the new bank.

midibank.pl

    $ perl midibank.pl && midiplay out.midi
    $ fluidsynth -F out.wav /usr/local/share/generaluser-gs/GeneralUser_GS.sf2 out.midi

out.midi

out.mp3

There is another bank select (control change 32) but I haven't figured out how to make that do anything for MIDI files given to fluidsynth or LMMS. Also drums are conventionally put on channel 9. Maybe one of these years I'll figure out how to select from the different drumsets available.

Soundfont Copyrights

There is some uncertainty here, as who knows whether the "public domain" soundfont you found somewhere actually contains samples that came from a Nintendo or some other company prone to vigorous copyright enforcement. Probably not a concern unless your music is popular, or makes lots of money? On the other hand, putting together a free soundfont is probably a largely thankless task.

Another problem might be that there are too many soundfont files available. Limited resources may not be terrible, as one would need to get really good with that one soundfont (which could still have too much stuff in it) or better yet that one piece of musical equipment.