Page 1 of 1

Multiple instruments in one sfz file (GM Compatible sfz)

Posted: Mon Jun 11, 2012 7:40 pm
by Steele
Hello,

I want to create an GM compatible sfz instrument bank. This means an sfz which has references to multiple instruments/samples.
You just load the one sfz and then can change the instrument via MIDI CC for instrument change (patch).

Does the sfz format support this?
Does Linuxsample support this?

Re: Multiple instruments in one sfz file (GM Compatible sfz)

Posted: Thu Jun 14, 2012 4:46 am
by varpa
I don't know the answer to your question, but the SFZ format is documented here:
http://www.cakewalk.com/DevXchange/article.aspx?aid=108

and linuxsampler implementation is documented here:
http://www.linuxsampler.org/sfz/

Re: Multiple instruments in one sfz file (GM Compatible sfz)

Posted: Wed Aug 27, 2014 11:21 am
by yuba
I know this is an old thread but I've been looking into the same thing myself recently and came upon it, so I thought I'd reply in case anyone else is wondering about this.

I'm quite new to sfz too, but I haven't seen any files at all with a full GM range of instruments in the same "selectable" manner as something like an sf2. However, sfz does support keyswitching, so you can have multiple instruments in the same file. While this won't get you a full GM-compatible set (you lose a note each time you add a switch), it's very handy and the switch seems more or less instantaneous.

If you want to see how it works, have a look at the keyswitched files here.

Re: Multiple instruments in one sfz file (GM Compatible sfz)

Posted: Mon Aug 29, 2016 5:30 pm
by adotm
Another way of doing this that seems a little closer to what you'd expect, for example, from a GM SoundFont, is to use a MIDI CC as an instrument selector. The problem with keyswitches is that you're inherently limited by your need to use most of the keyboard for actually playing the instrument. Using a CC also gives you 128 values to select between 128 GM instruments, which works out nicely.

Using a CC is pretty simple (I'm going to use CC3, because it's undefined):

Code: Select all

<global>
//Settings that apply to all your instruments
<master> //Instrument 1, selected by setting CC3 to 0
locc3=0 hicc3=0
//...
<master> //Instrument 2, selected by setting CC3 to 1
locc3=1 hicc3=1
//...
//etc...
LinuxSampler also seems to support the

Code: Select all

lochan
and

Code: Select all

hichan
opcodes for selecting samples based on MIDI channel. I'm not quite sure how one sets up LinuxSampler to allow multi-channel MIDI input to a single instrument, but that would also be a very clean way to select between 16 instruments. Unfortunately, LinuxSampler doesn't support the program change opcodes, so you can't directly use MIDI program change messages.