Questions about knob conditioning in SynthVoice Pod example

I’ve been studying the SynthVoice Pod example, and had 2 questions:

  1. AnalogControl::Process() is called 3 times on each knob in each audio callback. I would have thought once is enough. Is this just an oversight, or intentional?

  2. Knob behavior is “jumpy”: turning the knob often has no effect at first and then jumps to new value. For example, tuning the oscillator frequency is difficult because the pitch may jump by an octave or more. I stumbled on a fix: the knob behaves smoothly if you comment out the test inside ConditionalParameter():

//Updates values if knob had changed
void ConditionalParameter(float  oldVal,
                          float  newVal,
                          float &param,
                          float  update)
    //if(abs(oldVal - newVal) > 0.00005)
        param = update;

I find this behavior surprising. Can someone explain it for me?

many thanks,

  1. Nice catch! Technically yes, you should call knob.Process() once per callback. Subsequent uses should call knob.Value() in order to get the knob value without reprocessing it. That being said though, I’m not sure it really hurts anything to recall knob.Process() a few times.

  2. The idea here is that the knob will only update the value once you turn it aggressively enough, so if you just brush the knob, it won’t jitter around. However, this means that the values do have a stair step to them. You can either remove the conditional parameter as you’ve done, or change the threshold value to be smaller (more sensitive).

Great, thanks a bunch!

1 Like