Frequency instead of phase

thanks alot for your help :slight_smile:

in this thread are some hints for such an implementation, which i cannot make any sense of in my case.
The Sweep.ar rate cant be multiplied by BufFrames.kr(b) * bufRateScale.ir(b) because its phase is also used for the grain window (this is fixed) and phi is not a BufRd but a SinOsc.
Here is my extraction of the pm example from the thread:

(
{
	var carr = 100;
	var mod = 200;
	var index = 2;

	var bufFrames = BufFrames.ir(b);
	var phase = Sweep.ar(0, carr * bufFrames * BufRateScale.ir(b));
	var phi = ((1 - SinOsc.ar(mod, pi/2)) * index).mod(2pi);

	var sig = BufRd.ar(1, b, (phase + (phi * bufFrames * BufRateScale.ir(b) / 2pi)).mod(bufFrames));

	sig;
	
}.plot(0.02)
)

however none of these examples does give me the desired end result. the phase modulator isnt a plain sine wave.

(
{	
	var tFreq = 100;
	var trig = Impulse.ar(tFreq);
	var grainFreq = 400;
	
	var phase = Sweep.ar(trig, grainFreq);
	
	var grainWindow = phase < 1;
	
	var sig = sin((1 - phase) ** 3 * 2pi);
	
	sig = sig * grainWindow;

	sig;
}.plot(0.005);
)