Shared presets for bpatcher instances using pattrstorage

jeffburger's icon

I've read lots of related posts, but haven't found a solution. The problem at hand is sharing pattrstorage presets across instances of a bpatcher.

I have a bpatcher with a video effect. I'm using bpatcher arguments (1, 2, 3, etc.) to distinguish between multiple instances of this bpatcher. These arguments also distinguish the pattrified controls inside each instance using the #1 construct. I also have presets via pattrstorage inside the bpatcher. I want all instances of a video effect to draw from the same set of presets. But each instance will only read and write its own presets to disk. That's because the instance number is stored with the objects in the json file. For example, here are a few lines from the json file saved by bpatcher instance #1 (every place you see the number 1 is representative of the instance):

{...
"1rota_fx_preset" : [ 0 ],
    "rotaparams[1]::1rota_anchor_link_fixed[0]" : [ 0.0 ],
    "rotaparams[1]::1rota_anchor_link_fixed[2]" : [ 0.0 ],
    ... etc...
...}

Any love is greatly appreciated!

Jeff

Glennzone's icon

Hello Jeffburger. Did you ever find a solution to this ? I'm doing something similar.

Sym's icon

+1 I'm looking for a soltion to this problem too

woyteg's icon

" I’m using bpatcher arguments (1, 2, 3, etc.) to distinguish between multiple instances"
Why do you do that?

Why don't you use a json file written down to disk on each save and loaded by all instances automatically?
Do the parameters have different scripting names depending on instance/argument number?
cheers?