Forums > MaxMSP

Json parser?

August 27, 2013 | 8:46 pm

I am receiving over udp an osc message with a json string:

{
"uniqueID": string,
"number": string
"name": string
"listName": string
"type": string
"colorName": string
"flagged": number
"armed": number
"cues": [ { }, { }, { } ]
}

Is there an abstraction or anything that will parse this? The keys will be static if that helps.

Thanks
GW


August 28, 2013 | 5:10 am

You might have some chances with dict.deserialize.


August 28, 2013 | 8:12 am

This just came up here:

http://cycling74.com/forums/topic/streaming-json-data-into-max/


August 28, 2013 | 8:45 am

This is almost ok:

– Pasted Max Patch, click to expand. –

August 28, 2013 | 1:41 pm

dict.deserialize followed by dict.itter did the job!

Thanks
GW


April 15, 2014 | 9:54 pm

How so? I have a similar JSON string and can’t figure out how to parse it with dict.deserialize and dict.itter. Maybe I am just too tired to figure it out. Please post a patch if you don’t mind.



Jan
April 16, 2014 | 3:44 am

another option would be to do the parsing in JavaScript directly using JSON.parse(your-json-string)


Viewing 7 posts - 1 through 7 (of 7 total)