Can pattr be used to store string?

Apr 2, 2009 at 9:25pm

Can pattr be used to store string?

I am writing a patch where I need to store a series of filenames and other parameters from run to run.

autopattr and pattrstorage seem to work fine for numbers – however, the messageboxes where I am keeping filenames just show “object(message)” as the content, in the pattstorage clientwindow and storagewindow, also in the XML file when I save.

Is there a way to use pattr to save strings? Or should I be looking at something else?

Apr 2, 2009 at 9:37pm

Wait, I need to use a textedit field, not a message. That seems to work fine.

Now next question – I am specifying a filename in the write message that goes to pattrstorage, eg “write bsl”

This gives me an error from pattrstorage, “could not create file (-1)”

What could be the problem? I absolutely need for the patch to read and write from its file without ever prompting for a name.

Apr 2, 2009 at 10:14pm

Have you looked at the savemode attribute of pattrstorage? Set it to savemode 3 for no prompting. Try to save the file manually first by just sending a “write” message, or make sure the file you try to save, “bsl”, already exists.

Apr 3, 2009 at 12:04pm

Thanks, that’s helpful! @savemode 3 is not documented however, I can only see savemode 0 – 2 listed in the reference.

Apr 3, 2009 at 12:26pm

You’re right, it’s missing in the reference! It’s in the help file, in the patcher savemode.


You must be logged in to reply to this topic.