pattrstorage doesnt see scripted objects


    May 05 2006 | 4:15 pm
    Hi
    I am using pattstorage to save the states and content of objects. However, in my patch the objects are created and named with the script new object message to thispatcher. While pattstorage can see these new objects in the client window, it doesnt register any value changes (or anything at all) for these objects in the client window or in the storage window.
    I have noticed that if I close the patch, save it and open it again , then pattstorage sees and registers the behaviour of the previously 'invisible' objects...but this is not helpfull in my case really.
    I include an attachment as an example (not sure if it's there or not!).I also include as text a tiny abstraction needed in the patch.
    Any help would be great
    Thanks
    max v2;

    • May 05 2006 | 5:25 pm
      you have to "add" the autopattr object after the creation of new objects!
      1. script to erase autopattr
      2 script to create new objects
      3 script to re-create autopattr.
      every time you need to add or remove objects!
      it works for me!
    • May 06 2006 | 9:22 am
      thanks a lot! works for me too...
    • May 06 2006 | 10:58 am
      actually, there is a difficulty: if I use that method in a patch, it works fine (although I have to refresh the storage window by other means after re-creating the autopattr object). However if I open that patch as an abstraction within another patch, as soon as I create a new object, the client list disappears and stays blank from then on...(?)
    • May 06 2006 | 12:58 pm
      actually i am pretty sure, that exactly this was fixed by jb in some
      update.
      anyways the patch below works for me; meaning i can script-create a
      number
      and its value will be seen from pattrstorage.
      best
      klaus
    • May 06 2006 | 2:31 pm
      what's wrong with this one then?
      perhaps it's the update. I am using 4.5.5
      max v2;
      and the abstraction
    • May 06 2006 | 2:56 pm
      It's the update. Update to v. 4.5.7 and this patch will work fine.
      jb
    • May 23 2006 | 8:32 am
      Hi,
      got the update and now pattrstorage sees all the changes.
      Now I am trying to save and recall data from a xml file. I have managed to save the xml, but I am having problems recalling the xml and pattrstorage presets. THe content of the xml's files is correct (shows the data acurately), but I cannot make it appear in the patch. surely I am missing something...
      Please, check the patch below. It is a simplified version of the patch I am working on. I tried to simulate the functioning of the original patch, but I havent automated all the tasks, sorry...
      Open the main patch 'pattrfolders' first. The other two patches are abstractions.
      Any help would be really appreciated.
      thanks
      d
      max v2;
      max v2;
      max v2;
    • May 23 2006 | 8:36 am
      sorry, you may need the name of the abstractions. i forgot to include them:
      Main: pattrfolders
      first abstraction: abst
      second abstraction: abstraction
    • May 23 2006 | 11:57 am
      So here's what my max window shows when the write message is sent (I
      added some prints here)
      print: write Bellyache:/Users/jeremydb/Desktop/abst/ pah.xml soundbank.xml
    • May 23 2006 | 12:08 pm
      Sorry - message seems to have gotten cut off...
      So here's what my max window shows when the write message is sent (I
      added some prints here)
      print: write Bellyache:/Users/jeremydb/Desktop/abst/ pah.xml soundbank.xml
      So you're using [ sprintf %s %s soundbank.xml ] which is 100% _not_ what
      you want here. However, I'm not really clear what it is that you do
      want, since you seem to want to give the xml file 2 different names, or
      save it in some special place or something, but it's not clear from the
      comments or the patch.
      However, I'm guessing that you would probably like [ sprintf %s%s ]
      jb
    • May 23 2006 | 1:43 pm
      Jeremy,
      I dont know how you get that print message (?)
      If I print after the 'pack write xml' object , this is what I get:
      pack: write C:/Documents and Settings/DV Customer/Desktop/amen/ mine soundbank.xml
      and also an xml file in the amen folder called 'mine soundbank.xml'
      where 'mine' is the name given into the text box. 'soundbank' in sprintf is just to make it easier for me to identify the type of xml file , as there are a few being saved from different parts of the (original) patch. But it is not necessary, so I guess I could get rid of it if it was sttoping pattrstorage from working...
      However, I think the .xml in the after sprintf %s%s seems necessary to add the file extension at the end of the name, since the xml in the pack object is just providing the second inlet to the pack object , and never sems to be added to the name...
      d
    • May 23 2006 | 9:36 pm
      oh,I guess you entered 'pah.xml' in the name box...
      perhaps I should explain what I want to do in my patch in general.
      As you can see, you can create several drop boxes that are connected to the abstraction 'abst'. In my original patch, those abstractions include a buffer/js.folderiter/coll combination that plays back the files included in the folder that you dropped in the drop area. I would like to save and recall the xml file to be able to recall the folder path into the text box, and then bang it to reload the files into abst's buffer.
      It gets more complicated, as the patch we are working in is itself an abstraction (called 'abstraction'). The reason for this is that in my original patch you can script/create as many as these as you want from the top 'pattrfolder' patch. It is here that you name each of the 'abstraction' patches, and where you define the save path for all the xml files. By the way, I do need to save each xml file with two names: first, the name given to the 'abstraction'; second the type of data saved in the xml file. This is because for every 'abstraction', I am saving more than one xml file...
      hope this gives a bit of context
      dan
    • May 25 2006 | 9:07 am
      The read and write messages to pattrstorage take one optional symbol
      argument, which is the name of the .xml file, partially or fully qualified.
      So:
      write Bellyache:/test/afile.xml
      write "Bellyache:/a folder/afile.xml"
      write afile.xml
      are all valid. Note that symbols containing spaces _must_ be enclosed in
      double-quotes. The "symout" argument to the sprintf object will ensure
      that the output of that object is a single symbol (Max Reference Manual,
      p.550). Nevertheless, whitespace does count in file names and paths,
      and these:
      write Bellyache:/test/ afile.xml
      write Bellyache:/ a folder / a file.xml
      write "Bellyache:/a folder/ a file.xml"
      won't work either, assuming that the file is located at
      Bellyache:/test/afile.xml
      The patch I looked at was inserting spaces into the file name and file
      path due to its use of a [sprintf %s %s] or similar, rather than a
      [sprintf symout %s%s]. This was clear from the excerpt I posted previous
      from the Max window, as well as the one you posted.
      So, you need to pay some attention to this detail, at which point,
      pattrstorage will work just as it should.
      jb
      Am 23.05.2006 um 23:36 Uhr schrieb dan:
      > hope this gives a bit of context