Multitrack Recording / DAW
Hello all, first of all thanks to all the participants here, I'm a two months into Max and the information here has been invaluable ( Dobrian, McCulloch, Thilenius .. ) you guys are awesome.
I am working on a mixer for my patches that has 16 mono ins, 4 stereo sends and a stereo master. I'd like to be able to record all the individual channels simultaneously as you would in a DAW. Ideally I'd love to keep everything in Max if possible.
I've read up on mc.sfrecord, sfrecord, rewire.... here are the approaches and problems that I hope someone can help me with.
Option 1: mc.sfrecord~ - This works in creating a multichannel audio file but I can't seem to find any info on how that can be easily converted into separate channels in a DAW like Ableton. If this was easily possible could someone please point me in the right direction as it seems like it would be the most elegant method.
Option 2: multiple ~sfrecord instances ( one for each channel ) I've toyed with linking all the record buttons so I can start recording every channel at the same time but having to name each channel file before and each time I want to record sections of the playing patch is a pain. I looked into finding a way to auto name each instance of sfrecord but can't find anything relevant. Also I wam worried about potential timing issues between each of the individual channels that would make syncing up the channels later a problem ( does anyone have experience with this ?)
Option 3: Rewire with mc.dac- this could be pretty good, I don't mind recording into Ableton but I can't get past the 16 channel limit. I've enabled all 64 channels in Ableton using the Options.txt rewire hack but ad_rewire creates groupings of 16 channels and each groupings channels start over at 1-16, I can't figure out how to send a second grouping to ableton in order to get any tracks over 16.
Here's my patch if anyones interested. It's still very much a WIP and it's a bit messy in places where I'm trying things out.
Best of luck during this weird times.
Update: regarding Option 1. I have found that you are able to pretty easily split multichannel audio files in a free app ( mac and pc ) called Audacity. Works good, adds an intermediate step between mixing down in Ableton though. An advantage is that you just have 1 audio file sitting around until you want to mess with it. The disadvantage is it's not easily auditioned ( at least when you try to use just mac finder to listen to a multitrack you only get the first 2 channels coming out of your speaker ) and that you have to do this extra export. ( also Audacity reminds me of software I used in 1996 but hey it's free and thank you to those who keep it going! )
Still would love to figure out the Rewire option though.
Multichannel file is not needed.
I made app for a sound engineer for recording up to 48 sfrecord~
tracks while mixing live acts and there was no time drift at all.
Only record end might result in files being of a slightly different lengths.
I solved that by shortly stoping dsp chain which resulted in record stop on all tracks
and all files being exactly same length.
Renaming files is not needed, just name each file according to source,
or number, and auto make folder with timestamp for recording.
So basicaly you combine path to record folder with track name.
A simple gate to enable / disable track for recording would do.
Here is a screen shot of smaller 24 track version and
folder created:

Using delay or pipe objects to push recording start into high priority thread
is also important.
Other methods could be:
1. record a multichannel file, loading it into a buffer~ , split it into several buffers using [mxj buf.Op], then write the buffers to disk.
2. Use software like Loopback or Jack to route Max's Audio directly into Ableton, circumventing Rewire's limitations.
like source audio says,
button
del 0
sfrecord~
and putting max into overdrive ON
is all you need to sychronize multiple objects.
but you might also want to look into record~ and buffer~
Thank you Audio Source, LSKA and Roman!
AS & Roman- I am trying out your suggestions to launch using a delay + pipe object
Audio Source- regarding "Renaming files is not needed, just name each file according to source, or number, and auto make folder with timestamp for recording."
I can't find any native object to create folders, I did find one by jasch objects ( https://www.jasch.ch/dl/ ) in case anyone else is looking. Are you able to accomplish this with just native max objects? If so would you be so kind as to breaking it down a bit more for me, from what I understand you are suggesting sending a message to each sfrecord~ that would create a folder with something like an $ to autogenerate an named index for the file names ex. ( user/max/recording/c1_04_06_2020_4:00.aif ) ?
LSKA, I'm also going to test out that buffer method you suggested as I think I have some uses for that as well Thanks!
I can't find any native object to create folders
you can set a new path with [opendialog fold] and then use [combine] to format your write message.

