• Register
  • Help
Results 1 to 9 of 9

Topic: SFZ - A Starting Point

Share/Bookmark
  1. #1

    SFZ - A Starting Point

    From an SFZ neophyte, here is some information. I want everyone to feel free to add to this thread with tips, knowledge, experiment results, instruments you make, and anything else related to the SFZ topic.

    This is in lieu of an actual Tutorial like Tony suggested, but it's a start. I have a lot of info to share.
    --------------------------------------------------

    The SFZ topic comes up once in awhile on the Forum. A search will probably find some interesting threads.

    Starting with Aria, the Garritan Libraries now use the SFZ format, as do Sonar's major synths, Dimension and Rapture.

    The main concept of the SFZ format is that a text file is constructed which tells the SFZ sample player what to do with a group of recorded samples which are kept together in a folder. Data included in the text file says what key(s) will trigger each sample, and then there's a long list of other information which may be included.

    These instructions are called "opcodes." As the SFZ page at Cakewalk says, "...opcodes are special keywords which instruct the sample player on what, when and how to play a sample."

    A very good explanation of SFZ can be found HERE on the Cakewalk site.

    Something very nifty is that the SFZ text file can be edited with Windows Notepad. It doesn't require a fancy, specialized editor.

    Opening up the Instruments folder in your GPO program folder, you'll see all the SFZ scripts which are controlling the audio samples which are kept in separate Samples folders.

    CAUTION! - If you decide to try editing any of these Garritan SFZ scripts, you MUST make a backup copy of the original first. You don't want to cripple your Libraries with incorrect coding!

    Click on the Flute folder in Instruments>Woodwinds>Flutes, and you'll see that your Notepad is the default program for opening it. Peeking at some of the code for Flutes, we see things like this:

    "<group> //1
    locc$legato_cc=0 hicc$legato_cc=64

    trigger=attack
    group_amplitude=100.429
    pan=0
    eq1_freq=5997
    eq1_bw=3.95111
    eq1_gain=2.88

    ampeg_attack=0.119223 ampeg_attack_shape=1.39624 ampeg_attack_curve=10
    ampeg_decay_zero=0
    ampeg_decay=0.005 ampeg_decay_shape=-2.6635 ampeg_decay_curve=10
    ampeg_hold=0
    ampeg_release=0.159983 ampeg_release_shape=-2.6635 ampeg_release_curve=10
    ampeg_sustain=100"

    Some of this makes sense even without knowing how the code was constructed. We can see that CC64 is being designated as the Legato control, for example. We can see that samples are triggered by "attack"--hitting a key. We can see that a shape of the attack has been programmed as well as its release time.

    The first thing in this section is <group> - which indicates that the code that follows will apply to all the samples in the folder.

    The exact script which is used for constructing Garritan Aria SFZs isn't available, but we can see the complicated results here.

    Plogue, who developed Aria, has a Forum dedicated just to SFZ. It's not a very active Forum, but there are some good posts and among them you'll find some exciting FREE instruments. You need to visit this Forum to get even more understanding of what SFZ is all about.

    THE PLOGUE SFZ FORUM

    Now here's a portion of a much simpler SFZ text file, the one for the Kalimba SFZ instrument I posted in General Discussion. You can find the free Kalimba instrument HERE if you don't already have it.

    "<group> // parameters for the multi-sample "Velocity 127"
    lovel=65
    hivel=127
    gain_cc1=6

    <region> trigger=attack pitch_keycenter=56 lokey=56 hikey=57 ampeg_release=0.5 sample=Kalimba2-000-056-g#2.wav
    <region> trigger=release pitch_keycenter=56 lokey=56 hikey=57 ampeg_attack=0.1 sample=Kalimba2-000-056-g#2-
    release.wav"

    This code is referring to a whole <group> of samples which are to triggered when played velocities are between 65 ("lovel=65) and 127 ("hivel=127"). And a gain in volume is controlled by CC1, at a level of 6. That figure of 6 was arrived at after testing various levels between 1 and 10. 10 produced overly loud levels that peaked out the sound when tested in Sonar. 1 produced levels too subtle to be noticed.

    But the primary thing to see in the Kalimba example is that the coding is much simpler. It's a much less sophisticated piece of scripting. And yet, it still provides a musically useful SFZ instrument.

    The point is that we can create fairly simple SFZ scripts that trigger samples we make, play them in Aria, and even when they aren't to a great level of programming sophistication, they can still be useful.

    More info on the SFZ format can be found HERE.

    OK OK, but HOW in the heck do we start making an SFZ instrument that will play in Aria?

    STEP NUMBER ONE - THE TRICKIEST PART:

    --Record your samples and loop them if they're sustaining instruments.

    The recordings can be done in any "DAW" software, any audio recording software such as Sonar or Cubase. It's just a down-and-dirty matter of making recordings which sound good when you play them back. What you hear is what you'll get in your finished SFZ instrument. Generally, being close to the mike is a good idea, to avoid capturing much ambiance from the room where you're recording.

    Using my Kalimba as an example, I recorded each of the notes the instrument is capable of playing. I recorded two sets of samples - at a loud level (heavy on the thumb action) and at a soft level (more gentle with the thumb action.) The two different sets were recorded with exactly the same mike set up, and without changing the input volume. The idea was to capture the instrument being played with two different levels of force.

    Later, I programmed the softer samples to be trigger at velocity levels 0 through 64, and the Forte samples to be triggered at velocity levels between 65 and 127. All the different levels of actual volume are provided by the 127 levels of MIDI volume, so it's not as if we're hearing just two levels of Soft and Loud when the instrument is played in Aria. The 127 levels of Velocity provide the variety of volume in addition to the two different samples being triggered at various velocity levels. For icing on the cake, the SFZ instrument was also programmed to respond to the Mod Wheel for additional volume control, as mentioned above.

    An audio program like Sound Forge is able to set looping points for sustained samples. Sonar and other recording programs don't usually provide that editing capability. I use Sound Forge because it's strong in being able to produce looping samples. It's still a matter of trial and error when setting a loop start and end point, searching for the place in a recording where a click or other glitch isn't heard when the sound starts repeating itself. Seeing the wave form in the editor is a big help in seeing with your own eyes where a likely looping point may be.

    If you don't already have a dedicated sound editing program, Audacity is a very popular and FREE program which you can find HERE.

    But if you're doing all the recording work in an audio program like Sonar, you need to trim the beginning and ending of your recordings so there's no extra dead space. Whatever the start of your recording is will be what's eventually triggered by the SFZ file. After editing your recording in Sonar/Cubase/Etc. you need to bounce that edited version down to a new wave file, because sound editing in those programs is non-destructive. That means that when you trim the start of a wave file in a track, you're actually only telling the program which portion of an audio file to play- the original audio recording remains the same. Only by making a fresh bounced recording of your edits will you produce an audio file which is exactly of the trimmed length you want.

    You can see that all this would be more easily accomplished in a dedicated sound editing program, so that's the recommendation.

    On the Kalimba thread I mentioned the free program sfZed, because it's the app most people turn to for creating SFZ instruments. Some people will just set out to write an SFZ script, using existing SFZs as templates - but that approach isn't for the faint-hearted!

    SFZed, and other programs like it, make the production of an SFZ text file automated. The app is basically creating the text file for you when you provide it with the information you want to have included. You don't need to type in any code yourself, the program generates that based on choices you make in the editing window.

    After recording and organizing your samples, the first step in creating an instrument with sfZed is to import your audio files. So you can see one of the biggest jobs in this process is to make tidy audio files with all your instrument's samples, organized appropriately in a single folder, and labeled logically. The pitch being played in each recording/sample is what you want to use as a label, otherwise things could become unnecessarily confusing.

    When you click in sfZed to import your audio files, the program will ask if you want it to create Regions - the answer is Yes!--and then a pop-up will have a default setting of "spread to closest keys." Again, that choice is good.

    On the screen of sfZed, the results will be a list of your samples, and each will have a low key and high key assigned to them, and "pitch key center" is listed, that being the pitch of the original sample.

    The program has made a logical choice of how far to spread your samples. But if you've only sampled some of the notes in an octave, for instance, every 4th note, you'll probably need to do some adjusting of what the key spread is of each sample, so that the results are continuous playable notes spread out on your keyboard.

    Before you can start auditioning your work, you need to save the instrument. After you've saved, the SFZ tab gives you have a way of auditioning samples right there in the stand-alone app IF you've also installed the free SFZ player from Sonar. The player's GUI will be available on the tab if you've installed it. You also need to have set up your audio preferences, as with all soft synth apps, so you can have the app in line with your audio interface.

    FREE SFZ PLAYER

    Here's a page of instructions from the creators of sfZed which are a Must Read for anyone wanting to delve into this:

    sfZed INSTRUCTIONS

    After adding your samples, the basic process is to add whatever "opcodes" you want. Remember early in this message when I was showing some <group> attributes in the GPO flute file? That's exactly what you can do in sfZed to apply controls that are intended for all samples in your SFZ instrument. Using my Kalimba as an example again, Marce added gain control via CC1 to all the samples. Here he explains how he did that:

    "In the top menu - "Opcodes>Amplifier>gain_ccN". It asks you which CC you want. I selected "1". A new column appears in the work area labeled "gain_cc1." Next, select"Tools>Region Tools>Advanced".

    In the top window, select the Opcode you want to modify. "Action" can remain at the default value of "=." With the"Scope" button, you can choose to apply your edit either to a single sample or to all selected regions. The gain opcode was set to a value of 6, and when Apply was clicked, that value of 6 was now in the gan_cc1 column for all instruments.”

    Quite a few of your edits will be global in nature, like that example. In the SFZ script which the program generates for you, such a global opcode will be labeled <group>, as mentioned before.

    What all of those opcodes actually do is something to figure out from experimenting, and from looking at the charts on the web pages I've posted, starting with the Cakewalk link at the top where a chart of opcodes is included.

    I mentioned this free sfZed app on my Kalimba thread because it's a way to generate the SFZ text file, but I do not claim to be an expert in using it. In writing this post, I've passed on everything I know at this point. I'm still very much in the "poking at it" stage, and I know myself well enough to know that I probably won't move much beyond that experimental stage. There's always been a limit to how much of this sort of time-consuming fiddling with codes etc. that I'm willing to do. It is fun to try things once in awhile, and at least some simple but useable results can be reached now and then.

    To make the Kalimba I used Sample Robot which almost completely automates the process of making SFZ instruments. It includes an audio editor with looping capability, and can output your work in several different formats, including program files for Sonar's Dimension, and SFZ files which can be read in Aria. It's a very sophisticated program, and isn't free like sfZed, but if you want to see what Sample Robot has to offer, their website is HERE.

    To sum up - Like most of us, off and on over the years I've wanted a practical way to make my own samples. An old Akai keyboard I had made it so easy 25 years ago to make sampled instruments, but the keyboard's drive finally died, and it wouldn't be worth it to have its 8 bit system revived. Now we're in the age of soft synths, and while there are plenty of sample Players, straight-ahead sample recorders exist but aren't nearly as easy to use as the 2 or 3 button process as on the old hardware samplers.

    SFZ is neat, and it's basically a simple concept - but as with everything that produces great results, it's a fairly deep process to immerse oneself into. I've tried all sorts of programs to create sampled instruments, and most have asked for more investment of time than I'm willing to give.

    Short Circuit is a free sampler I got recently, and it's looking promising also. Instruments you create with your samples in that program can't be played in Aria, they're played in Short Circuit itself when you insert it as a VSTi in your sequencing program.

    SFZ demands a lot of work, and so I'm more than willing to benefit from the instruments other people develop with it. But all of us can create at least simple, serviceable instruments if we roll up our sleeves and get a grasp on at least the basics of what's involved to make an SFZ instrument.

    I'm sure there are people here who can add their SFZ know-how to this thread. I look forward to seeing what people can bring to this interesting topic.

    Randy B.

  2. #2

    Re: SFZ - A Starting Point

    Nothing to do with your post but...

    Damned!! Your version of The Washington Post is awesome!

    What about The Libarty Bell or Stars and stripes forever???

    More Please!!!
    There is no spoon.

  3. #3

    Re: SFZ - A Starting Point

    Quote Originally Posted by boulifb View Post
    Nothing to do with your post but...

    Damned!! Your version of The Washington Post is awesome!

    What about The Libarty Bell or Stars and stripes forever???

    More Please!!!
    Hey, thank you so much for the thumbs up, Boulifb. I just now approved your comment over at You Tube - thanks for that also. You may have thought something was wrong at YT - I have it set so I need to approve comments before they appear. Your feedback came up twice, so I simply approved one, replied to it, and deleted the duplicate.

    This Sousa march is the only march I've ever recorded. The first version was done about 2 years ago with the first version of COMB. Since I wanted to do a 4th of July music video this year, I reached into my archives and updated the project, using COMB2 and layering in a few other things too, so it's not a totally pure COMB2 project, but that library definitely predominates.

    Marches are fun - I probably should do another one sometime. Thanks for the encouragement!

    Randy

  4. #4

    Re: SFZ - A Starting Point

    When I was composing the starter to this thread, I knew I was ending up with something awfully long and difficult to wade through. Well, it's a big topic.

    But there are many useful links on this thread, hope people make use of them.

    In case people haven't seen it, here's a great newer thread about SFZ which Marce started.

    MARCE'S RECORDER

    He made a very neat sample set of a Recorder. Then, as the thread progresses, the original SFZ script for it was improved, with the great help Chad added. Go take a look, and get your free Recorder!

    Roll up your sleeves and start making more Garritan Community home-made sample files for Aria!

    Randy

  5. #5

    Re: SFZ - A Starting Point

    Thank you so much for this information Randy. I've been getting familiar with SFZ a bit but have not had a chance to do anything meaningful with it yet. I will likely use it sooner or later to help test some of the stuff that I'm working on.
    "If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music which he hears, however measured or far away." – Henry Thoreau


  6. #6

    Re: SFZ - A Starting Point

    Quote Originally Posted by rbowser- View Post

    An audio program like Sound Forge is able to set looping points for sustained samples. Sonar and other recording programs don't usually provide that editing capability. I use Sound Forge because it's strong in being able to produce looping samples. It's still a matter of trial and error when setting a loop start and end point, searching for the place in a recording where a click or other glitch isn't heard when the sound starts repeating itself. Seeing the wave form in the editor is a big help in seeing with your own eyes where a likely looping point may be.

    Randy B.
    This process can potentially be automated using autocorrelation, which is a technique for finding repeating patterns in signals. I'm surprised that I have not seen this done in any DAWs. As you know, cross fading between signals can be a huge pain. It turns out that lining up minima is only half the story. For high scrutiny cross fading (such as with looped waveforms for a sustained sample), there is also the less obvious issue of lining up signal phase.

    This could all be automated using autocorrelation. I asked about this in a class at one point, and the prof mentioned that it was a potential idea for a patent if it has not yet been done--but it almost seems too obvious, as it does get used frequently for pitch detection. It's one of the lower priorities on my list of "projects to do someday/maybe".
    "If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music which he hears, however measured or far away." – Henry Thoreau


  7. #7

    Re: SFZ - A Starting Point

    Thank again Randy for starting this thread!

    I hope to contribute a great deal soon. Right now I'm hunkered down working on the upcoming World Library.

    Can't wait to contribute more soon!

    - Chad

  8. #8

    Re: SFZ - A Starting Point

    An excellent introduction, Randy. I'm rusty at this,
    and found it quite useful.

    Many thanks, my friend!

    Best,



    David
    -----
    David Sosnowski
    www.DavidSosnowski.com

  9. #9

    Re: SFZ - A Starting Point

    Quote Originally Posted by etLux View Post
    An excellent introduction, Randy. I'm rusty at this,
    and found it quite useful.

    Many thanks, my friend!

    Best,



    David
    -----
    David Sosnowski
    www.DavidSosnowski.com
    Super to see you here, David. I'm glad my newbie exploration into SFZ is being found useful. There are other such collections of SFZ info around the net, there may even be one here on a Garritan Wiki or some such.

    It's all a somewhat paradoxical thing of being an easy-to-understand concept (text file instructing how to use sample files) --but then getting absolutely labyrinthian in its complexity - as one can see from looking at pro SFZ files like the ones used in the Garritan Libraries.

    Thanks for your response, David!

    Randy

Go Back to forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •