Forums > MaxMSP

how to create hierarchical dictionary structures?

April 29, 2013 | 4:33 am

Hello,
Quick question:
I want to create a hierarchical dictionary but don’t know how. I’ve read the documentation and scoured the web but haven’t found anything applicable. If an explanation is out there, a link would be much appreciated.

Here’s probably the best way to illustrate my question: create a dict object, open the help file, click the hierarchy tab, and double-click dict bicycle.

It contains nested sub-dicts, which seems like a powerful and elegant way to manipulate hierarchical data.

What messages would I send an empty dict to create the contents of ‘dict bicycle’? Specifically creating sub-dicts

Does that make sense?

Any help greatly appreciated!

Thanks
Ben


April 29, 2013 | 5:02 am

I think I’m on the track with the dict.pack object


April 29, 2013 | 5:29 am

I tried to explain in more depth, but the forum doesn’t copy my formatting, so I included the code to a comment box explaining:

– Pasted Max Patch, click to expand. –

May 1, 2013 | 7:52 pm

I had some issues with this as well. Last week I was pulling out my hair looking for this solution. There is only documentation on how to parse the hierarchy. I found some patch that had an instance of formatting. Please check out the attached example I made.

I am still working though some of the nuances of formatting these. Today is trying to make an array of objects with the same keys.


May 1, 2013 | 9:02 pm

I deleted the last attached file and reposted it.


January 10, 2014 | 5:14 pm

For whoever may be interested – Just wondered about the same topic and somewhere within the dict reference I found the beauty of the ‘replace’ message. Copy-paste the following to see how easy it is to make nested dictionaries:

<code>

– Pasted Max Patch, click to expand. –

</code>


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