Hello,

Wondering if someone can explain STK Modulate to me; I just don't seem to get it!

The code below is just a little test to try and figure it out -- works as expected if you comment out all the Modulate related bits, but as is, makes a muddy hum...  Obviously I'm doing something wrong!

Can anyone shine some light on this for me?

Thanks

-----------------------------------
// SinOsc m => dac;

// the offending portion!
SinOsc m => Modulate modu => dac;
60 => modu.vibratoRate;
1 => modu.vibratoGain;
1 => modu.randomGain;

// fine from here...
200 => float freq;
0.3 => m.gain;
 
while (true) {
    // just to keep it interesting...
    Std.rand2(1, 4) => int multipler;
    ((freq * 2) - freq) / 12 => float step;
    step * multipler => float newfreq;
 
    if (freq > 2000.0 || freq < 150.0) {
        if (freq < 150.0) {
            freq + newfreq => freq;
        } else {
            freq - newfreq => freq;
        }
    } else {
        if ( maybe ) {
            freq + newfreq => freq;
        } else {
            freq - newfreq => freq;
        }
    }
    freq => m.freq;
    250::ms => now;
 
}