allow saving parameters for users using runtime / standalone


    Nov 07 2006 | 1:18 am
    hello... just having a problem getting my head around some things... In my patch, I'm trying to facilitate for users to be able to save effect parameters, and other aspects of the patch, such as what effects are open. I've read the documentation on data structures in max, although in practice I can't get an object to save its contents without saving (in max) and maintain its values if you reopen the patch. The preset tool is almost ideal, only I can't get it to save its values. Does anyone know how to solve this one? thank you very much tom

    • Nov 07 2006 | 6:09 am
      use [pattrstorage] instead of [preset]. an XML sheet is written of whatever bound to [pattr] or [autopattr] and stored in [pattrstorage]. this works with Max , haven't tried in MaxRunTime though, might need a little work around if you intend to use MaxRunTime. Anyway it will give you an idea of how you might want to proceed. the same principle should also work with [coll] or [preset].
      each time you store something you just need to set the index value of whatever you store, in a message box, this number in the message box will not move when patch is closed , therefore it makes it easy to use this number when patch is reopened, for instance to recall the last stored index. hope it helps , there is certainly another way (smarter) to do this ;)
    • Nov 07 2006 | 7:56 pm
      that's amazing help, thank you so much. That's been a really big help! many thanks tom
    • Nov 07 2006 | 10:27 pm
      does it work with standalones , i havent had the time to try it myself ?
      Quote: Tom Haig wrote on Tue, 07 November 2006 11:56 ---------------------------------------------------- > that's amazing help, thank you so much. That's been a really big help! > many thanks > tom ----------------------------------------------------
    • Nov 08 2006 | 12:15 am
      it works both in runtime and as a standalone... one minor thing though, is there a way to make it automatically save to a designated file name, because in both runtime and a standalone it asks what name and where you want to save the contants of the pattrstorage??? thanks again. tom
    • Nov 08 2006 | 12:34 am
      you'll have to define a default folder for your xml file. usually if you keep your patch and your xml file in the same folder it should not be a prob for max to locate the xml file. you can write a file for [pattrstorage]'s stored values by using write message. use a [sprintf filename%ld] , %ld being the number of the file, this number incrementing ( for example) each time the patch is reopened so that files do not overwrite each other. or just overwrite the file each time and forget about the number, just give the file a name , might be easier. use read (filename) message to reload the file when reopening the patch.
      if you havent done spend some time on the [pattr] family, it s really worth it.
      tc k
    • Nov 08 2006 | 2:00 am
      hey, just tried playing around with the read / write functions. However the recall $1 and store $1 don't seem to be the same thing. I don't really need to increment target as it saves. I'm only really trying to make a the patch so a user can store one preset of an effect. It seems that the write successfully writes it to the script contained within pattrstorage, however sending the read message doesn't seem to change the parametrs... any ideas on how to get this working? thanks tom
    • Nov 08 2006 | 5:08 am
      read is not supposed to change any parameters but load any XML file that has been writen. recall n displays something sotred at n.
      i am not sure i am following you, maybe you could send a patch along ;)
      Quote: Tom Haig wrote on Tue, 07 November 2006 18:00 ---------------------------------------------------- > hey, just tried playing around with the read / write functions. However the recall $1 and store $1 don't seem to be the same thing. I don't really need to increment target as it saves. I'm only really trying to make a the patch so a user can store one preset of an effect. It seems that the write successfully writes it to the script contained within pattrstorage, however sending the read message doesn't seem to change the parametrs... any ideas on how to get this working? > thanks > tom ----------------------------------------------------
    • Nov 08 2006 | 5:10 am
      recall n displays something stored at n.
      i am not sure i am following you, maybe you could send a patch along ;)
      Quote: Tom Haig wrote on Tue, 07 November 2006 18:00 ---------------------------------------------------- > hey, just tried playing around with the read / write functions. However the recall $1 and store $1 don't seem to be the same thing. I don't really need to increment target as it saves. I'm only really trying to make a the patch so a user can store one preset of an effect. It seems that the write successfully writes it to the script contained within pattrstorage, however sending the read message doesn't seem to change the parametrs... any ideas on how to get this working? > thanks > tom ----------------------------------------------------