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.
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.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1362.3oc0Z0zaiaCD8r8uBBAr2bkE+TRKVTfTrGZOjSE8TSQgrMsM2JK5pOx lrK1+6kjRxVIwVVVlVN8PDfnTDe7My7lYH82GOxYl7IdlC3if+DLZz2GOZjY H8.iptejylnmlGGkYdMm4xMa3I4NSJeVN+oby3eB7HOUr745GrMJe9ZQxp+N kOOubBB7BbQDFM.MAfCQtzI.H0y0aB.otB9qp+ykxj7Lw235+IHR83pgSWMS Oj2tQDKLyrb1W9IFpddSJ1HRh44FzBa7ISh1X9jN2kJhh2AyTdlZ4DkKjIMf Jzi.2gUBjnAoW0kc.UMUxh754xSO3OFOVeYxERleMUjyA+bKbIDS07Ggg0nh F35q.KBZCpDZWpTydHJl3Gpv4fyjJDs.juVjA1vyxhVwA4RvrhkK4osxuH7d PyLfFF5YQR1yxjLNTiQFz6JwuUr2Q7Tev49n4hjbY1Zvu94ON8Ox3oYS2H9G 9zOKmWnsLYSuuHNWbOegH5tYJnHSZLBvCRl96xjUvowR416biDKW9fS8zUB9 7m2xKWtNN6VZGJ1HjXhc0VpJiGkBM1P+iY2ftzPJLv+slJZ3AMUniZp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YT8AMFbfw2O41aU0 EUiWszupdggcIpX3xJ2onB8AiLPdg5CjnapFCD+P6BdFNU9t3NOb0HzIIidx MkE.Gsc6ipFCp9jFfn5u3KxT8srIlaEIk2Z58yIk+nn98olQhRUE9mqp5uHs rD7mXDmw544Gi+OPC5OiR -----------end_max5_patcher-----------
- This reply was modified 2 years by mike fonte.
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.
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"
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1470.3oc2as0biZCE94ryr+Gnj9nWWjD2beq+N1YmLXiri1Z.OfrS1tS6u8J oivWRvfvHvo8EGKg.NmOc9N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rhe8A0RGf9oOwr6VOcDuD4xZpPOVZuJtizN+BLaLBR78O0u71JyC+e fx7t.DaozNAP1V4bdsUNmuOTGRCKYeNiWw+w1q+Pl9J4JSxSKx.o1NMaY.zP LRYrAdph+.EDTPWRsVhBngjnfFhvPR5d1Bhf6W3EJ+c+zFTBg7BuA3pJ1Wtp Vv0m8vYMPzMkVwY4IblruEGWjvwjyYR6yrzTZ9Em2UFKcWgvTQKGQPrdRH3S FoNCO4nydSrJoiFEB2xdeuTDutTDYcVcnI1VthMRthubaXBjqHijKzjiWgFu Oh5iEIJXAXK5qrE8BNNZ7LICMFhuMUQcz3XQd00iFOUw2DUIbxMhMRrPgStQ r72.U2BVucqRzsuntN.se0K5lg0UESzD+IGgwF4WMn2HLJDJlHRctnp3WpAi G.iMxMwasnlBH1HA6saDFfwD0gNGCHM.3xA2aHFSldH1HGXXTegXjtzOO3GE RX77nf2MrtWnfoNYT2.HVJ6r2nm3XHFnO9DcUM3tqJngoJZe6istfMRWVL87 BjQ7B7zKXFEXG622c+.U9n5VtCjW4fQbq2y35RlXD13c9dkzLF9gjFBjLLtd v3gvnwozZomAkQh+E4.5OlFKHiJtF606vTPrGDF5ZIFzrKFEDn+L.99HpjFk Q4z6KDEMJY5pysEs3rDckCFQ.NzzhHmX.NvHWgQSufYluv6.hYT3YzzWxBxa T3JZurD8A8FdbvHRVLZqeP.rt8wI61cfVVoexfD4lk78hR43vYvXVNLF5Msa IUdlGvsr.lJob0yLNcEeeIzg8WiCk+mGndghO9WfQObzI -----------end_max5_patcher-----------
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.
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..
Forums > Max For Live