Automatically Create Folder For Save Location

Awesome Boy Yes's icon

Awesome Boy Yes

4月 01 2020 | 1:51 午後

I'm making a Max For Live patch that records audio, independently of Live (sfrecord~), and saves it to a location. I've got it working with an [opendialog] but it'd be great if the user didn't have to specify where to save it every time the patch is loaded. E.g., within Ableton's User Library folder.

Thanks!

Source Audio's icon

Source Audio

4月 01 2020 | 1:58 午後

If it's for your own use, just manually create that folder
and use absolute path to it to write files.
If you want that to work on other machines, than
use shell or something similar like jasch's createfolder external to auto create that folder.
I am not using Live, but I guess that it dictates where that user library is, or ?
You can use sprintf or combine to make full path out of
that folder's path and audio file name.
Mind you - sfrecord~ will overwrite any file without warning
when it receives message open with the path appended.
If that is issue, than you could first check if file allready exists
or not.

Awesome Boy Yes's icon

Awesome Boy Yes

4月 01 2020 | 2:12 午後

Hey, thanks for your reply.

It would be for use on other peoples' machines, yes. I'm taking a look at shell currently, but I'm also stuck trying to include an external as part of a patch for other users (I submitted a topic precisely about this earlier). I thought maybe there was a way to do this using Max 'vanilla'.

I'll check out Jasch's createfolder too, see if it'll do what I'd like.

Yeah I've got the location of the User Library now. (Users/(user)/Music/Ableton/User Library) for those who might need it.

I've got the filename time-stamping so the filename for sfrecord~ will always be different (ie not overwite) if that's what you mean?

Cheers

Source Audio's icon

Source Audio

4月 01 2020 | 3:22 午後

You can short user path on mac using
~/Music/Ableton/User Library

Shell needs slash based path, same output would also work for
createfolder external.

Max Patch
Copy patch and select New From Clipboard in Max.

There should be no problem to include externals into
max4live device, I think you should find a tutorial how to do that,
but what might become a problem is Mac OS restrictions,
see the posts about shell and gatekeeper on Catalina.

And timestamp is a good approach for the files.
Maybe One could use project - track name + timestamp,
that can be done using Live Object I think.

And mkdir is the message for the shell,
mkdir + path

Awesome Boy Yes's icon

Awesome Boy Yes

4月 01 2020 | 4:37 午後

This is perfect. Thanks so much for your help. I'll look into saving externals in a Max For Live device too.

schlam's icon

schlam

1月 25 2021 | 4:42 午後

Hello, I am looking for the same thing but on windows...

Source Audio's icon

Source Audio

1月 26 2021 | 8:02 午前

shell can execude cmd so why not have a read on all possible
commands available, including making of directories ?
https://ss64.com/nt/index.html
and then
https://ss64.com/nt/md.html
One has to take care about proper fromating of messages to shell,
because max is max and has it's own head about symbols

or use createfolder external from Jasch package.

schlam's icon

schlam

1月 26 2021 | 12:17 午後

It already have [createfolder] but it seems to be only for Mac...
..and I really don't know shell...:/
, I will investigate this way...

....it's me or creating a simple folder in windows is not so basic ?

Thank you !

Source Audio's icon

Source Audio

1月 26 2021 | 12:43 午後

createfolder.mxe createfolder.mxe64 are windows externals

schlam's icon

schlam

1月 26 2021 | 3:32 午後


the jasch were already installed

..but the help file says me that it was working for "Max OS X Only"...
..maybe an old helpfile or old version conflict.
I have to clean my computer =)

Anyway, it's working !

Thank you !

Source Audio's icon

Source Audio

1月 26 2021 | 3:50 午後

yes you are right - windows version was included only in very last release.

mistabu's icon

mistabu

10月 22 2024 | 12:12 午後

Anyone knows where to download createfolder externals?

Thanks

Source Audio's icon

Source Audio

10月 22 2024 | 12:18 午後

package manager

If you dislike package manager

you can also use shell to create folders.

on mac mkdir, on windows md for example