sfz format question

Author
duglmac
Max Output Level: -89 dBFS
  • Total Posts : 94
  • Joined: 2006/11/06 03:54:11
  • Status: offline
2008/11/03 18:11:50 (permalink)

sfz format question


I was creating a sfz file last night for a piano library I have. I have made sfz files before for more simple cases, but this is the first time I have run into this. I'm hoping someone can explain what is happening.

The multisamples are .wav files covering C,D,E,F,G,A in octaves 0 through 8, with 4 velocity zone files for each note.
I have to map files over several notes, such as 'C1_108.wav' had to cover not only C1, but C#1 as well.

My first attempt was to use 'lokey=C1 hikey=C#1', but I had all sorts of weird behaviour with that. Notes were out of place and sometimes in the wrong octave.

Initially, I had the file working by mapping all of the files to the main keys using 'key=', and that workd fine. But then I edited the file to include the sharp notes by changing 'key=' to 'lokey=x hikey=x#'. and that's when the fun started. I finally ended up changing it to 'key=' and 'hikey=' and everything worked fine.

From the documentation for the SFZ format, I understood the 'key=' opcode should set lokey and hikey to the same value, so it seems it should be incompatible with 'hikey' being defined at the same time. So I am a bit confused. Anyone have any ideas here on what's happening?

i.e.
This didn't work so good:
<region> sample=C1_100.wav lokey=C1 hikey=C#1 lovel=0 hivel=100
<region> sample=C1_127.wav lokey=C1 hikey=C#1 lovel=101 hivel=127

This worked fine
<region> sample=C1_100.wav key=C1 hikey=C#1 lovel=0 hivel=100
<region> sample=C1_127.wav key=C1 hikey=C#1 lovel=101 hivel=127


---------------------------------------------------------------
I don't suffer from Insanity, I enjoy every minute of it!
#1

