@d-healey yes, I corrected it and works. As I'm reading several topics focused on this, I share my solution here.
After setting as many Constant pitch modulators as the number of octaves needed, here's the custom callback that makes the trick.
const var Pitch_knob = Content.getComponent("Pitch_knob");
Pitch_knob.set("text", "Pitch_knob");
Pitch_knob.set("suffix", " st");
Pitch_knob.setRange(-2, 2, 1/12);
Pitch_knob.set("middlePosition", 0);
Pitch_knob.setControlCallback(onPitch_knobControl);
const var PitchMod = Synth.getModulator("PitchMod");
const var PitchMod2 = Synth.getModulator("PitchMod2");
const var Label1 = Content.getComponent("Label1");
inline function onPitch_knobControl(component, value)
{
if(value>=-1 && value<=1)
{
PitchMod.setIntensity(value*12);
PitchMod2.setIntensity(0);
}
if(value<-1)
{
PitchMod2.setIntensity((value+1)*12);
}
if(value>1)
{
PitchMod2.setIntensity((value-1)*12);
}
Label1.set("text","Pitch: "+Math.round(12*value)+" st");
};
I used a label to show the value in semitones.