Freezing M4L with multiple Buffer~'s
Hello,
I'm a recent convert from PureData to M4L so please excuse the noob question. I have tried to implement advice from similar forum threads and couldn't find anything that resolved this issue.
I am finding that my abstractions with multiple buffer~ don't seem to load in Ableton once they I apply a freeze in Max. I am trying to load 3 waves (IRs) for use with multiconvolution~ (HIRT/HISS external) and I am using the following loading structure:
[loadbang] -> [replace "filename.wav"] -> [buffer~ ---"buffername"]
The wav files are in the parent directory of the abstraction (/Users/[myUserName]/Music/Ableton/User Library/Presets/Audio Effects/Max Audio Effect on Mac). I have also tried the [live.drop] method with no luck.
Does the contents of the buffer~ get saved in the abstraction when the device is frozen? From what I can tell, it doesn't seem to be, and also when frozen, the I'm sometime not able to reload a wave file into the buffer (it populates errors in the Max console, but usually lets me load files again after another save).
Am I missing something basic here? I've been pulling my hair out for two days so any help would be massively appreciated!
the loadbang procedure seems correct, but there are alternative methods. just one example: with the help of [thispatcher] you can create and call paths relative to the max patcher you are in, which can be quite useful for cross-compatibility.
"Does the contents of the buffer~ get saved in the abstraction when the device is frozen?"
nope. you can include media files in a frozen device, but they are not "in the buffer" then.
for short files i prefer to store the sample data in a [coll] using [peek~], and otherwise there is nothing wrong about reading them from harddisk.
Thanks for the reply! Wow, that gave me a lot to go through! I was able to get an absolute path using a "path" message into a [thispatcher], which I assume is always the current location of the abstraction, right? In this process of trying to learn this, and from exploring the "Show Containing Project" menu, I realized that the freeze action creates an additional folder structure that is then referenced as the relative directory. Maybe this should have been obvious but it took me a hot minute to figure out.
So it turns out my .amxd project was saved in this directory:
/Users/[myUserName]/Music/Ableton/User Library/Presets/Audio Effects/Max Audio Effect/
and after freezing, it is referencing this directory:
/Users/[myUserName]/Music/Ableton/User Library/Presets/Audio Effects/Max Audio Effect/Max for Live Devices/[myProjectName]/
When I copied my IRs into that directory, things worked perfectly in Ableton with the frozen version. But how would I make this portable? As it is now the .amxd file, then some additional folder structure? (I noticed the external I used for the convolution was in the [myProjectName]/externals folder as well). I was under the assumption that this would all be saved in the .amxd file, and would work as long as it and the IR .wav files were copied to the same directory. I think I am still missing something here!
Thanks again for the help, this already got pointed in the right direction I think.
Edit:
After some more digging, should I be consolidating my project, and using the "Export Max for Live Device..." option in the "Show Containing Project" window? For some reason, it is disabled (greyed out) for me so I wasn't able to try it.
"But how would I make this portable?"
in a worst case situation by different installers for different systems. if i dont miss anything relevant (i am not a m4l user) you could for example also use /user/application support for your IR samples or create a custom folder under windows.
but first you need to make the decision if you really want that. maybe you want to share the same files between different devices? then it is perfect having extra files on the HDD. but smaller stuff could also be included in the one or other way.
I take your point. In this specific case, the portability is pretty important. My whole motivation for creating the M4L devices in the first place was to share with the community (I created a Hammond organ sample library for PianoBook, and realized that there were no good cross platform Scanner Vibrato and Leslie/Rotary effects).
I'm getting the impression that most of the problems I'm experiencing are specific to M4L too, such as moving around dependancies. I'm also wondering now if the reason the "Export Max for Live Device..." action is greyed out is because it requires the full Max/MSP licence (although couldn't find any reference to this on the version comparison page).
I am interested in your original suggestion of using coll and peek~ to store the sample data prior to freezing too. I was trying to make this work yesterday, but I found I was a bit out of my depth. What might this save/recovery structure you mentioned look like?
For reference, the samples are quite short. One project would have (x4) 5-second spring reverb IRs, and another project would have (x2) 1-second and (x1) 3-second cabinet IRs. My failed approach was loading the audio into a buffer like normal, driving a counter with a metro to send each sample from the buffer, though peek~ and into coll (but this didn't seem to work, I think I have some fundamental misunderstanding of what these blocks do perhaps).
You know that you can freeze the wav files into the device? Forget about saving them into coll or something.
it is not sooo difficult to read and write data from a buffer, but as 11olsen says you can also include the media files in a device or app and that is for sure less work.
the only disadvantage of both methods would be that these extra 1 mb are then in each of the 100 plug-ins when someone opens 100 plug-ins. if that is relevant, "disk" wins.
if you think you want to take it as exercise, why not build all three methods?
regarding export: yes, every form of save export and copy is only available after registration. but for details about live decives i would be the wrong person. ;)
i was about to post you a peek example but reading and writing is pretty much covered in the peek helpfile.
in coll then you would use [prepend 7] to write a sample value to position 7 and "7" to read it out on init.
Thank you again! I'll take a stab at it :)
To 11Olsen's point, I think I was able to get it finally. With the M4L License I was able to Freeze, then unfreeze, then achieve the device after adding in the wav files in the media folder and referencing them as dependancies. I got a friend to check on his machine (also a mac) at it seemed to open and work correctly on his system without needed to add the wav files manually to an additional location. It just wasn't very clear that this would work as intended.
I'm a happy camper now though! Eventually, I'll have to splurge for the full Max license. It would be nice to circumvent this and just have the native export option. Plus gen looks really cool!
Thanks again for the help!!