On 09/02/2026 23:14, Dan Wilcox wrote:
[dict] proposal?
I've often thought it would be interesting to have JSON-like data that
flows through Pd's graphs, rather than being "at rest" like the [text]
object. For example, let's say you had a message box containing:
{"hello": 42}
You send it into [json-get-in "hello"] and out comes 42. The right inlet
takes the "coordinates" to look up within the datastructure.
A more complicated example is {"things": [1, 2, 3]}.
You send it into [json-get-in "things" 1] and out comes "2".
To compose these things you can also have json-update which you can use
like this:
[json-update "things" 1]
The right inlet takes the value to replace and the left inlet takes the
datastructure. So if you send that same example in again and on the
right inlet you send in 67 then the output is: {"things": [1, 67, 3]}.
Of course it's JSON so these documents would not have a specific shape
and you could just as easily insert {"foo": "bar"} and you'd end up with
{"things: [1, {"foo": "bar"}, 3]}.
You could also have a "map" type of operation similar to Frank
Barknecht's list updating utilies where you send the old value out of
the right inlet and take the updated value into a rightmost inlet, and
the old value is replaced at those coordinates within the datastructure.
With these operations the JSON is not something that sits at rest in a
[text] like object but rather it is data that is flowing through the
graph just like audio does.
I guess it's similar to the 'list' family of objects, but for nested
datastructures rather than just flat lists of atoms.
To me this has always felt like something that would be useful in Pd.
Cheers,
Chris.
--
https://mccormick.cx/
---
[email protected] - the Pure Data mailinglist
https://lists.iem.at/hyperkitty/list/[email protected]/message/BFN2RQGDDXGNNAPQGP7QH76G32PM47OK/
To unsubscribe send an email to [email protected] mailing list
UNSUBSCRIBE and account-management -> https://lists.iem.at/