Hi,
I was wondering if anybody has implemented a key-value store in Pd which can be serialized to a list? I'd like to be able to send messages like:
set foo value1 value2 value3 get foo (returns value1 value2 value3) del foo set bar valueX valueY set baz valueZ
And then a way to dump and read entire key-value tables from the list with e.g. [dump( and [restore ...( where ... is the serialized form of the key values.
I guess I can build this with [text] but I wanted to check if anybody has done it already.
Cheers,
Chris.
On Sun, 2024-11-03 at 20:13 +0000, Chris McCormick wrote:
I guess I can build this with [text] but I wanted to check if anybody has done it already.
That's certainly how I would do it and I've done it many times, but just noticed I don't have it in single self-contained abstraction, but setters and getters built into other stuff.
Roman
Hi Roman,
On 04/11/2024 09:47, reduzent@gmail.com wrote:
On Sun, 2024-11-03 at 20:13 +0000, Chris McCormick wrote:
I guess I can build this with [text] but I wanted to check if anybody has done it already.
That's certainly how I would do it and I've done it many times, but just noticed I don't have it in single self-contained abstraction, but setters and getters built into other stuff.
Ok cool, had a quick look through your GitHub and I see some netpd patches that might have something I can base it off (netpd_text.pd?). Thanks!
Chris
On Mon, 2024-11-04 at 10:09 +0000, Chris McCormick wrote:
Ok cool, had a quick look through your GitHub and I see some netpd patches that might have something I can base it off (netpd_text.pd?). Thanks!
No, not [netpd_text]. This one is a netpd-ized version of [text] which is meant to be manipulated like [text], but instances are synchronized between peers.
I was thinking more about the instrument list in unpatch, or the fx list in mx.
Roman
Something i made a while ago: https://forum.pdpatchrepo.info/topic/11171/store-a-multidimensional-array-wi...
Am 03.11.24 um 21:13 schrieb Chris McCormick:
Hi,
I was wondering if anybody has implemented a key-value store in Pd which can be serialized to a list? I'd like to be able to send messages like:
set foo value1 value2 value3 get foo (returns value1 value2 value3) del foo set bar valueX valueY set baz valueZ
And then a way to dump and read entire key-value tables from the list with e.g. [dump( and [restore ...( where ... is the serialized form of the key values.
I guess I can build this with [text] but I wanted to check if anybody has done it already.
Cheers,
Chris.
On Mon, 2024-11-04 at 11:06 +0100, Ingo Stock wrote:
Something i made a while ago: https://forum.pdpatchrepo.info/topic/11171/store-a-multidimensional-array-wi...
Nice!
Roman
On 11/3/24 21:13, Chris McCormick wrote:
I guess I can build this with [text] but I wanted to check if anybody has done it already.
georg holzmann's PdContainer library (from 2004!), which maps C++ std containers to Pd objects, has a [h_map] object that can do this.
iirc, there's no direct [dump( message, though you can easily build one. otoh, it has built-in serialization to/from disk (either as a proprietary text-file or XML).
mgfdasfrt IOhannes
I think pdlua is ideal for this since it's simple, has similar datatypes, and maps are somewhat optimized as the primary (only?) non-primitive datatype https://github.com/sebshader/shadylib/blob/master/lmap.pd_lua
-Seb
On Monday, November 4, 2024 at 01:45:02 AM CST, Chris McCormick chris@mccormick.cx wrote
Hi,
I was wondering if anybody has implemented a key-value store in Pd which can be serialized to a list? I'd like to be able to send messages like:
set foo value1 value2 value3 get foo (returns value1 value2 value3) del foo set bar valueX valueY set baz valueZ
And then a way to dump and read entire key-value tables from the list with e.g. [dump( and [restore ...( where ... is the serialized form of the key values.
I guess I can build this with [text] but I wanted to check if anybody has done it already.
Cheers,
Chris.