Multiple instruments in one sfz file (GM Compatible sfz)

You name it!
Post Reply
Steele
Newbie
Posts: 16
Joined: Sun Aug 31, 2008 10:25 pm

Multiple instruments in one sfz file (GM Compatible sfz)

Post by Steele » Mon Jun 11, 2012 7:40 pm

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?

varpa
User
Posts: 63
Joined: Thu Dec 09, 2010 8:15 pm

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

Post by varpa » Thu Jun 14, 2012 4:46 am

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/

yuba
Newbie
Posts: 6
Joined: Wed Aug 13, 2014 12:21 pm

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

Post by yuba » Wed Aug 27, 2014 11:21 am

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.

adotm
Newbie
Posts: 1
Joined: Mon Aug 29, 2016 5:19 pm

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

Post by adotm » Mon Aug 29, 2016 5:30 pm

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.

Post Reply