record the main audio output of a patch into a folder

R_Gol's icon

How can I record the patch audio upon a press of a toggle and stop the recording when pressing again and save that audio file with a pre given name into a folder?

the recording file should have the same name as the data recording file with an addition of the word "audio"

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

R_Gol's icon

Here is my trial:

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

Wil's icon

this will put named audio file in named location

using date and time allows to create a new file each time recording

don't have to change anything

// I use spat.record - hopefully you can figure out how to change to sfrecord

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

Source Audio's icon

Don't complicate ...

if you allready have path to "record" so called "data"

use same path to write audio files.

main question is if date alone as data and audio ID is enough ?

R_Gol's icon

main question is if date alone as data and audio ID is enough ?

Yes

Source Audio's icon

Then only one recording session per day is possible

R_Gol's icon

Then only one recording session per day is possible

Either name is change otr if name is the same record session number is increases on each recording

Source Audio's icon

Then everything is perfect and you need no further help ?

R_Gol's icon

I thought every thing is good but apparently it will make the file but record nothing into it.

Do you see an issue in my system?

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

Source Audio's icon

yes :

it should be @triggers not @trigger

but that has nothing to do with audio files.

If sfrecord does not record anything, then you did not start recording at all.

and remove that receive~ stuff and feed proper audio input

wherever it comes from.

see here how to enforce proper timing of

set record path and record start messages:

check max console for errors when you try to record.

R_Gol's icon

set record path and record start messages:

Sel 1 object output bang when record toggle is 0. This bang stops the recording?

I will try this as soon as I will be with my computer

Source Audio's icon

first try then ask

R_Gol's icon

first try then ask

True. Works as it should.

I do get those errors and wonder if to worry about?

Source Audio's icon

yes - that means that you started recording without providing valid path.

Should not happen if you have path properly entered into zl.reg.

R_Gol's icon

Should not happen if you have path properly entered into zl.reg.

Yes I accidentally press record before give it a name (that automatically give a path) this should not happen from my side.

R_Gol's icon

the open dialog thing is really charming. I wonder how I can add it to this patch without ruing its functionality?

so instead of writing manually name and session number - I want that when user press record a window will pop up and ask to enter a name then right after another window will pop up and will ask to enter session number. Is this possible ?

So when user press record it should first ask for enter a name and after user press ok it should immediately open another dialog and ask user to enter session number. only after this window close it should start recording. so the number 1 that goes to start the clocker should arrive only after all details was entered. I could store that integer of the record toggle inside [i] object but then when 0 is send

Edit2 my try:

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

R_Gol's icon

I feel I'm getting close but still not there...

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

It export txt file but is empty

Source Audio's icon

You could use one dialog for name and session number.

Make sure to triggter nothing before dialog gets closed and only output should trigger the rest.

Your patch is toooo complicated .

too many paths, sprintf's etc etc.

What do you really need ?

path to folder and file name which gets composed by name, date and session number ?

I have problems with your patches in general, because

objects are totally disordered, and only presentation mode

tells one what that few objects should do, but as soon as

presentation mode is off, chaos is again there, and it is a pain

in the ass to follow the functions in the patch.

I would do the following :

1- disabe everything until record path is set.

2- hit button "Record" to open Dialog for name and session number

3- after name is validated, apply path to sfrecord, coll etc

4- trigger record start and enable record stop button.

5- after recording finishes, enable record stat button again.

think that providing write path to objects overwrites the files without wanning !

to make sure files do not get overwritten, you could insert absolute path

to check if file allready exists.

P.S. why do you use patcher path AND opendialog folder path at same time ?

You either use path to patcher or that folder path set by user, not both ....

R_Gol's icon

to make sure files do not get overwritten, you could insert absolute path


What is absolute path and how do you make it?

What do you really need ?

path to folder and file name which gets composed by name, date and session number ?


Yes, but I need different path to the data file and different path to the audio recording. those to files will be made into two different folders.

btw - what is the name of the blue record object?

Source Audio's icon

but you issue path to patcher, and then use set folders for audio and coll files.

why not get path to patcher and add that 2 fixed folders ?

or better say if you want that 2 folders to be anywhere, why use path to patcher ?

and name it shorter: Data and Audio

if path is "Silent Pre" then

"/Silent Pre/Data/" and "/Silent Pre/Audio/"

.aif means it IS AUDIO FILE, why add -audio.aif ?

you like that toooo long paths ?

Source Audio's icon

P.S. select any object and get info or help file, to find out what it is

and what it can do.

R_Gol's icon

or better say if you want that 2 folders to be anywhere, why use path to patcher ?


What does it means? how can I make those folder be anywhere? by creating them automatically when patch is loaded?

P.S. select any object and get info or help file, to find out what it is


As you shared a picture I can't see the object name and access is help file and or inspector

Source Audio's icon

that is textedit set as button, trigger on mouse release.

And yes, you can create folders from max, using shell for example.

also name folders by date, and write files in there.

The question is what do you want ?

for example select main directory using dialog, like HD-2:/

and then auto create folders ?

R_Gol's icon

The question is what do you want ?

for example select main directory using dialog, like HD-2:/

and then auto create folders ?

I want that the two folders of "/Silent Pre/Data/" and "/Silent Pre/Audio/" will be fixed in the folder where the patch is sitting. and then to create folder by dates and store the files inside them sounds the best option. I did not know it is possible to create folder from within max..

.aif means it IS AUDIO FILE, why add -audio.aif ?


you are right. No need for that.

Source Audio's icon

Either auto create or not.

If you want fixed folders where patch or Standalone app is

then no need to create anything.

Files have date in names , no need to create folders with date again.

Pre made that folders and auto find them.

But think where you place your patch or standalone.

You need full write access.

R_Gol's icon

1- disabe everything until record path is set.


Disable using gate?

Files have date in names , no need to create folders with date again.


True. Will try your suggestions

Source Audio's icon

test this ... maybe it does what you need

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

R_Gol's icon

Thanks. For some reason I get error for the Audio folder (Main Folder is missing) although I created it:

That error I'm not getting for the Data folder

Source Audio's icon

You wanted to have "Silent Pre" folder next to the patch !!!

And Audio and Data folders inside, or did I get that wrong ?

R_Gol's icon

Silent Pre is main folder and inside there is the patch and audio and data folders

Source Audio's icon

ok, then remove "Silent Pre" from the path, and use only Data and Audio

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

Source Audio's icon

you have clocker AND audio recorder, both output progress,

and you use extra metro and counter to display elapsed time ???

R_Gol's icon

Amazing! I wonder (did not found it in the help file) if the record and stop record could be combine into one button?

R_Gol's icon

one issue: when rec button is pressed and after name and session number is entered the data record should start so I should see the file start from:

10,

20,

30, etc

R_Gol's icon

right now it is writing new data only if there was a change. I want it to write data constantly since the time record is started (after entering name and session number of course)

R_Gol's icon

you have clocker AND audio recorder, both output progress,

and you use extra metro and counter to display elapsed time ???

Yes. What wrong with that?

I want to display elapsed time since record start until it stops

Source Audio's icon

wrong with that is that you use double objects.

If you don't understand that ....

delete @triggers 1

then on each clock change new entry will be written into coll.

R_Gol's icon

Great Thanks!! ...

Source Audio's icon

here is your single record button....

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

R_Gol's icon

I don't get it why it show it records sound and my file is indeed weight some MB but no actual sound on the file..?

[Edit] problem in my vlc and not in the file