11 Replies Related Threads

    raweber
    Max Output Level: -87 dBFS
    • Total Posts : 178
    • Joined: 2008/01/23 14:03:14
    • Location: Hampton Roads, VA
    • Status: offline
    RE: sfz format question 2008/11/03 20:52:05 (permalink)
    Try adding this to the line:

    pitch_keycenter=c1


    So, the second example gave you as appropriate c#1? If so, just use it.

    Rob Weber
    Poser Composer
    Music Prodution Blog: Notes from the Shore
    Free Praise Music: All Things New Ministries
    #2
    Vovchik
    Max Output Level: -74 dBFS
    • Total Posts : 847
    • Joined: 2005/01/24 00:47:59
    • Location: Staten Island, NY
    • Status: offline
    RE: sfz format question 2008/11/04 16:21:35 (permalink)
    It depends on the synth you are using for sfz playback. Dimension and SFZ player behave differently.

    As raweber said, to be sure your samples sound right, include opcode "pitch_keycenter":

    <region> sample=C1_100.wav lokey=C1 pitch_keycenter=C1 hikey=C#1 lovel=0 hivel=100

    If It Ain't Broken, Don't Fix It
    #3
    kwgm
    Max Output Level: -52.5 dBFS
    • Total Posts : 2271
    • Joined: 2006/10/12 00:14:20
    • Status: offline
    RE: sfz format question 2008/11/04 20:02:54 (permalink)
    You need all three tags in your <region> definition (as well as a sample file callout), afaik: key, lokey, hikey.

    Key defines the root note of the sample -- essentially, this value corresponds to the fundamental frequency of the sample.

    Lokey and Hikey define the range of the sample -- the midi notes that invoke this sample.




    --kwgm
    #4
    raweber
    Max Output Level: -87 dBFS
    • Total Posts : 178
    • Joined: 2008/01/23 14:03:14
    • Location: Hampton Roads, VA
    • Status: offline
    RE: sfz format question 2008/11/04 21:30:07 (permalink)
    From the specification:

    The key opcode sets lokey, hikey and pitch_keycenter to the same note.

    So it would appear using the "key" opcode cancels out the other three.

    Rob Weber
    Poser Composer
    Music Prodution Blog: Notes from the Shore
    Free Praise Music: All Things New Ministries
    #5
    duglmac
    Max Output Level: -89 dBFS
    • Total Posts : 94
    • Joined: 2006/11/06 03:54:11
    • Status: offline
    RE: sfz format question 2008/11/06 03:26:46 (permalink)


    Ok, I believe I have an explanation. Thanks for the input.

    You are indeed correct about the pitch_keycenter being the answer to the mystery.

    Here's why: In the absence of a definition of pitch_keycenter for the current context, it appears that pitch_keycenter is defaulted to C4.

    This explains why when I was using 'lokey=C4 hikey=C#4' to define the C4 sample, it appeared to work correctly. But when I defined any other note, such as C1, it was still defaulting to pitch_keycenter=c4. When I play C1, it was really playing a much lower note because it was offset from C4. Likewise, when I defined D4, it was playing a higher note, because it was also defaulting to C4. This drove me nuts for some time. (I finally found where it talks about it in the sfz spec, in the 'sample' opcode description)

    When I used the 'key=C1' to define C1, it sets pitch_keycenter=lokey=hikey=c1. Then 'hikey=c#1' redefines the high note to C#1.
    So, bottom line is that all that is required is the 'key=-' and the 'hikey'. Which, of course, is what I ended up with, but didn't understand why it worked.
    But, as vovchik said, using 'pitch_keycenter=C1 lokey=c1 hikey=c#1' would also have worked. Using 'key=' saves a step.

    So, to summarize: pitch_keycenter always defines the note where the sample is defined, and defaults to c4. If one of the range limits is also the pitch_keycenter note, then you can save a step by using 'key=' to that note, and then using lokey or hikey to specify the other limit. Otherwise, use lokey and/or hikey to bound the range, if necessary.

    Clear as mud.
    Thanks again for pointing me in the right direction.

    ---------------------------------------------------------------
    I don't suffer from Insanity, I enjoy every minute of it!
    #6
    Vovchik
    Max Output Level: -74 dBFS
    • Total Posts : 847
    • Joined: 2005/01/24 00:47:59
    • Location: Staten Island, NY
    • Status: offline
    RE: sfz format question 2008/11/06 06:42:42 (permalink)

    ORIGINAL: duglmac
    When I used the 'key=C1' to define C1, it sets pitch_keycenter=lokey=hikey=c1. Then 'hikey=c#1' redefines the high note to C#1.
    So, bottom line is that all that is required is the 'key=-' and the 'hikey'.

    Not with all synths. SFZ player in particular ignores "lokey=" and "hikey=" if "key=" is already defined. Dimension, Rapture and their LE versions all might behave differently.

    If It Ain't Broken, Don't Fix It
    #7
    wyndham
    Max Output Level: -88 dBFS
    • Total Posts : 128
    • Joined: 2007/08/21 15:14:40
    • Status: offline
    RE: sfz format question 2008/11/21 11:40:38 (permalink)
    I've just started learning a bit about SFZ and what to make a bank of instruments to use in something outside of Dim Pro.
    Dim Pro needs to be invoked for each track in S7 and can not be used in BIAB very well.
    How does one (using SFZ) made a banks of instrument? Can some of the Dim Pro instruments I own be transfered into a new bank or what ever the right term is?
    Thanks for any help Wyndham
    #8
    techead
    Max Output Level: -31.5 dBFS
    • Total Posts : 4353
    • Joined: 2004/01/24 08:40:20
    • Location: Macomb, IL, USA
    • Status: offline
    RE: sfz format question 2008/11/21 13:01:03 (permalink)

    ORIGINAL: wyndham

    I've just started learning a bit about SFZ and what to make a bank of instruments to use in something outside of Dim Pro.
    Dim Pro needs to be invoked for each track in S7 and can not be used in BIAB very well.
    How does one (using SFZ) made a banks of instrument? Can some of the Dim Pro instruments I own be transfered into a new bank or what ever the right term is?
    Thanks for any help Wyndham


    Dimension Pro doesn't use any concept like banks where there are multiple programs inside of a larger container. Each program in Dimension Pro stands on its own.

    Dimension Pro has this:

    Program file (.prog): a set of parameters for the four elements that make up the sound generating units within Dimension Pro.
    Element file (.elem): a set of parameters for a single sound generating unit within Dimension Pro.
    SFZ File (.sfz): a set of parameters defining multisample/oscillator information used within an element.

    Multiple .prog program files may share common .elem element files. Multiple .elem element files may share common .sfz multisample definition files.
    #9
    wyndham
    Max Output Level: -88 dBFS
    • Total Posts : 128
    • Joined: 2007/08/21 15:14:40
    • Status: offline
    RE: sfz format question 2008/11/21 14:10:47 (permalink)
    Bob, is it or how would I use a DP program in SFZ player or is this not possible. Wyndham
    #10
    raweber
    Max Output Level: -87 dBFS
    • Total Posts : 178
    • Joined: 2008/01/23 14:03:14
    • Location: Hampton Roads, VA
    • Status: offline
    RE: sfz format question 2008/11/22 09:23:26 (permalink)
    sfz player cannot play Dimsion Pro programs. Only raw sfz files. However, it also uses a lot less processor power that DP, so you can use more instances of it in a song.

    To answer the earlier question, the sfz format only supports a single instrument The sfz player supports multiple instruments, but only when an sf2 soundfont is loaded.

    Rob Weber
    Poser Composer
    Music Prodution Blog: Notes from the Shore
    Free Praise Music: All Things New Ministries
    #11
    wyndham
    Max Output Level: -88 dBFS
    • Total Posts : 128
    • Joined: 2007/08/21 15:14:40
    • Status: offline
    RE: sfz format question 2008/11/22 18:07:00 (permalink)
    Thanks that answered a lot of important question for me, Thanks again to all, Wyndham
    #12
    Jump to:
    © 2024 APG vNext Commercial Version 5.1