programming articulations into sfz

Post
sluggo
Max Output Level: -87 dBFS
2005/05/16 01:33:20
Hi Rene,

Is it possible to program articulations with sfz or Dimension? I'm trying to translate a Scarbee bass library where he does things such as "When making Hammer-ons or Pull-offs you first play an attack-note - like a Sustained note. Then insert trigger E0 to turn the next note (velocity 99) into a Hammer-on. When going back to a sustained note insert key-trigger C1 as in the example above. You can easily have several articulations folowing each other."

I have no idea how this works, but it apparently works in Kontakt and other samplers (Halion, giga). I don't know if this is a function of the sampler or sample format.

thanks
René
Max Output Level: -68 dBFS
RE: programming articulations into sfz 2005/05/16 16:18:54
Hello Sluggo,

Generally speaking, the sfz format allows for much more articulation definitions that any other sample format, and in some sort, it will allow anything possible in any sample format.

To translate a particular library library, we need to know precisely what articulation effect is programmed on it though. I don't recall that functionality in Scarbee fingered (I have that one and the rsp73 in gig format here if that helps), but according to your description it sounds to me a typical 'keyboard switching' trick, very common nowadays. It was first introduced in Gigastudio like 10 years ago.

The trick consists in having separate set of samples mapped for the same group of notes, and then decide which one has to play according to what was the last key played within a special range, generally unused called 'keyswitch range'. In the case you mentioned, it looks like one set of samples will play if E0 was the last key played, and another different set of samples will play if C1 was the last key played.

This is very easy to program in the sfz format using the 'sw_last=' opcode. Here's how it works.
Let's say we have two regions mapped from C3 to C9, as follows:


<region> sample=CelloPizz.wav lokey=c3 hikey=c9
<region> sample=CelloEspr.wav lokey=c3 hikey=c9


If you play that sfz file, both regions will play together, layered, for any key from c3 to c9. Now, let's add some magic to that definition:


<region> sample=CelloPizz.wav lokey=c3 hikey=c9 sw_lokey=c2 sw_hikey=c#2 sw_last=c2
<region> sample=CelloEspr.wav lokey=c3 hikey=c9 sw_lokey=c2 sw_hikey=c#2 sw_last=c#2


We've added three opcodes to each region. The first two are used to define the 'keyswitch range', which is the area where our triggers live. That range can be anything, but it's more clear when any unused keyboard area is used, either below or above the standard range.

The third opcode is the trigger itself. Above example will play CelloPizz from c3 to c9, if the last key played in the keyswitch range was c2. CelloEspr will play from c3 to c9 if the last key played in the keyswitch range was c#2 instead. Using the <group> opcode, above example can be greatly simplified:


<group>
lokey=c3 hikey=c9 sw_lokey=c2 sw_hikey=c#2

<region> sample=CelloPizz.wav sw_last=c2
<region> sample=CelloEspr.wav sw_last=c#2


To use it, play c2 then the pizzicato part, then c#2 and the espressivo part. Naturally a single wav won't do the c3 to c9 range very well, this is just an example. Most likely many regions will share the c2/c#2 triggers.

As a more realistic example, I've used two existing mappings in Dimension to display the keyboard switching capabilities. Please get this small file, and extract it in your "$\Multisamples\15 - Strings\" folder. You can then load the file as a multisample (by clicking on the main display and finding it, or just drag&drop it into Dimension's GUI).


http://www.rgcstuff.com/External/keyswitch.zip


The example is a combination of 1st violins, in Pizzicato and Espressivo. C4 activates the Pizzicato line, C#4 the espressivo line.

Creating this keyswitch took me a few minutes, just copy/paste plus adding the new opcodes. It would have taken ages in both of the major samplers [/propaganda]


Hope this helps. Please forgive any mistake above text might have, I didn't have too much time for it.


-René
sluggo
Max Output Level: -87 dBFS
RE: programming articulations into sfz 2005/05/16 16:31:31
Thanks Rene, I'll have a look at this later this week. I had quickly glanced at the opcodes listed on the rgcaudio website and it looked like it was doable. But better for me to have a good example as you've posted, than me experiment for several hours. Actually, experimenting for several hours is good too but I just don't have the spare time.

Once I have this sorted out, perhaps I will contact Scarbee and offer the sfz files for distribution. I think this would be keeping with the spirit of sfz.

s

sluggo
Max Output Level: -87 dBFS
RE: programming articulations into sfz 2005/05/23 11:13:45
Rene,

Is it possible to have two key triggers for the same layer? For example, both C1 and C#1 trigger the same sustained note but C1 and C#1 trigger different staccato release samples. If this is not currently possible, I'll have to copy the c1-c#1 regions and then dedicate one region to c1 and the other to c#1.

If it isn't yet possible, perhaps at some point sfz can be modified to include this functionality. Maybe the opcode would be something like sw_last=note1,note2,note3

thanks
s
René
Max Output Level: -68 dBFS
RE: programming articulations into sfz 2005/05/23 15:42:48
Is it possible to have two key triggers for the same layer? For example, both C1 and C#1 trigger the same sustained note but C1 and C#1 trigger different staccato release samples.


A single region allows only one sw_last opcode. However, as there's no limit of regions, you can achieve the functionality you're suggesting just by copying the region and assigning the alternate triggers to the copy. Many boolean operations in the format are created in this way.

The sfz format is defined as 'minimalistic'. Therefore, there're quite a few 'shortcuts', or opcodes which would duplicate the functionality of other opcodes, or functionality which could be achieved in another way (i.e. with region copies).
The two exceptions I allowed are the '<group>' header, and the 'key=' opcode. That 'bloating' in the spec was introduced in the thought that the resulting code was much simpler and readable when they were used. However, it was severely criticized by several language semantic/semiotic/syntax experts and a few users and developers as well. Therefore, I don't think more of those will be introduced in the future... who knows


-René