What makes the circle spin?

for sampling (grey) values from a function I use a circle. In the first Def I “drive the circle” with SinOsc. That works fine.

But what if I want to do it without SinOsc? In the second example, what should I take for phi? Is there a tick or phase value generated by SuperCollider that can be plugged in for phi?

SynthDef.new(\contour1, {
	/*:the countour function is sampled on a circle with
	given radius and centre coordinates.
	Contour function from:

	arg a=1,b=1,c=1,d=1,e=1,f=1,i=1,j=1,k=1,l=1 /*:(float) contour function variables)*/
	, radius=1, centreX=0, centreY=0 /*:(float) defaults to unit circle at <0,0>*/
	, phi /*:(float) phase to sample at*/
	, circlefreq=440 /*:(float) speed at which the data on the cirkle is sampled*/
	var x, y, grey;
	x = MouseX.kr(0,100) + (radius * SinOsc.ar(circlefreq));
	y = MouseY.kr(0,100) + (radius * SinOsc.ar(circlefreq, pi/2));
	grey = e*(a*sin(i*x).sin + b*(j*y).cos) + f*(c*(k*x).cos+d*sin(l*y).sin).cos;
	grey = (grey - 0.5) * 0.1;
	Out.ar(0, grey!2);
c = Synth.new(\contour1,[\radius, 10, \circlefreq, 60.0]);
//c = Synth.new(\contour1,[\radius, 10, \circlefreq, 60.0, \b, 4, \i,3]);
SynthDef.new(\contour2, {
	arg a=1,b=1,c=1,d=1,e=1,f=1,i=1,j=1,k=1,l=1
	, radius=1, centreX=0, centreY=0
	, phi
	var x, y, grey;
	x = centreX + radius * phi.cos .....? // 1/SampleRate*circlefreq
	y = centreY + radius * phi.sin .....?
	grey = e*(a*sin(i*x).sin + b*(j*y).cos) + f*(c*(k*x).cos+d*sin(l*y).sin).cos;


If you need phi to be a continuously ramping value, you can use one of:

Phasor.ar(1, rate:1, start:0, end:2pi);


Sweep.ar(1, rate:1);
1 Like