Divergence in SinOsc's freq/phase modulation

Hello all,

would someone know what accounts for the different results in these examples?
Shouldnt SinOsc produce a clean sine when read by its phase with Sweep?

{var freq=100+SinOsc.ar(100,0,500);[SinOsc.ar(0,Sweep.ar(Impulse.ar(freq.abs),freq.abs).clip(0,1)*2pi),SinOsc.ar(freq)]}.plot //visual example

{var freq=100+SinOsc.ar(100,0,100*MouseX.kr(0.1,10,1));SinOsc.ar(freq)}.play //clean sound
{var freq=100+SinOsc.ar(100,0,100*MouseX.kr(0.1,10,1));SinOsc.ar(0,Sweep.ar(Impulse.ar(freq.abs),freq.abs).clip(0,1)*2pi)}.play //not at all


Try Impulse.ar(100) - you are retriggering your Sweep more often than you want

Hi @semiquaver,
like this?

{var freq=100+SinOsc.ar(100,0,500);[SinOsc.ar(0,Sweep.ar(Impulse.ar(100),freq.abs).clip(0,1)*2pi),SinOsc.ar(freq)]}.plot(0.05)

the result is even more different…the way i understand it the impulse should equal the rate to be in sync:

{var freq=100;SinOsc.ar(0,Sweep.ar(Impulse.ar(freq),freq.abs).clip(0,1)*2pi)}.plot

Trying to achieve a clean through zero fm with this Sweep into Phase model.


SinOsc help documents that phase should not exceed +/- 8pi – probably OK if you do Sweep.ar( /* ... etc ... */) % 2pi.


{var freq=100+SinOsc.ar(100,0,500);

you want freq*2pi freq.abs will have a “corner” in it

1 Like

Ah i see, i thought that clip(0,1)*2pi would have been the same. Many thanks!!