Hallo, cyrille henry hat gesagt: // cyrille henry wrote:
in the system I'm curently using (made around a custom pbank object) list are interpolated element by element (if the 2 interpolated list are the same size). the possibility to have symbol instead of float is the solution not to interpol every value. exemple of what is currently running on my computer :
preset_default : 1 2 3 4 5 6 7 8 9 110 preset_1 : 4 5 6 7 8 9 1 2 3 foo preset_2 : 1 3 5 7 9 1 3 5 7 foo preset_3 : 2 2 2 2 2 2 2 2 2 foo preset_4 : 0 9 0 9 0 9 0 9 0 foo
default preset is load on startup. then I just have interpolation beetween preset 1, 2, 3 and 4 :
out = preset_1 * C1 + preset_2 * C2 ...
Action speaks louder than words: I tried to mimick this with Memento in attached patches, which require Memento of course + zexy. (tester.pd is the main patch). I omitted the final summing into "out", though, but that's trivial. I also left out the "symbol in list" part, which cannot be used with [pack] and [unpack], but should work in Memento itself, if you don't care about editing the lists using Pd. (Just use [drip]---[route float] in interpolator.pd then.)
Generally it works, but it also showed some problems with the way, current Memento is saving substates and declaring variable names. Basically it boils down to this: It is not easily possible to have an unknown number of variables inside a state - besides the main "preset" or "substate" variable, which can be infinite.
What I mean is this: You can in theory have an infinite amount of "presets", but you cannot have variables in it, whose names are not known in advance. So this is impossible:
/synth/preset 0 /synth/setting1 1 3298 44 /synth/setting2 3 8 429 /synth/setting3 1929 1 46569 ...
unless you know, how many settingX variables you will need. The set of "keys" in the stored "key:value" pairs needs to be known. in advance.
OTOH this is possible:
/synth/preset 0 /synth/setting 1 3298 44 /synth/preset 1 /synth/setting 3 8 429 /synth/preset 2 /synth/setting 1929 1 46569 /synth/preset ...
It maybe would be nice to be able to create settings using the first way, but currently that's not the way, Memento is designed, you have to take the second approach.
However I'm not really sure yet, if this application actually should be part of a state saving system. I would probably use some other object, abstraction or custom external, to create this kind of interpolation, and only use Memento to store the coordinates of the preset, you want to interpolate.
Ciao