Hi LSKA Thanks! That got me on the right track, spent some hours with it and I was able to create auto generating names but I can't get the sfrecord~ object to be to receive a full file path / name and open command without having to go to an open folder dialog?
I've attached a stripped down version of my patch below in case anyone has time to take a look. If I can get this going I plan on posting the final version which I hope will be of help to beginners like myself! Happy Max quarantine to everyone too.
You're almost there!
You want to use [prepend] to add the open message to the filename.
Max can't auto-create folder even in year 2020.
There were many posts and complains about that since many years,
but there were also allways 3rd party solutions available.
Jasch externals are just fine on both mac und win,
I prefer shell as I use it for other tasks as well.
------
Now to path : that is really a long sausage of a path you are using, ha, ha.
If you want to keep that flexible, opendialog folder is ok,
paired with timestamp.
I prefer it differently, only choose hard drive, and rest gets autocompleted.
Might be a bit of a problem on catalina and apple restrictions.
But - to my knowledge sfrecord~ can't create path itself
you must have it ready prior to recording.
---------
The way to do it depends if record start time is critical, or if one can relax for
a short time waiting for recording folder to get created.
Like this:
1 loadbang default root folder path or open dialog folder to choose
or create new root folder
2 prior to recording combine root path with time stamp
to create actual recording folder and combine that with individual track names.
3 when actual recording folder gets reported as created send
individual open messages to sfrecord objects.
4 Enable record button so that one can start recording or auto start after some time.
----------
I prefer having folder with time stamp, not actual files,
but maybe you want it differently.
combine has triggers argument so you can trigger open message
with path when time stamp arrives.
I use sprintf - used to it since years.
You have to use leading zeros for timestamp !
-------
Now to resume, I would post a patch doing all that,
but you have to tell me more about recording process.
"from what I understand you are suggesting sending a message to each sfrecord~ that would create a folder with something"
such messages to objects always only create a file at that path if that path exists.
no full path will mean "beside the max app", and you can also use paths beginning with user or group, and if you want to save beside the patcher you are in (which is cool for a standalone), the [thispatcher] object can provide you the path to the patcher file.
myself i am using fixed locations such as mymaxfolder/audio_export/project_3/ or user/mymaxfolder/packages/audio_export/media/project_3/ and then move files manually around to where i want them to be. this method allows your max patch to be easily portable to other computers. all you have to do is to create that one folder once.
btw, using date and time is cool because it makes really unique filenames, but normally using a counter system should be enough. you will love when you are able to reset the counter for the second take.
btw2, for operating systems which do not allow to create a new folder within an opendialog there are usually third party extensions which "fix" that.
here is example of what I am suggesting :
needs createfolder external.
If you prefer having time stamp on each file ...
Then one can use allways same root folder
and just combine timestamp with filename.
instead of sprintf one could explore combine object
with padding and triggers arguments.
Thanks everyone! With all of your help it's getting really close. I also just came across this file creation section in the max cookbook ( https://music.arts.uci.edu/dobrian/maxcookbook/automate-file-creation ) which talks about creating indexed names like Roman's suggestion. I'll hopefully have it done in a couple days and will post it here in case anyone needs a fairly simple mixer / recorder setup.
Happy Easter! So here is what is passing as a functional ( at lease as far as I know so far ) Mixer / Multitrack Recorder / Daw bpatcher. If you find any bugs, have suggestions or make some modifications / enhancements please post here too. There are 3 components to this ( the mixer and simple send / receive bpatchers )
Each channel is selectable between adac input, direct signal or receive channel from receive bpatcher. Individual channels are mono with panning to stereo out to the send effects ( you can also run directly out of each channel ) Also you can monitor / record just the dry or just the wet signals. Upon choosing a folder every active channel will record a 24bit auto named file. There's also a transport control, metro bang out with selectable timing and some other stuff I find useful.

The mixer has some documentation in patching view. If you have questions let me know and finally I would like to express my thanks to Roman, Source Audio and LSKA for all their help!
Enjoy!
Mixer
Receive
Send
I've just started learning Max and wow, lots of info, useful patches such as these are incredible resources to learn from, wonderful to see such an awesome community over here.
Thanks for sharing!
Hi Jesus, Thank you I hope you find it useful!
@MARSONA - Your Multitrack recorder bpatcher is EXACTLY what I was searching for, thank you lots! Saved me lots of time! :)