Carla, sf2, sfz, banks and presets....

Link to good samples/soundfonts at http://wiki.linuxaudio.org/wiki/free_audio_data

Moderators: MattKingUSA, khz

Post Reply
starfry
Established Member
Posts: 26
Joined: Wed Dec 09, 2020 9:19 am
Has thanked: 5 times

Carla, sf2, sfz, banks and presets....

Post by starfry »

Hello, hopefully not too silly a question coming up...

I use Carla and drop sfz and sf2 into it. Works great, no problems.

I now have a number of raw sample wavs that I want to make into usable instruments. I've just tried "Polyphone" and, after familiarising for around an hour, was able to create usable sf2 files with multiple presets that I could pop into Carla and use.

I'd like to try sfz (as it's newer and "better" apparently) but am not sure what editor there is for it, also I'm not sure about sfz and multiple presets. From my (limited) knowledge it would seem that an sfz conains one preset. Do I have that right? It's so easy to drop a sf2 into Carla and select presets, not sure how you do the same with sfz.

I also have a pile of sfz (one preset per sfz file) that I'd like to combine into one soundfont so I have only one thing to drop into Carla. I can open sfz files in Polyhone but can't seem to "import" them into an existing soundfont, and I can't work out how to copy / paste between soundfonts.

Perhaps it's just beginner lack of knowledge of the software (Polyphone) or I'm just trying to do it wrong - if there's a reason sfz is a single preset then I don't understand how that's better....

Just trying to learn some new stuff :D
tavasti
Established Member
Posts: 2057
Joined: Tue Feb 16, 2016 6:56 am
Location: Kangasala, Finland
Has thanked: 373 times
Been thanked: 209 times
Contact:

Re: Carla, sf2, sfz, banks and presets....

Post by tavasti »

With sfz, one file is one preset. There can be many SFZ files using same samples.

SFZ itself is text file, and it is possible to make one with text editor, or if having plenty of logically named samples, with scripting. See https://sfzformat.com/

Linux veteran & Novice musician

Latest track: https://www.youtube.com/watch?v=ycVrgGtrBmM

starfry
Established Member
Posts: 26
Joined: Wed Dec 09, 2020 9:19 am
Has thanked: 5 times

Re: Carla, sf2, sfz, banks and presets....

Post by starfry »

Thanks for that clarification that each sfz is a single preset. I guessed it was, I'd hoped I was wrong! But I do like the fact that I can use vim to make a sfz, that is appealing :D .

I find the single preset thing makes life harder - with sf2 I can just drop one thing onto my Carla canvas, patch its inputs and outputs and have access to multiple presets in one easy place. With sfz I'd have to keep dropping things on and patching each one separatley. It's such a pain that I must be missing something - how do people do this? Is there a plugin that presents a directory of sfzs and offers a simple selection mechanism (like I get with sf2) ?

I'd like to use sfz really I would, I've read up on why it's better but solving the usability thing escapes me..,,
User avatar
noedig
Established Member
Posts: 239
Joined: Wed Feb 12, 2014 4:39 am
Location: South Africa
Has thanked: 9 times
Been thanked: 54 times

Re: Carla, sf2, sfz, banks and presets....

Post by noedig »

You can try Konfyt: https://github.com/noedigcode/konfyt

I created it specifically to easily browse sf2 presets and sfz files and to easily and quickly create and switch between different patches.

It's aimed at live keyboard playing, but you could just as well use it with a DAW when creating music in a non live environment.
starfry
Established Member
Posts: 26
Joined: Wed Dec 09, 2020 9:19 am
Has thanked: 5 times

Re: Carla, sf2, sfz, banks and presets....

Post by starfry »

@noedig that is really good, exactly what I'm looking for. I'm going to have a play with it and get to know it but a quick test tonight looks very promising. As I want to select sounds for live playing, it's a perfect match :D
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: Carla, sf2, sfz, banks and presets....

Post by j_e_f_f_g »

Actually, you can have more than one preset in an sfz file. A lot more. And it's rather easy if you organize your samples into a compact set of groups. (That's important to making it easy).

Let's say you have a piano preset that has two groups, and a strings preset that has 1 group. Like so:

Code: Select all

// Piano preset
<group>
<region> sample=my_piano_note.wav key=c4
// Maybe more regions here

<group>
<region> sample=my_piano_pedal.wav key=c4
// Maybe more regions here

// Strings preset
<group>
<region> sample=my_strings_note.wav key=c4
// Maybe more regions here
First you have to figure out how you want them selected. For example, do you want upto 16 presets, each on a different midi channel? (ie, You select between them by changing the MIDI channel on your external controller.) Let's explore that first.

You need to add the lochan and hichan parameters to each group. Let's say you want the piano on midi channel 1, and strings on 2. You need to put

lochan=1 hichan=1

on all your piano groups. This restricts it to a range of midi chan 1 upto midi chan 1. In other words, only midi chan 1. And then

lochan=2 hichan=2

on all your strings groups like so:

Code: Select all

// Piano preset (MIDI chan 1)
<group> lochan=1 hichan=1
<region> sample=my_piano_note.wav key=c4

<group> lochan=1 hichan=1
<region> sample=my_piano_pedal.wav key=c4

// Strings preset (MIDI chan 2)
<group> lochan=2 hichan=2
<region> sample=my_strings_note.wav key=c4
The strings group plays whenever your sfz player is receiving notes on midi channel 2. But the piano groups don't in this case, because you've restricted them to channel 1 with the lochan and hichan settings.

Easy right?

