stevefolta/SFZero

Why does SFZSynth::noteOn() call stopNoteQuick() for repeated notes?

jamiebullock opened this issue · 2 comments

SFZSynth::noteOn() calls SFZVoice::stopNoteQuick() if a note is repeated and not playing one shot mode. Why is this?

Because stopNoteQuick() initiates a 10 ms release, this causes a noticeable dip for quick repetitions of notes or chords with longer release times. Shouldn't SFZVoice::stopNoteForGroup() be called instead? Then the current behaviour will be retained if off_mode is set to fast (the default), but the standard release portion of the note will be entered if the off_mode is set to normal

The relevant code is here:

voice->stopNoteQuick();

I've just had another look at this, and I'm pretty confident that Line 53 should be voice->stopNoteForGroup() and not voice->stopNoteQuick()

For off_mode the SFZ Spec says:

Region off mode. This opcode will determinate how a region is turned off by an off_by opcode

Unless we call voice->stopNoteForGroup() for the implementation of off_by , the value of off_mode will have no effect.

Actually, it seems SFZero's implementation of off_mode is incomplete (it only supports the default and off_mode can't be read from the SFZ file). I am working on a fix for this.