v object to save data of patches when max closes
Is it possible that the v object will remember that last value entered when max patch is closed? so if I entered a value to the v object then for some reason I close the patch and reopen it - at the other patch that is receiving the v object a bang will still output the last entered value?
only if new value is entered to the v object it will overdrive the last one.
Is that make sense?
You could easily try it yourself and realize that no, values stored in [v] aren't saved with the patcher.
[pattr] does this, though, as well as [dict] and [coll] with @embed enabled. But you still need to save the patcher to get the current data stored within the patch.
If you don't want to save the patch but still retain the current data when you close the patch, then you need to save your data outside of the patch, like in a separate text file, typically a json that you would access through [dict], or a [pattrstorage] that regularly automatically save the current state in a preset and write this to disk, although countless other approaches are possible.
You could easily try it yourself and realize that no, values stored in [v] aren't saved with the patcher.
yes I try that, therefore asked for a different way :)
So I think best way is to save it to a text file at a location on my PC then to recall it when patch is opened again?
trouble with v (value) object is that
1- it can't get cleared
2- for your wish - it can't store anything into a patcher.
3- closebang is not 100% reliable method to store something
when patcher closes.
I would suggest to use pattr with autorestore and dirty flags set
instead
I would suggest to use pattr with autorestore and dirty flags set
instead
and how can I recall the message after patch is closed? I don't get it

autorestore flag makes it output stored value on patcher load.
dirty flag makes it ask if you want to store the patch if value changed.
What exactly are you trying to do ?
only store single item ?
you talk about patch, not compiled standalone, or ?
What exactly are you trying to do ?
I have a main patch that opens 6 different patches one after another, with a 2-minute interval between each one.
Via UDP, I receive a folder path where I need to save data from each patch.
At the beginning, the main patch receives this path through UDP and stores it inside a v object.
Then, every time one of the patches is opened, a bang is sent to the v object inside that patch in order to retrieve the folder path and save the data generated by that patch.
This works great 99% of the time. However, the other day the main patch was accidentally closed and reopened, and after reopening, the folder path was no longer stored in the v object.
I'm trying to find a way to handle this situation.
you talk about patch, not compiled standalone, or ?
patches. One main and another 6 different ones
you can grab values from pattr,
or if you prefer send path from pattr to value object.
you can grab values from pattr,
how can I do so?
what message I should send to pattr in order to grab value?
or if you prefer send path from pattr to value object.
is this better?
you can use [pattr] in conjunction with [pattrmarker]
No matter what you use at the end,
you have to prevent unintended closing of main patch
which would break the running tests order.
While this can be done by setting noclose
flag to thispatcher, or at least setting dirty flag
it is still not enough to maintain it remotely.
One could report current state via UDP
and so take actions in case something went wrong, like if max crashed.
restoring last set folder path is easy to fix
While this can be done by setting noclose
this sound as something I should add. so if a specific message is arrived the main patch will get the setting "noclose" ? It needs to be option to bypass or to be enabled only on certain condition right?
restoring last set folder path is easy to fix
how?
what LSKA offered seems to be one option of it right?
To retreive a path is really simple problem to solve.
even your first thought to save it as text is quite ok.
All depends on the flow and what you see as possible probems that could arrise.
Like if someone closes main patch while tests are running.
One can't offer good advice without knowing details.
like if main patch got closed, but loaded test3 patch is still running.
what should hapen when you reopen main patch ?
does it know where it left and what is running ?
who is controlling everything ?
remote computer or the one were main patch is. and so on.
thispatcher window flag noclose disables window close
by shortcut or click on window close button.
if you also set dirty flag, you will be asked if you want to store the patcher
also if you triggered quit message by mistake.
again can be done by thispatcher message or by pattr itself if you decide to use it.
pattrmaker or connecting pattrout into v object, does not matter really.
or reading set text fie from 6 test patchers.

I will try what you suggest in the screenshot.
like if main patch got closed, but loaded test3 patch is still running.
what should hapen when you reopen main patch ?
does it know where it left and what is running ?
who is controlling everything ?
all the control made via python and send to max via UDP
the only thing matter for me is that the path of the folder will return when main patch is reopen because this what sends the path for each of the 6 patches.
so in any case if main path is closed no patch can be loaded.
how can I make some logic condition that if [v] object is return empty when bang - a backup path will outputted instead?
bang v object and if nothing comes out trigger something else after short delay.
