Is there away to do startpos in PlayBuf in seconds?

I want to playback a sample in a SynthDef and want to define the playback position in seconds. 0 seconds in, 120 seconds in etc?
Anybody good at this math?

If you pass in the time in seconds as an argument, in your SynthDef you can use with your buffer id:

SynthDef(\test, {arg timeInSeconds = 120, yourBuffer = 0;
var startPos;
startPos = timeInSeconds *;


Something like that.

Hope that helps!


Thanks! Came up with this and this also works

(\simpsampHMS, {
	arg buf, amp=0.5, rate=1, h=0, min=0, sek=0;
	var sig;
	sig=, buf, rate,startPos: (((h*60*60)+(min*60)+sek) *,,doneAction: 2); 
	sig= sig*amp;,sig);

I can see that it is not the SampleRate of the server that I want but of the sample. But in this case they were both 41000 so it worked the same