< Back to IRCAM Forum

Spat5 - saving and recalling settings

Hi all,

I have finally decided to stop putting off updating old patches of mine using SPAT to work with SPAT5. In terms of the real-time control, everything is perfectly clear, but I have been having major headaches saving and recalling parameters which will be applied to spat5.oper on loading the patch.

One quick caveat: I would like all the settings to be stored in an external file, rather than in the patch itself, so that changes made in one situation are not automatically applied subsequently, but rather, so that the basic setup loads on startup and can be tweaked according to the setup being used that day.

I have gotten as far as having spat5.osc.var save and recall a file (“spat-presets.txt”), but when it loads, spat5.oper complains with error messages for almost all of the stored parameters (e.g., "spat5.oper: error occurred when processing “/room/1/reverb “delays” 75.5 79.08 82.96 92.87 115.23 134.23 159.79 197.91 245.6 322.29 400.31 477.28”)

Here is what I have so far:

----------begin_max5_patcher---------- 1591.3oc6Ys0aaaCE9YmeEDBXu4XPRQRQMrGZK5PeYEX.EXCCAEAz1LIpSVRPhJwYEs+1GuH4qxJRwRYY.0.QghhTmy224BOj5qWLwad5ZYgG3mAWAlL4qWLYhsKSGSpteh2Jw5EwhB6v7VjtZkLQ4M08Lkbsx1+ub4kp6hJ.4xExn6kE.0cRPlXg5NvMQwxLgoQd5JfLtP9vcxbY8qHZo8EjN+KWhq6KobUTRrTYkIZamokp5dgU8peyKtKJ41q0RV4PhO2eFbJ.g8mQmBvAPycX8UvmMy4aWbg4xzNh3D4CZc6H.q.yAyq60oWpGyjNMvatH4VuoU+G74igJh2CrhOMVwLK5BgyX5eTZn6GObJvGawMdXwcVtLSlrDDmJVdR32LjgrdfYTKXNvYe4Di8MHbLfYQVdTh5FPwiFkB7SEEZE4RM3Kz52L0ZUGv9Mo52fXgbW2083Cp2NirH5eriDYLaCIMQsgAHNcKOsiXSDqrh06s4QhXugiAWJiEOBnPHr8njlcU7azUA2aNvEdTcMXL7TLABtv89iRx35.3fsKOfq8Km4+dQboYE.sVIyuzj+uuYKvCa1BMzMgAP9XlUTtNKMW0WjhFFj56bvYHxLzgKFvGkrjmqQNjLnHmRoGi7Qxh29BDoEKN+EH3rQM8P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e.5WsSp4tD3uInn43Xc8kj.Ko3yI9HKQQNHV7YFB2YCxyJvuJ9944vN3VPw5ft3r9CC1vjP9Kym+CZt+wEguPgE+cQbjtfm+zTMTa1ocXB62gauKCjt3Not2EWJaOGqXwBs.1y13iLNAFKBaS0NgU9EihBheEqfeHWJS5MEBMpD027yzBw35pEGKkC+5T49n3V8zE8l63DHi4JmlA0JmoU.KDERGOcD+JVG+KYbb5COckR6TG.dFjFBg7MY8ZBBXJxFCEvQbaFe8bnjwC.3+OBfxUyk4ePW7auciM4if1U3ngXD0poncWgaPTP2JNOsBtmpEBCPPqBE5SXvP6dCH3.DcuEeegPk6fHreiICrJxpp329ont3aW7u.4BsOc.
-----------end_max5_patcher-----------

I’ve searched a lot online for a solution but nothing has turned up. Therefore, any tips would be greatly appreciated!

Hi @paulclift,

nice move, I did the same not so long ago and I’m pretty happy because of spat5 rocks. I load your patch and has no error. I couldn’t find the way to produce an error. Could you comment it with some steps to reproduce. Meanwhile, I see that you refer to spat_preset.xml and also to spat_preset.osc which might be a cause for error…

Hope this helps…

Hi,

I think that with the provided patch, in order to reproduce the error, you need to load a preset file, in case a path is not specified…

Can you try this patch cords tweaking ?

spat5_preset_export.maxpat (15.0 KB)

N.

Thanks very much for your help! I’m afraid that the problem hasn’t gone away… see the attached screenshot.

Could the problem be the absence of commas in the spat-presets.txt? I tried using other file formats, but got the same result… I decided to use the .txt format as it is the simplest to edit outside of Max.

As you can see, the file is loading, but spat5.oper is complaining about the output from spat5.osc.var …

no errors printed on my side…

Anyway, oper may complain but the parameters are taken into account on it’s interface.

Do you confirm that ?

What about this one ?

spat5_preset_export.maxpat (14.7 KB)

Hmm, I still get the error messages and spat5.oper does NOT update the settings. Interestingly, it is not all of the data in my spat-presets.txt that makes .oper complain. Of the 36 lines of settings in my presets file, I get 19 errors. The parameters that don’t generate errors ARE updated in spat5.oper, meaning that the file is being read just fine, and the problem is somewhere in the application of the content of the text.

I don’t understand how this can be the case, since I am just saving the values that spat5.oper itself output and saved; I have not messed with anything in the text file. I am attaching the file here, perhaps you could see if you have the same problem. [CHECK THAT: I am a new user and can’t attach a file; I will include the contents of my settings file here, inline.]

File “/Volumes/Macintosh HD/Users/paulclift/Desktop/WORK-IN-PROGRESS/___FINISHED/_max/spat-presets.txt”

Exported by paulclift (paulclift@Paul-Clift)

Wed - 12/02/2020 - 15h59m05s

/source/number 1
/source/1/direct/params -40.007 0 0 0 177 5657
/source/1/room/params 0 -8 -3.14504 -16 177 5657
/source/1/early/params -28.8192 -10 0 -10 250 8000
/source/1/cluster/params -25.817 0 0 0 250 8000
/source/1/mute 1
/source/1/direct/mute 1
/source/1/early/mute 0
/source/1/cluster/mute 0
/source/1/reverb/mute 0
/source/1/early/delays 13.6 17.66 19.16 21.59 24.99 27.07 29.32 32.05 34.84 38.51 41.63 44.3
/source/1/early/width 0
/source/1/early/gains -14.0452 0 0 0 0 0 0 0 0 0 0 0
/source/1/cluster/delays 12.7 26.55 30.62 36.8 44.91 49.64 54.63 60.49 66.33 73.81 79.99 85.2
/source/1/spread 100
/source/1/panrev 0
/source/1/reverb/gain -6.25307
/source/1/doppler 0
/source/1/doppler/delay 0
/source/1/air 0
/source/1/air/freq 10000
/source/1/aed -0.00869891 16.158 1
/source/1/room/destination 1
/room/number 1
/room/1/tr0 10
/room/1/trl 1
/room/1/trm 1
/room/1/trh 0.501187
/room/1/fl 250
/room/1/fh 8000
/room/1/reverb/delays 75.5 79.08 82.96 92.87 115.23 134.23 159.79 197.91 245.6 322.29 400.31 477.28
/room/1/mute 0
/room/1/infinite 0
/room/1/air 0
/room/1/air/freq 10000
/internals 8

I wasn’t yelling; I don’t know what happened with the formatting of this post :slight_smile:

:-))

Yes the trouble is that your file contains “low-level” messages and spat5.oper expects “high-level” messages only. Cf. Filter messages in spat

You can send a message /status/openorclose to the spat oper object to compare with yours.

here try the file I obtained spat-presets.txt (4.1 KB)

Or get rid of your preset file and try to render a new one with the last patch I posted…

Do you use the latest version of spat5 ?

to be continued… we, no doubt, learn from these errors… at least how to use the posts in this forum :wink:

Brilliant! It’s all good now. Thanks a million for your help.

NB : you don’t even need to use spat5.osc.var. You could just send the /preset/load and /preset/export messages to spat5.oper (or other objects you which to store/recall)
Have a look at the [spat5.presets.management] patcher.