Saving buffer~ setting

TimBenjamin's icon

Hi

I'm a bit new to M4L so please bear with me.

I have a Max Instrument that I made that does things to a file loaded into a buffer~. It all works great. But, I want the option to have a different file every time I use the Instrument so I have used a "replace" message on the buffer~ tied into my UI.

My question is: how can I make things so that Live remembers what file I loaded into the buffer~ without making the audio file an attribute of buffer~? Ideally I would like Live to keep track of the file the same way it does with other audio files that you use in Live itself (i.e. not in Max) but I'm guessing that's not possible to accomplish within M4L.

Thanks for any help!

Cheers
Tim

seejayjames's icon

you might look to [umenu], it can store the last-loaded file if you use the "append" message, and [pattr] can store that name as a symbol (look in Inspector).

[umenu] is a great object for file usage anyways (with autopopulate feature) so it's worth a close look if you haven't already.

pid's icon

no in m4l you should just use a [live.drop] (dummy unseen if you need to) - it does all this for you. sort of.