Invalid file name for Pbind recording

In order to render a pattern to disk, I’m building a filename for the recording:

~file=PathName(PathName.tmp++"test.aiff"); // KO
~file=PathName(PathName.tmp++"test.aiff").nextName; // KO
~file=PathName(thisProcess.platform.recordingsDir+/+"test_"++SystemClock.seconds.asInteger++".aiff"); // with a kind of timestamp // KO
~file=PathName(PathName.tmp++"test").nextName; // OK

p=Pbind(
	\dur, 0.2,//Pwhite(5,8),
	\freq, Prand([33,35,37,38],inf).midicps,
	\amp, Pseq([0.8,Pwhite(0.1,0.4,7)],inf)
).record(server: s, clock: t,quant:4, path: ~file, dur: 4 );
)

Only the basic filenames without extension are valid:
PathName(PathName.tmp++"test").nextName

All the other ones throw an error on the record call:

ERROR: Message ‘standardizePath’ not understood.
RECEIVER: PathName(C:\Users\xyz\AppData\Local\SuperCollider\test.aiff)

Why ?

PS: How to retrieve the current timestamp of the system ? I found SystemClock.seconds but it isn’t a timestamp.

At some point, I think we should remove PathName.

There is almost no reason to use it, ever.

Just about everything you need to do with paths is already supported in String. Going through PathName just introduces complication and it’s unnecessary in your example.

I’d just take it out.

hjh

Oh, forgot this one… it’s a bit obscure.

Date.getDate.stamp
-> 210126_093000

hjh