Using sprintf or alternative to continuously change file name

Apr 25, 2011 at 3:19pm

Using sprintf or alternative to continuously change file name

The following patch isn’t anything much, but it’s the most basic form of what I’m trying to do. It basically works the way I want it too, and I think I know how to make it automated and go in a loop, to keep recording and save a .wav file every time it’s triggered.

– Pasted Max Patch, click to expand. –

But I don’t want the file to be overwritten, and want to get multiple files. Something like soundbite1.wav, soundbite2.wav

I think sprintf can do what I want for that, but I don’t understand how to do it.

– Pasted Max Patch, click to expand. –

This patch appears to show how it’s done, but I can’t get it working the way I want it to or understand it either.

If anyone can just explain how sprintf can be used to create a new .wav file every time it’s triggered, I would greatly appreciate it.

#56587
Apr 25, 2011 at 7:00pm

Something like the following patch should get you back on track. The important part is the %03ld which specifies an integer with up to three padded zeros.

– Pasted Max Patch, click to expand. –
#202872
Apr 26, 2011 at 1:20am

Maybe this?

– Pasted Max Patch, click to expand. –
#202873

You must be logged in to reply to this topic.