sustainHalfOn
and sustainHalfOff
. You can use these just like you would normally use sustainOn
and sustainOff
. You can use any of the sustain pedal styles, and everything will work as expected. You do need to add an explicit call to sustainHalfOff
when you want the half pedal to end. Calling sustainOn
does not automatically turn off sustainHalfOn
.
Under the covers, this works by representing sustain half on/half off as Una Corda pedal events. The logic temporarily changes the rendering of Una Corda pedals when you call sustainHalfOn
, and changes it back when you call sustainHalfOff
. We also temporarily change the value of Staff.unaCordaPedalStyle
to match the value of Staff.sustainPedalStyle
for the duration of the half sustain event so that the intended sustain pedal style will be used.