Why is my sfz so CPU intensive?

Author
markheath
Max Output Level: -82 dBFS
  • Total Posts : 408
  • Joined: 2003/12/30 05:28:55
  • Location: Southampton, England
  • Status: offline
2005/11/08 13:33:23 (permalink)

Why is my sfz so CPU intensive?

I have had a go at making an sfz file from one of my favourite piano soundfonts. - Guray Dere's Clavinova Piano 1 V2.0. I extracted all the WAV files and combined the left and right samples into stereo WAV files. I then made an sfz file, using some code I have written to examine the contents of sf2 files, and comparing with the output of sfzed as well.

The trouble is, playing the soundfont in sfz requires 30% CPU usage max in SONAR 5 when I am playing very busy with lots of sustained notes. But my sfz file is at least double the CPU usage even at draft quality and suffers from gaps in the playback.

Is there something wrong with my sfz file that would cause excessive CPU usage? It has 7 velocity layers (based on three sample layers). Here is an abridged sample of the sfz file I created:


// velocity 0-37
<group> ampeg_release=1.200 effect1=5 hivel=37
<region> sample=C1_32_22.wav lokey=21 pitch_keycenter=22 hikey=23
<region> sample=C1_32_25.wav lokey=24 pitch_keycenter=25 hikey=26
<region> sample=C1_32_28.wav lokey=27 pitch_keycenter=28 hikey=29
...
<region> sample=C1_32_100.wav lokey=99 pitch_keycenter=100 hikey=101
<region> sample=C1_32_103.wav lokey=102 pitch_keycenter=103 hikey=104
<region> sample=C1_32_106.wav lokey=105 pitch_keycenter=106 hikey=107

// velocity 38-52
<group> ampeg_release=1.200 effect1=5 cutoff=2000 lowvel=38 hivel=52
<region> sample=C1_75_22.wav lokey=21 pitch_keycenter=22 hikey=23
<region> sample=C1_75_25.wav lokey=24 pitch_keycenter=25 hikey=26
<region> sample=C1_75_28.wav lokey=27 pitch_keycenter=28 hikey=29
...
<region> sample=C1_75_100.wav lokey=99 pitch_keycenter=100 hikey=101
<region> sample=C1_75_103.wav lokey=102 pitch_keycenter=103 hikey=104
<region> sample=C1_75_106.wav lokey=105 pitch_keycenter=106 hikey=107

// velocity 53-64
<group> ampeg_release=1.200 effect1=5 cutoff=3250 lowvel=53 hivel=64
<region> sample=C1_75_22.wav lokey=21 pitch_keycenter=22 hikey=23
<region> sample=C1_75_25.wav lokey=24 pitch_keycenter=25 hikey=26
<region> sample=C1_75_28.wav lokey=27 pitch_keycenter=28 hikey=29
...
<region> sample=C1_75_100.wav lokey=99 pitch_keycenter=100 hikey=101
<region> sample=C1_75_103.wav lokey=102 pitch_keycenter=103 hikey=104
<region> sample=C1_75_106.wav lokey=105 pitch_keycenter=106 hikey=107

// velocity 65-79
<group> ampeg_release=1.200 effect1=5 lowvel=65 hivel=79
<region> sample=C1_75_22.wav lokey=21 pitch_keycenter=22 hikey=23
<region> sample=C1_75_25.wav lokey=24 pitch_keycenter=25 hikey=26
<region> sample=C1_75_28.wav lokey=27 pitch_keycenter=28 hikey=29
...
<region> sample=C1_75_100.wav lokey=99 pitch_keycenter=100 hikey=101
<region> sample=C1_75_103.wav lokey=102 pitch_keycenter=103 hikey=104
<region> sample=C1_75_106.wav lokey=105 pitch_keycenter=106 hikey=107

// velocity 80-100
<group> ampeg_release=1.200 effect1=5 cutoff=2800 lowvel=80 hivel=100
<region> sample=C1_127_22.wav lokey=21 pitch_keycenter=22 hikey=23
<region> sample=C1_127_25.wav lokey=24 pitch_keycenter=25 hikey=26
<region> sample=C1_127_28.wav lokey=27 pitch_keycenter=28 hikey=29
...
<region> sample=C1_127_100.wav lokey=99 pitch_keycenter=100 hikey=101
<region> sample=C1_127_103.wav lokey=102 pitch_keycenter=103 hikey=104
<region> sample=C1_127_106.wav lokey=105 pitch_keycenter=106 hikey=107

