How to save a modified spread when reloading a patch

Dear nighthawks,

I just got stuck with something probably very simple but I can’t wrap my head around it.
I would like to keep all modifications of a spread which I do during runtime after reloading a patch.
This is what I patched:


It works fine during runtime.
But this is how it looks after reloading the patch:

What am I doing wrong?
Thanks!

1 Like

checkout the serializing / deserializing tutorial

@schlonzo where is that?

ok seems to be called “read and write objects”
and also some info in the grey book under “serialization”

Thank you @schlonzo ,
I’m just wondering if there is no simpler way. My spread is actually already being correctly saved with the patch. The problem is, after I reopen the patch I have to disconnect the input of the spread and reconnect it again in order to make the patch work as expected. Do you have any idea what causes this under the hood?

“preset” looks like a pad. idk where this is coming from, e.g. where you write into this pad. Find the place where you put the initial data into your graph. Save this to disk and load it from disk on startup.

Also, keep in mind that a pad introduces a frame delay! You can open the patch stopped(F8) and then step frame by frame through your program (F6). My guess is the problem has to do with your pads and framedelays.

Good point, yes, “Preset” is a pad. It exists only twice in the patch (both are visible in the screenshot).
Can I somehow force a different execution order? Maybe I could achieve my goal just by that? About execution order I only found Execution Order | vvvv gamma documentation
It says top down. But is it also left to right?

Hi @schlonzo, by saving and loading to/from disk I can at least keep the values now, thanks for the hint.

However I have no clue how I could edit the slices of the spread in a convenient way.
Each of my slices is one preset, which contains 25 values.
I would like to simply modify let’s say two values of one slice while preserving the other values.
If I do a GetSlice, I don’t know how to put the values somwhere where I can modify them in order to do a SetSlice afterwards.
Are there any good examples how to handle such things?

Do you come from beta, or why do you prefer working with large spreads? ^^ I suggest viewing a tutorial about custom datatypes. You could create a datatype “settings”, which holds your 25 values, and manage all your “settings” in one collection. This will make it more readable, more easily extendable and is one of the main advantages of working with gamma.

3 Likes

Oh, Ok, thanks @schlonzo , I will look into that. I also just found VL.Elementa, which works great for modifying my spread based settings. But probably I am doing it in a much too complicated way with the spreads.

Have a look at the Persistent node, there you set a filename and it will save/load data next to your patch. you put it directly after the first pad.

2 Likes

Sounds great! But how to deal with the save data pin? If I leave it unconnected the data is not stored into the xml - and when I use a Changed node on the data in the spread the xml is also saved when the patch is restarted / opened, which results in an empty XML.

This isn’t automatic because the node has no idea when the right moment for saving is and it should not overwrite data that might be precious for the user.

So this is highly dependent on the application and the logic has to be patched by the user. Most simple is to bang it with the mouse when happy. Or when something in the patch happens that adds new information to the data that should be stored.

In this case one can do something like that:
image

Persistent.7z (7.8 KB)

OT / Something I am constantly wondering about: If one already goes through the trouble of building a demo patch why only attach screenshots? I think the bar for providing an answer would be much lower if people didn’t have to start from scratch every time.

5 Likes