Forums > Max For Live

Save buffer contents with Live set or registered in Live project?

March 16, 2014 | 8:13 pm

I am writing a recording and sequencing device and would love to find a way to save the recorded audio data in my buffer~ objects along with the Ableton Live set. If this is not possible, is there a way to save the data as an audio file within the project, so that the set and project are aware of them when using the "Manage Files" dialog? I want to avoid the samples being lost when there are changes to the Live set.

Thanks!


March 17, 2014 | 1:31 pm

I save the buffer audio using a write message that includes the folder address. Something like,

"write" + "Macintosh HD:/Users/mikeF/Documents/Samples/MaxLoops/loop1.aiff"

Then I read it using the same address with a "read" message. The process can be somewhat automated if you use objects like "opendialog" to get the folder path, "combine" to create .aiff names, and "sprintf" to format it".

It also doesn’t hurt to have a simple "write" and "read" message attached to the buffer, to save things manually, if the above method is not working.


April 6, 2014 | 11:31 pm

I guess I should save them in the live project’s samples folder, but how to get the full path of that folder from max? And then I wonder what the correct way to save the file path in the live set is?


April 8, 2014 | 1:09 pm

This is one way to do it.

– Pasted Max Patch, click to expand. –
  • This reply was modified 4 months by  mike fonte.

April 8, 2014 | 1:32 pm

I think what I’m looking for is a way to do this automatically so it happens behind the scenes. I want to be able to record into ~buffer, save the live set, close Live, then re-open the live set and have the contents of the ~buffer objects all automatically loaded and ready to go.


April 8, 2014 | 2:01 pm

Since buffer~ is only going to store what you tell it to store (by reading and writing) there is no way I know of to do that "automatically".


April 9, 2014 | 1:00 pm

Patrickkidd, would you mind opening the patch I posted for you? Some feedback would be nice.


April 9, 2014 | 1:28 pm

I opened your patch before my first reply, and thank you for posting it.

By "automatic" or "programatic" I mean without user interaction. Your patch shows how to get a file or folder path from an interactive dialog, and then how to format the resulting output into a filename. I am looking for a way to do this *programmatically*, which means without user interaction. That would require a function from the max for live api that returns the path of the current live set file, so you can then calculate the full path of where to store the audio file.

To be perfectly clear, the goal is to save the live set from Live’s "Save" menu function and have the max patch to save the contents of the ~buffer into a file as well (probably by a some kind of save event from the live api) by calculating the path relative to the live set file’s path, and sending the ~buffer object a "write" message with the *programmatically* calculated path as an argument.

This is not a question about ~buffer as much as it is a question about the Max For Live API and how to get a string containing the full or relative path to the live set on disk *without* user interaction.

Thank you


April 9, 2014 | 2:36 pm

You are welcome, I appreciate your response!

Did you see this post about the live set path?

http://cycling74.com/forums/topic/can-i-get-the-file-path-of-the-current-live-set-using-max-for-live/

Also, I was looking in the LOM for a "save event" or a "savebang" and could not find anything.

If that functionality doesn’t exist, then some user interaction may be required.


Viewing 9 posts - 1 through 9 (of 9 total)