# SFZ format documentation

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
KVRian
1422 posts since 19 Mar, 2008 from germany
Up to now I thought the only way to set the
velocity-sensivity is:

amp_veltrack = ... %

I recently discovered that we can draw just
any velocity-curve with:

amp_velcurve_1 = 0
amp_velcurve_2 = 0.05
...
amp_velcurve_127 = 1

This is amazing easy and straightforward
So it would be a great benefit for everyone if
also the "simple commands" could be explained
in a handy overview.
free mp3s + info: andy-enroe.de songs + weird stuff: enroe.de

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
Yes, documenting the opcodes themselves is one thing, but I also want to explain how to get specific musical behaviors. I'm planning to explain vibrato next, and then hi-hat muting the basic way and the pljones way, but I can also write out how to apply velocity and key tracking to things like filter cutoffs and envelopes. There are some neat things happening with that in the War Tuba's Tubaborg, which I don't think I've ever really explained to anybody.

KVRAF
6778 posts since 8 Feb, 2003 from London, UK
enroe, with ARIA Engine (and possibly others), you've also got the greater flexibility of

Code: Select all

``````<curve> curve_index={unique number above ?32?} v1=0.393995 v23=1 v24=0.138696 v71=1 v72=0.63728 v82=1 v83=0.608502 v94=1 v95=0.707107 v103=1 v104=0.652176 v113=1 v114=0.793701 v119=1 v120=0.766664 v125=1 v126=0.90125 v127=1
<master> {some opcode}_curvecc{some CC no, including 128+}={unique number above ?32?}  {some opcode}_oncc{some CC no, including 128+}={base for multiplying by the curve}
``````
That lets you set up different curves and have them control how the incoming MIDI CC maps to the opcode. This is handy if you've a multi-sampled set of regions which aren't normalised, for example.

(The "above ?32?" is because I don't remember what the reserved range is - I count down from 255 when I'm allocating my own...)

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
Thanks for reminding me - I need to document the extended CCs above 127, some are SFZ2 and ARIA adds a few more. There's also the ARIA var modulator.

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
Added documentation for the var modulators and multiwaveform LFOs, which are ARIA extensions which have been around for a while, but never documented because nobody had the time. They are seriously powerful, and the var opcodes include an explanation of how to use var to set up filter velocity tracking. That is here: http://www.sfzformat.com/index.php?title=VarXX_target

And all the other new additions, including the extended CCs mentioned above, are at http://www.sfzformat.com/index.php?titl ... ns_Opcodes

KVRAF
6778 posts since 8 Feb, 2003 from London, UK
Are "mult" and "add" the only varXX_mod values?

If I wanted to have CC101 and CC102 modify var01 in opposite directions, then, I'd route one through a curve that inverted the value?

Code: Select all

``````<curve> curve_index=102 v000=1 v127=0
<global>
var01_target=cutoff
var01_oncc101=1
var01_oncc102=1
var01_curvecc102=102
``````
or... could I just use var01_oncc102=-1, skipping the curve..? Hm... Anyway, yes, very interesting! Thanks!

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
pljones wrote:
Wed Oct 03, 2018 3:24 am
Are "mult" and "add" the only varXX_mod values?
Yes.
pljones wrote:
Wed Oct 03, 2018 3:24 am
If I wanted to have CC101 and CC102 modify var01 in opposite directions, then, I'd route one through a curve that inverted the value?

Code: Select all

``````<curve> curve_index=102 v000=1 v127=0
<global>
var01_target=cutoff
var01_oncc101=1
var01_oncc102=1
var01_curvecc102=102
``````
or... could I just use var01_oncc102=-1, skipping the curve..? Hm... Anyway, yes, very interesting! Thanks!
Good question - can you test and let me know?

I also need to verify what the default curves are - there might be one that goes from 1 to 0 already, so you don't need to define it. I know default curve 0 goes from 0 to 1, default curve 1 (used for panning) from -1 to 1, but not sure if there's also a predefined 2, 3 etc. I'd guess there probably are a few more.

KVRAF
6778 posts since 8 Feb, 2003 from London, UK
Looks like it needs the curve. -1 didn't appear to do anything useful, so it's a 0 to 1 value.

Code: Select all

``````<curve> curve_index=102 v000=1 v127=0
<global>
var01_amplitude=100
var01_oncc85=0.5
var01_oncc86=0.5
var01_curvecc86=102

<region>
sample=*sine
``````
That gets you full scale amplitude when CC85 is 127 and CC86 is 0.

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
So, I found out what the default curves in Sforzando are, and documented that now also:

0: linear, from 0 to 1
1: bipolar, from -1 to 1 (useful for things such as tuning and panning, used by CC10 panning by default)
2: linear inverted, from 1 to 0
3: bipolar inverted, from 1 to -1
4: concave (used for CC7 volume tracking and amp_veltrack)
5: Xfin power curve
6: Xfout power curve

So, var01_curvecc86=2 might work in your example without needing to define the curve.

KVRAF
6778 posts since 8 Feb, 2003 from London, UK
Ah yes, should do - I knew there were some pre-defined ones as I'd been advised to steer clear of any curve numbers too low down as they might get taken.

If any new ones were to get set in the defined curve numbers, another pair that would be useful would is for switches (0-63 -> 0, 64-127 -> 1; 0-63 -> 1, 64-127 -> 0), plus maybe another two pairs for different switch effects (0 -> 0, 1-127 -> 1; 0-126 -> 0, 127 -> 1; inverted 0 -> 1, 1-127 -> 0; 0-126 -> 1, 127 -> 0).

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
Good thinking - using curves for switches can save creating extra regions with hicc/locc for things like legato.

So, what should I document next? I've got on the list: vibrato, key and velocity tracking (both using the basic opcodes and var), legato (true and using pitch envelopes), self-muting for hi-hats, and snare drum stirs.

KVRian
1422 posts since 19 Mar, 2008 from germany
DSmolken wrote:
Wed Oct 03, 2018 10:11 pm
So, what should I document next?
What strikes me when I look into your "sustained note basics":
"xfin_loccX".

Considerung didactic aspects - for musicians who are not
familiar with sfz - it would have better to first introduce "hivel"
and "lovel". And then go on from here.

DSmolken wrote:
Wed Oct 03, 2018 10:11 pm
I've got on the list: vibrato, key and velocity tracking (both using the basic opcodes and var), legato (true and using pitch envelopes), self-muting for hi-hats, and snare drum stirs.
All are interesting (and important to know)!

How about a "keyswitching" site? As I see you combine "keyswitching" in
the "sustained note basics" - but maybe a short separate site could be better.

All in all your project is really nice!
free mp3s + info: andy-enroe.de songs + weird stuff: enroe.de

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
Good point - I definitely want this to be friendly to people who've never made an sfz instrument before, and aren't sure where to look. Lovel and hivel are covered in the drum basics, so that's kind of like a prerequisite to the sustained instrument basics, but, well, that's not very good for people who don't care about drums. So I should reorganize that, maybe split each into sections relevant to each opcode.

KVRian
1299 posts since 30 Mar, 2014
For SFZ players, don’t forget:

Renoise
Redux
Zampler
UVI Falcon

KVRAF

Topic Starter

1800 posts since 20 Sep, 2013 from Poland
Sure, I'll add those - do you know what degree of SFZ they support?