# 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
``````

Thanks,
Jan

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.

Thanks.
Jan

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

hjh

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

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!!