// velocity 101-119
<group> ampeg_release=1.200 effect1=5 cutoff=4400 lowvel=101 hivel=119
<region> sample=C1_127_22.wav lokey=21 pitch_keycenter=22 hikey=23
<region> sample=C1_127_25.wav lokey=24 pitch_keycenter=25 hikey=26
<region> sample=C1_127_28.wav lokey=27 pitch_keycenter=28 hikey=29
...
<region> sample=C1_127_100.wav lokey=99 pitch_keycenter=100 hikey=101
<region> sample=C1_127_103.wav lokey=102 pitch_keycenter=103 hikey=104
<region> sample=C1_127_106.wav lokey=105 pitch_keycenter=106 hikey=107

// velocity 120-127
<group> ampeg_release=1.200 effect1=5 lowvel=120
<region> sample=C1_127_22.wav lokey=21 pitch_keycenter=22 hikey=23
<region> sample=C1_127_25.wav lokey=24 pitch_keycenter=25 hikey=26
<region> sample=C1_127_28.wav lokey=27 pitch_keycenter=28 hikey=29
...
<region> sample=C1_127_100.wav lokey=99 pitch_keycenter=100 hikey=101
<region> sample=C1_127_103.wav lokey=102 pitch_keycenter=103 hikey=104
<region> sample=C1_127_106.wav lokey=105 pitch_keycenter=106 hikey=107



Also, the sfz is a lot louder, but I'm guessing that I've just missed a global volume parameter fromthe sf2.
#1

