Pattr FilePath

May 13, 2011 at 5:53pm

Pattr FilePath

Hi

i’m making patch which will be a standalone for a friend and i’m stuck as to how i can store a folderpath and vst plugin filepath using autopattr and pattrstorage.

I started using coll but when i retrive the objects in coll, i get a symbol before the filepath. how do i get rid of this?

another thing. i would like to use the same method for tracking down the filepath of a plugin. so far i get it right but upon retriving the filepath in coll, i get an error because there isn’t any ” ” closing the filepath. How do i get around with this?

here is an example. also a patch

{
“patcher” : {
“fileversion” : 1,
“rect” : [ 487.0, 116.0, 713.0, 652.0 ],
“bglocked” : 0,
“defrect” : [ 487.0, 116.0, 713.0, 652.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“enablehscroll” : 1,
“enablevscroll” : 1,
“devicewidth” : 0.0,
“boxes” : [ {
"box" : {
"maxclass" : "number",
"varname" : "number[2]“,
“fontname” : “Helvetica”,
“numinlets” : 1,
“id” : “obj-20″,
“numoutlets” : 2,
“fontsize” : 12.0,
“outlettype” : [ "int", "bang" ],
“patching_rect” : [ 185.0, 288.0, 50.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “t b”,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-16″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "bang" ],
“patching_rect” : [ 281.0, 345.0, 23.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “i”,
“fontname” : “Arial”,
“numinlets” : 2,
“id” : “obj-12″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "int" ],
“patching_rect” : [ 85.0, 300.0, 32.5, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“varname” : “message[4]“,
“text” : “Phobos:/Sounds/Old Klang/”,
“fontname” : “Arial”,
“numinlets” : 2,
“id” : “obj-7″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 318.0, 372.0, 219.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “number”,
“varname” : “number[1]“,
“fontname” : “Helvetica”,
“numinlets” : 1,
“id” : “obj-2″,
“numoutlets” : 2,
“fontsize” : 12.0,
“outlettype” : [ "int", "bang" ],
“patching_rect” : [ 99.0, 276.0, 50.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “set”,
“fontname” : “Helvetica”,
“numinlets” : 2,
“id” : “obj-1″,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "" ],
“patching_rect” : [ 110.0, 118.0, 32.5, 16.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “set 0″,
“fontname” : “Helvetica”,
“numinlets” : 2,
“id” : “obj-34″,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "" ],
“patching_rect” : [ 72.0, 118.0, 37.0, 16.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “r clearFolder”,
“fontname” : “Arial”,
“numinlets” : 0,
“id” : “obj-33″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 52.0, 80.0, 76.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “inc”,
“fontname” : “Helvetica”,
“numinlets” : 2,
“id” : “obj-32″,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "" ],
“patching_rect” : [ 77.0, 185.0, 32.5, 16.0 ]
}

}
, {
“box” : {
“maxclass” : “number”,
“varname” : “number”,
“fontname” : “Helvetica”,
“numinlets” : 1,
“id” : “obj-30″,
“numoutlets” : 2,
“fontsize” : 12.0,
“outlettype” : [ "int", "bang" ],
“patching_rect” : [ 99.0, 205.0, 50.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “incdec”,
“numinlets” : 1,
“id” : “obj-29″,
“numoutlets” : 1,
“outlettype” : [ "float" ],
“patching_rect” : [ 77.0, 205.0, 20.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “clear”,
“fontname” : “Helvetica”,
“numinlets” : 2,
“id” : “obj-27″,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "" ],
“patching_rect” : [ 34.0, 118.0, 37.0, 16.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “t b”,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-26″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "bang" ],
“patching_rect” : [ 154.0, 175.0, 23.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“varname” : “message[2]“,
“text” : “Phobos:/Sounds/!!KLANG/”,
“fontname” : “Arial”,
“numinlets” : 2,
“id” : “obj-22″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 154.0, 205.0, 190.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “t l”,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-24″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 284.0, 296.0, 20.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “t b”,
“fontname” : “Helvetica”,
“numinlets” : 1,
“id” : “obj-19″,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "bang" ],
“patching_rect” : [ 287.0, 390.0, 24.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “s loadFolder”,
“fontname” : “Helvetica”,
“numinlets” : 1,
“id” : “obj-18″,
“numoutlets” : 0,
“fontsize” : 12.0,
“patching_rect” : [ 318.0, 445.0, 77.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“varname” : “message[1]“,
“text” : “prefix symbol Phobos:/Sounds/!!KLANG/”,
“fontname” : “Arial”,
“numinlets” : 2,
“id” : “obj-15″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 318.0, 420.0, 219.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “0″,
“fontname” : “Helvetica”,
“numinlets” : 2,
“id” : “obj-14″,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "" ],
“patching_rect” : [ 511.0, 172.0, 32.5, 16.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “loadbang”,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-13″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "bang" ],
“patching_rect” : [ 511.0, 127.0, 58.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “prepend prefix”,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-11″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 318.0, 393.0, 85.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“varname” : “Folder”,
“text” : “autopattr Folder @autoname #1″,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-46″,
“numoutlets” : 4,
“fontsize” : 12.0,
“outlettype” : [ "", "", "", "" ],
“patching_rect” : [ 419.0, 47.0, 181.0, 20.0 ],
“restore” : {
“number” : [ 0 ],
“number[1]” : [ 0 ],
“number[2]” : [ 0 ]
}

}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “coll”,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-9″,
“numoutlets” : 4,
“fontsize” : 11.595187,
“outlettype” : [ "", "", "", "" ],
“patching_rect” : [ 318.0, 347.0, 59.5, 20.0 ],
“coll_data” : {
“count” : 1,
“data” : [ {
"key" : 1,
"value" : [ "Phobos:/Sounds/!!KLANG/" ]
}
]
}
,
“saved_object_attributes” : {
“embed” : 1
}

}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “store 0″,
“fontname” : “Arial”,
“numinlets” : 2,
“id” : “obj-8″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 318.0, 318.0, 235.0, 18.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sprintf store %ld %s”,
“fontname” : “Arial”,
“numinlets” : 2,
“id” : “obj-5″,
“numoutlets” : 1,
“fontsize” : 11.595187,
“outlettype” : [ "" ],
“patching_rect” : [ 318.0, 260.0, 113.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “button”,
“numinlets” : 1,
“id” : “obj-52″,
“numoutlets” : 1,
“outlettype” : [ "bang" ],
“patching_rect” : [ 154.0, 115.0, 20.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “opendialog fold”,
“fontname” : “Arial”,
“numinlets” : 1,
“id” : “obj-53″,
“numoutlets” : 2,
“fontsize” : 11.595187,
“outlettype” : [ "", "bang" ],
“patching_rect” : [ 154.0, 149.0, 89.0, 20.0 ]
}

}
, {
“box” : {
“maxclass” : “inlet”,
“numinlets” : 0,
“id” : “obj-56″,
“numoutlets” : 1,
“outlettype” : [ "" ],
“patching_rect” : [ 154.0, 55.0, 25.0, 25.0 ],
“comment” : “”
}

}
],
“lines” : [ {
"patchline" : {
"source" : [ "obj-34", 0 ],
“destination” : [ "obj-29", 0 ],
“hidden” : 0,
“midpoints” : [ 81.5, 176.5, 86.5, 176.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-33", 0 ],
“destination” : [ "obj-34", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-33", 0 ],
“destination” : [ "obj-27", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-32", 0 ],
“destination” : [ "obj-29", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-26", 0 ],
“destination” : [ "obj-32", 0 ],
“hidden” : 0,
“midpoints” : [ 163.5, 204.0, 125.0, 204.0, 125.0, 175.0, 86.5, 175.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-29", 0 ],
“destination” : [ "obj-30", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-24", 0 ],
“destination” : [ "obj-8", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-19", 0 ],
“destination” : [ "obj-15", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-14", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ 520.5, 342.5, 327.5, 342.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-13", 0 ],
“destination” : [ "obj-14", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-56", 0 ],
“destination” : [ "obj-52", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-52", 0 ],
“destination” : [ "obj-53", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-8", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-30", 0 ],
“destination” : [ "obj-5", 0 ],
“hidden” : 0,
“midpoints” : [ 108.5, 241.0, 327.5, 241.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-53", 0 ],
“destination” : [ "obj-26", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-53", 0 ],
“destination” : [ "obj-22", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-26", 0 ],
“destination” : [ "obj-22", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-22", 0 ],
“destination” : [ "obj-5", 1 ],
“hidden” : 0,
“midpoints” : [ 163.5, 234.5, 421.5, 234.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-15", 0 ],
“destination” : [ "obj-18", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-27", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ 43.5, 247.5, 327.5, 247.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-33", 0 ],
“destination” : [ "obj-1", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-1", 0 ],
“destination” : [ "obj-8", 1 ],
“hidden” : 0,
“midpoints” : [ 119.5, 225.5, 543.5, 225.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-5", 0 ],
“destination” : [ "obj-24", 0 ],
“hidden” : 0,
“midpoints” : [ 327.5, 287.5, 293.5, 287.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-5", 0 ],
“destination” : [ "obj-8", 1 ],
“hidden” : 0,
“midpoints” : [ 327.5, 298.5, 543.5, 298.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-30", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-9", 0 ],
“destination” : [ "obj-19", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-9", 0 ],
“destination” : [ "obj-7", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-2", 0 ],
“destination” : [ "obj-12", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-12", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ 94.5, 333.0, 327.5, 333.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-30", 0 ],
“destination” : [ "obj-2", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-8", 0 ],
“destination” : [ "obj-16", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-16", 0 ],
“destination” : [ "obj-12", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-20", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-7", 0 ],
“destination” : [ "obj-11", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-11", 0 ],
“destination” : [ "obj-15", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
]
}

}

#57113
May 13, 2011 at 6:21pm

Put a [route symbol] between the coll and whatever comes next.

#204582
May 14, 2011 at 8:23pm

oh i managed to solved it after asking. thanks for the fast reply.

is it possible to save file paths in pattr? i’m tried using coll but there seems to be a problem loading the filepath.

while using coll, in a standalone is it possible that whatever gets saved in the coll will be saved as well?

here is an example of what i’m trying to achieve.

d

#204583
May 14, 2011 at 9:10pm

I use textedit for that. The hardest part for me was storing the paths as relative paths instead of absolute ones. I use this patch to find out the path of the patch or standalone:

– Pasted Max Patch, click to expand. –

I use this patch to load a sound and put it’s relative path into a textedit object. the absolute path is re-created after the textedit.

It’s nice to do it this way because my app and it’s data files will be moved to different computers. I really wish there were a more elegant way to do this. I gather that most Max users don’t plan to move their work around.

– Pasted Max Patch, click to expand. –
#204584
May 15, 2011 at 5:25pm

thanks i’ll check it out when i get back home.

best

d

#204585

You must be logged in to reply to this topic.