SFZ half pedal emulation

Still new to all of this? Feel free to post in any of the subforums on this site, but in this subforum newbie questions are especially encouraged!

Moderators: MattKingUSA, khz

Post Reply
amc252
Established Member
Posts: 140
Joined: Fri May 05, 2023 12:24 am
Has thanked: 92 times
Been thanked: 22 times

SFZ half pedal emulation

Post by amc252 »

Hello everybody,

I'm still very new to the workings of SFZ
I found this example of how to simulate piano half pedal in SFZ

Code: Select all

<curve>curve_index=11
v000=0
v032=0
v042=.1
v064=.3
v072=.4
v073=1
v127=1

<group> //Sustain samples

sustain_cc=90 //re-route default sustain pedal to CC90
ampeg_dynamic=1 //allow envelope to update on CC64 change
ampeg_attack=.005 ampeg_decay=0.5 ampeg_release=.8 //initialize default envelope
ampeg_release_shape=-6 //set the sustain curve dropoff curvature
ampeg_releasecc64=15 //make maximum release time 15 seconds
ampeg_release_curvecc64=11 //use the curve_index 11

Could anyone explain to me the logic behind it and how does it work?

Thanks

amc252
Established Member
Posts: 140
Joined: Fri May 05, 2023 12:24 am
Has thanked: 92 times
Been thanked: 22 times

Re: SFZ half pedal emulation

Post by amc252 »

I'm still processing this information to fully (or partially) understand it, but, for those interested, here is the answer I got elsewhere:

Code: Select all

First bit is a custom curve definition. On the left is the input from 0 to 127, on the right is the output 
(normalized as 0 to 1). 
This curve "low" at first, then has a smoooth, gradual rise from 32 until 72, where it immediately and rapidly 
shoots up to 1 (full max "high") at 73 and beyond.

sustain_cc yeets sus pedal to CC90 (to be ignored or processed elsewhere?). I assume basically we're 
hijacking the sus pedal info here so we can treat it like a variable CC (0-127) rather than its frequent treatment 
as bipolar (on/off). 
This is probably to get around default sus pedal behavior in the player

ampeg_dynamic=1 I believe forces the envelope to change when CC64 changes, to allow changes while a 
note is playing. This is normally not the case.

The next line set up the the envelope for the samples: a short 5ms attack (to remove any clicks), a 0.5s decay 
(no sustain value set so this value has no effect as shown afaik), and a 0.8s release.

ampeg_release_shape is the curve of the release. This is a negative value so the curve will be concave I believe.

ampeg_releasecc64=15. ccNN on an ampeg element adds onto the base value. In this case, if CC64 is 0, our 
release is 0.8 + 0 or 0.8s. If it is 127, then our release is 0.8 + 15 or 15.8s 
(i.e. basically no audible release, note continues to ring for a long time).

ampeg_release_curvecc64=11. This is saying the input from cc64 should, rather than working linearly, use 
the custom curve defined above.

For example, if CC64 is 42, we will get 0.1 * 15 added onto our 0.8s release. If it is 72, we will get 0.4 * 15 
added to our 0.8s release. 
Values in between defined points are interpreted linearly (lerp), so a value of 53 would give us 0.2 * 15 
added to the release.

----
Note that some of these opcodes may only work in the ARIA Engine (Sforzando or ARIA players). This methodology 
also does not simulate the sympathetic vibrations of full pedal notes, it just controls how long the release time is 
depending on sus pedal position. 
Post Reply