Save buffer contents with Live set or registered in Live project?
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!
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.
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?
This is one way to do it.
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.
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".
Patrickkidd, would you mind opening the patch I posted for you? Some feedback would be nice.
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
You are welcome, I appreciate your response!
Did you see this post about the live set path?
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.
Here's an external I put together for that purpose.
The only way I've found to do it saves the buffer every time the user closes the set, or deletes the plugin from the rack. Basically, it's gonna save whether you want it to or not. But if you want it to restore the buffer, this seems to be the way to do it.
A savebang object doesn't exist as far as I know, so for now we can get by with "freebang"
Ah interesting. I didn't know about the freebang. All we need now is a way to accurately get the Live project or set path. I reviewed the other linked thread and it seems to be unreliable since it didn't work for me even after collecting and saving all assets to the project.
Interesting problem.
Found out a live.drop object recalls the last file and manages the transition into the project folder if you "Collect and Save".
You don't have to drop a file on it to work. instead you can use the "set" message with a filepath+name.
But be aware of the decode attribute which makes live.drop decode audio automatically.
Maybe that helps..