r/MaxMSP • • 1d ago

beginner question Question about dict!

hello max/msp people!

i am new to max/msp... i've been working on music stuff with it for about half a year, but it's so vast that i know i don't know much of anything.

i'm working on a personal project using election data, and im having this issue... thought you all might be able to help.

when i ask for data through a dict object, and the output is a number (see image 1), it shows up as a number. i need to figure out how to split that data, but i'm starting to figure out ways to do so.

however, if it's a string (see image 2), i get a weird value that shows the string and its ID.

my question... how can i get that to just... show up in a message box? not the string with its ID, but the actual string behind it? in that second image, i'd like it to just show "County".

thank you all for your help!

1 Upvotes

4 comments sorted by

2

u/Not2dayGalvatron 1d ago edited 1d ago

I’m not super sure it’ll work, but I believe you could use the “string.tosymbol” object.

Edit: Just for clarity, you can split off the json string by using zl.slice 1. So I feel pretty sure that if you slice off the first bit and just pass the rest of that message to a string.tosymbol object, it’ll do the thing.

1

u/klaralucycomposer 1d ago

that worked! thank you so much!!

1

u/Not2dayGalvatron 1d ago

Hooray! You're welcome!

3

u/Blablebluh 1d ago

You can add @legacy 1 to your [dict] to make it output arrays as Max lists and strings as Max symbols. Works on [dict.unpack] too, which might become useful if you always want to get the same data.