Storing file paths and lists with [pattr] and [pattrstorage]

millenliam's icon

I am currently learning how to use [pattrstorage] and [pattr] objects to save and load settings in my Max patches.
I have got it working fine with number boxes and umenu's, but I have now hit a brick wall. I have two questions:

1. How can I store file paths of audio files in buffer~ objects using pattr?
2. How can I store lists of numbers using pattr?

Thanks.

seejayjames's icon

1) you should be able to store filepaths in umenu, check "Pattr Stores Symbol" in the umenu Inspector. populate the umenu with filepaths, being sure the path is a single symbol (maybe need [tosymbol]).

2) lists can be stored with multislider, matrixctrl, table, etc... so if you make your list some other way, put it in one of these pattr-able objects (even if it's just a dummy placeholder, you can hide it). multislider is the easiest for this.

hth!

pdelges's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You don't need objects beside pattr to store pathes or list:

p

millenliam's icon

Ahh thats very useful thanks Patrick.
I wasn't aware you could use the [pattr] object like that.
In the end I just routed any file path names and lists into [textedit] objects which were then attached the [pattr] objects through the 'bindto connection' outlet.
Is there a reason why I should choose one of those methods over the other?

Julien Bayle's icon

thanks a lot. 11 years later.

Michael Müller's icon

Many thanks for this. I was struggling with that problem also.

I used textedit to store the file path, as it seemed the only way to connect to a pattr object.
But file path seemed to be scrambled, something like
"Macintosh HD:/Users/michael/Desktop/duck/duck-blue.dae"
recalled from pattrstorage became(routed out of textedit)
\"Macintosh HD:/Users/michael/Desktop/duck/duck-blue.dae\"
BTW. json file opened in Smart Json Editor seemed ok.

Thanks