9 Replies Related Threads

    markheath
    Max Output Level: -82 dBFS
    • Total Posts : 408
    • Joined: 2003/12/30 05:28:55
    • Location: Southampton, England
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/08 13:51:13 (permalink)
    OK, I've worked it out - I was using lowvel instead of lovel. Is there some way that you can get sfz to report syntax errors?

    CPU usage is fine now, although some of the high notes (1 every 3) have a harsh sound that isn't there in the SoundFont.
    #2
    MIDIMONSTER
    Max Output Level: -89 dBFS
    • Total Posts : 64
    • Joined: 2005/01/26 09:55:31
    • Location: Beantown
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/08 14:12:05 (permalink)
    Hi Mark,

    Have you tried applying body/damper simulator opcode to your piano sfz? I really like using this effect, it even works well on non-stringlike samples.

    <effect>
    type=strings
    strings_number=36
    strings_wet_oncc1=100

    *this will cause the multisample to become more CPU hungry
    #3
    René
    Max Output Level: -68 dBFS
    • Total Posts : 1103
    • Joined: 2004/01/06 13:15:57
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/08 17:14:16 (permalink)
    OK, I've worked it out - I was using lowvel instead of lovel. Is there some way that you can get sfz to report syntax errors?


    No, there isn't. Dimension/Dimension Pro will verify the opcodes and report unrecognized ones.


    CPU usage is fine now, although some of the high notes (1 every 3) have a harsh sound that isn't there in the SoundFont.


    Possibly the sf2 is mapped so samples are transpoed only to lower notes. Also, most sf2have the filter active.

    Have you tried applying body/damper simulator opcode to your piano sfz? I really like using this effect, it even works well on non-stringlike samples.

    <effect>
    type=strings
    strings_number=36
    strings_wet_oncc1=100



    This works only in Dimension/Dimension Pro, but not in sfz.


    -René
    #4
    markheath
    Max Output Level: -82 dBFS
    • Total Posts : 408
    • Joined: 2003/12/30 05:28:55
    • Location: Southampton, England
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/08 17:56:11 (permalink)
    ORIGINAL: René
    No, there isn't. Dimension/Dimension Pro will verify the opcodes and report unrecognized ones.

    Excellent. I was only using sfz because it was easier to A-B between sfz and sf2 files.

    Possibly the sf2 is mapped so samples are transpoed only to lower notes. Also, most sf2have the filter active.

    I'll have to do some more digging into the sf2 file to see if there are any filters I missed. Interestingly, the harsh notes were the ones playing back at their sample frequency - obviously the pitch shifting algorithm was smoothing out the sound a bit on the one above and below.

    I also notice that the Dimension piano sfz's don't include any release stage in the Amplifier EG (making the notes stop very abruptly when played using sfz). Is this just so that people can use the graphical EG in Dimension? The Dimension GUI shows the release stage having an exponential decay. Is the sfz one the same?
    #5
    René
    Max Output Level: -68 dBFS
    • Total Posts : 1103
    • Joined: 2004/01/06 13:15:57
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/08 18:22:28 (permalink)
    I also notice that the Dimension piano sfz's don't include any release stage in the Amplifier EG (making the notes stop very abruptly when played using sfz). Is this just so that people can use the graphical EG in Dimension? The Dimension GUI shows the release stage having an exponential decay. Is the sfz one the same?


    Most multisamples in Dimension do not include any kind of modulation or filtering. That is intended to give the maximum flexibility when tweaking those settings use the filters, effects, EGs and LFOs in Dimension.


    -René
    #6
    René
    Max Output Level: -68 dBFS
    • Total Posts : 1103
    • Joined: 2004/01/06 13:15:57
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/08 18:29:15 (permalink)
    The Dimension GUI shows the release stage having an exponential decay. Is the sfz one the same?


    Dimension offers either logarithmic or exponential releases, with adjustable slope. sfz does only have a fixed exponential decay shape.



    -René
    #7
    markheath
    Max Output Level: -82 dBFS
    • Total Posts : 408
    • Joined: 2003/12/30 05:28:55
    • Location: Southampton, England
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/09 14:32:04 (permalink)
    Possibly the sf2 is mapped so samples are transpoed only to lower notes. Also, most sf2have the filter active.

    I have now examined all the generators in the soundfont and I'm sure that there is no filter active on the velocity layer that has the problem. In fact, I even tried adding the cutoff opcode to my sfz file at a few different settings, but that didn't eliminate the harshness.

    I made a track of sfz playing the note in question on the Soundfont, and then Dimension playing my sfz, then sfz playing my sfz, and finally the sample itself. Interestingly, Dimension has the Soundfont pretty much nailed, but sfz is about 6dB louder and has the harsh sound I noticed.

    Do Dimension and the sf2 playing engine turn on a filter by default that I don't know about, or perhaps have a different default amplifier envelope? I was hoping that it would be possible to create an sfz file that played back in sfz identically to the sf2.
    #8
    René
    Max Output Level: -68 dBFS
    • Total Posts : 1103
    • Joined: 2004/01/06 13:15:57
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/09 18:26:17 (permalink)
    Do Dimension and the sf2 playing engine turn on a filter by default that I don't know about, or perhaps have a different default amplifier envelope? I was hoping that it would be possible to create an sfz file that played back in sfz identically to the sf2.


    This comes to my mind reading your previous post: I have report about an issue on samples buzzing when played at root note/tune in sfz. The report states that notes can buzz at root note only, if no tune= or transpose= opcodes are applied, and only if the samplerate selected matches the sample original samplerate: it sounds similar to your description.
    Does your buzz go away if you change samplerate? Also, if you touch the pitch-bend so the pitch moves and returns, do you hear any change?


    Regarding output level, sfz and Dimension are very different, and depend on many parameters including the vector mixer, volume and pan controls, MIDI volume (CC7) and expression (CC11), etc.


    -René
    #9
    markheath
    Max Output Level: -82 dBFS
    • Total Posts : 408
    • Joined: 2003/12/30 05:28:55
    • Location: Southampton, England
    • Status: offline
    RE: Why is my sfz so CPU intensive? 2005/11/10 03:47:37 (permalink)
    ORIGINAL: René
    This comes to my mind reading your previous post: I have report about an issue on samples buzzing when played at root note/tune in sfz. The report states that notes can buzz at root note only, if no tune= or transpose= opcodes are applied, and only if the samplerate selected matches the sample original samplerate: it sounds similar to your description.
    Does your buzz go away if you change samplerate? Also, if you touch the pitch-bend so the pitch moves and returns, do you hear any change?

    This seems to be exactly the problem I have encountered. Pitchbend removes the buzz, as does setting tune=1 in the sfz file. I've not tried changing sample rate yet. The problem only occurs on samples played at root note. Listening again, I think it is present on most (maybe all) of the notes played at original pitch, but it is only really noticable on a few notes.

    My test sfz file is as follows:

    <group> ampeg_release=1.200 effect1=5 cutoff=2800 lovel=80 hivel=100
    <region> sample=C1_127_73.wav lokey=72 pitch_keycenter=73 hikey=74

    <group> ampeg_release=1.200 effect1=5 cutoff=4400 lovel=101 hivel=119
    <region> sample=C1_127_73.wav lokey=72 pitch_keycenter=73 hikey=74

    <group> ampeg_release=1.200 effect1=5 lovel=120
    <region> sample=C1_127_73.wav lokey=72 pitch_keycenter=73 hikey=74


    I can send you the wav file if you're interested in hearing this for yourself.
    #10
    Jump to:
    © 2024 APG vNext Commercial Version 5.1