Now let's say you want only the piano groups to sound whenever you select the first patch (number 1) on your controller. And you want only the strings to sound when you select patch 42. Now you use the loprog and hiprog parameters, much like the preceding example with lochan and hichan:

Code: Select all

// Piano preset (Program 1)
<group> loprog=1 hiprog=1
<region> sample=my_piano_note.wav key=c4

<group> loprog=1 hiprog=1
<region> sample=my_piano_pedal.wav key=c4

// Strings preset (Program 42)
<group> loprog=42 hiprog=42
<region> sample=my_strings_note.wav key=c4
Let's say you want to layer strings and piano when you select patch 100. (While still keeping them separate for patches 1 and 42). You need to copy and paste your 3 groups so you have a duplicate copy of each group. On the 3 duplicate groups set all 3 (two pianos, and one strings) to loprog = 100 hiprog = 100 like so:

Code: Select all

// Piano preset (Program 1)
<group> loprog=1 hiprog=1
<region> sample=my_piano_note.wav key=c4
<group> loprog=1 hiprog=1
<region> sample=my_piano_pedal.wav key=c4

// Strings preset (Program 42)
<group> loprog=42 hiprog=42
<region> sample=my_strings_note.wav key=c4

// Layered strings and piano (Program 100)
<group> loprog=100 hiprog=100
<region> sample=my_piano_note.wav key=c4

<group> loprog=100 hiprog=100
<region> sample=my_piano_pedal.wav key=c4

<group> loprog=100 hiprog=100
<region> sample=my_strings_note.wav key=c4
But wait. You can combine multiple sets of parameters to further define a patch. For example, let's say you want the piano and strings to both play for patch 101. But you want only the piano sound for middle c (note 60) and up. And you want only the strings for note 59 down. In other words, you want a split with strings sound on the left side of the keyboard, and piano sound on the right side. Use the lokey and hikey parameters to restrict strings from 0 to 56, and piano from 60 to 127. And of course we'll make yet another copy of the 3 groups so we still have our other patches available.

Code: Select all

// Strings and piano split (Program 101)
<group> loprog=101 hiprog=101 lokey=60 hikey=127
<region> sample=my_piano_note.wav key=c4

<group> loprog=101 hiprog=101 lokey=60 hikey=127
<region> sample=my_piano_pedal.wav key=c4

<group> loprog=101 hiprog=101 lokey=0 hikey=59
<region> sample=my_strings_note.wav key=c4
Sfz has tons of other criteria you can add to your groups. Want to create a group that plays only on channel 4, when you select patch 88, and only over the key range of middle C to high C, and only when the mod wheel is in the range of 40 to 80, and you're pressing the sustain pedal down? You can do it. You can't come close to that level of programmability with SF2.

And you can arrange things so that it's easy to create "sets" of patches. For example, put all your piano patches in one SFZ text file named Piano.sfz. Put all your bass patches in Bass.sfz. Put all your string patches in Strings.sfz.

Now create a fourth SFZ that includes all 3 of those patch sets. When you load this one SFZ, it will automatically load the other 3. Here's what that "master set" looks like. We'll call it MyGigSet.sfz

Code: Select all

#include "Piano.sfz"
#include "Bass.sfz"
#include "Strings.sfz"
And I've barely scratched the surface of what SFZ offers which sf2 can't do. I think you maybe now have an inkling of why it's "superior".

P.S. When it comes to technical things, especially about programming, MIDI, and sound editing, you may want to hit me up for advice. I can be useful from time to time.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

starfry
Established Member
Posts: 26
Joined: Wed Dec 09, 2020 9:19 am
Has thanked: 5 times

Re: Carla, sf2, sfz, banks and presets....

Post by starfry »

This is most useful and enlightening. I feel a bout of scripting coming on :D
I also want to try making my own samples - I'm going to post separately about that rather than take this thread of course.
sanjayradia
Posts: 1
Joined: Thu Mar 28, 2024 7:43 pm
Has thanked: 1 time

Re: Carla, sf2, sfz, banks and presets....

Post by sanjayradia »

thanks you very much for the above explanation - helped me a lot.
Some additional questions:
Q1. How do you specify the bank - i was under the impression that one needs to specify both Bank and Preset (or program as SFZ calls them) for each instrument.

Q2. WHy did you repeat the piano split 2 times in your example:

Code: Select all

// Strings and piano split (Program 101)
<group> loprog=101 hiprog=101 lokey=60 hikey=127
<region> sample=my_piano_note.wav key=c4

<group> loprog=101 hiprog=101 lokey=60 hikey=127  <<<<<<< Same as the one above??
<region> sample=my_piano_pedal.wav key=c4

<group> loprog=101 hiprog=101 lokey=0 hikey=59
<region> sample=my_strings_note.wav key=c4

Q3. How is the full instrument named - is it the name of the file Foo.sfz => name is Foo? It in your example of Piano.sfz and Bass.sfz and Strings.sfz are the words Piano, Bass and Strings significant? For example Cakewalk shows the names like grand Piano or Flute - if they are derived from sfz then where does the name Piano or Flute come from? The name of .sfz file?

Q4. In your example of MyGigSet.sfz which includes Piano.sfz and Bass.sfz and Strings.sfz will all 4 pathsets (ie MySigSet, Paino, Bass, Strings) all appear in the DAW or other tools I use? Now this may be a nonsense question of the file name has significance.
Q4b. Lets say i load MyGigSet.zfz and also Piano.sfz - will the two Piano sets appear?

Last edited by sanjayradia on Fri Mar 29, 2024 7:21 am, edited 1 time in total.
Post Reply