Forums > MaxMSP

What do you use dictionaries for ?

October 6, 2013 | 6:04 am

Hello,

Theoretically dictionaries seem to be a nice addition to Max, but I really do not see any obvious use in my own patches.

So I’d be curious to know how Max users are using them in their projects.

Thank you in advance.


October 6, 2013 | 6:14 am

I use them when I think I am starting to understand max.

- takes me down a notch. It’s nice. :-/


October 6, 2013 | 2:00 pm

The project that I used as an excuse to get my head around dictionaries was an editor/librarian for a synth with a very complex voice architecture and midi spec.

Parsing sysex dumps into a dict for storage, editing, formatting into osc for transmission over udp, etc was a huge improvement over using, say, colls for the same tasks, and in general I’ve tended to stick with dicts whenever I’ve had to parse and manage large amounts of raw midi data in human-readable and easily maintained patches.

The ability to reference the same dict throughout a multi-level patch and pull values out of it with chained pairs of dict.iter and route objects is also very conducive to clean, comprehensible abstractions, which is always a plus imo. Further to that, I am only just getting into javascript in Max after having studiously ignored it for about a decade and I’m given to understand that I will find dicts very well integrated with js.

Just one example; I’m sure there are tons more.


October 8, 2013 | 1:31 am

"The ability to reference the same dict throughout a multi-level patch[...]"
That part is possible with coll too.
Please correct me if I’m wrong:
Dicts use hashing and therefore have a way better lookup time than colls. So, if you have large amounts of data and need to look it up fast, you should stick to dicts instead of colls.

True?


October 8, 2013 | 3:02 am

Dicts use hashing and therefore have a way better lookup time than colls.

not sure it’s faster, it might well be true… though, it’s undoubtedly more practical than coll in those cases

query time is a good question though


October 8, 2013 | 11:50 am

I tried to use dict about a year ago to manage a database of audio clips with associated tags. After struggling with it a bit I moved on to SQLite.


October 8, 2013 | 12:14 pm

I started using Dictionaries a couple months ago after realizing Coll doesn’t save in a live set.
It may take a little more work than Coll, but remember you can transfer between the 2 really easily with the push/Pull_to/from_Coll, so you could still use a Coll like you normally have but keep the dict in there to save the data and then pull it when you reload the patch. Personally I’d rather just get used to knowing dict better and leave coll behind except for simpler smaller tasks that doesn’t require saving.

Where I’m really going to get some use out of it is a larger patch I’m revising for a controller, so instead of having to constantly poll the liveApi for everything, it can reference the dict instead, since it will gather all the info I need on initialization, and then it will just add/subtract any new info. This should increase the speed and cut down on a lot of processing.


October 8, 2013 | 12:22 pm

I tried to use dict about a year ago to manage a database of audio clips with associated tags. After struggling with it a bit I moved on to SQLite.

welp. that’s disheartening.



Myr
October 8, 2013 | 8:53 pm

I’ve been using dictionaries for a Max for Live device that stores information gathered from the Live API, making it accessible to other devices. It stores the data in a structure very similar to the live object model, lots of sub-dictionaries. Hoping to experiment with sending the data over udp to a visual artist on a different computer too.

It’s not finished yet but most of the basic functionality is there. I’ve attached a copy if anyone wants to have a look.

Drop it on a track, open the max for live print window, turn on the "Print" toggle button on the device then click the "Init" button.

You should see all the information the device stores printed to the max window in dictionary format i.e "::" to signify sub-dictionaries.

At the bottom of the device there’s a text edit object where you can type in commands to send to the live api. For example typing "live_set tracks 0 set mute 1" and hitting enter will mute track 1.


October 9, 2013 | 8:44 am

Thank you guys for these interesting insights !

The better lookup time compared to coll is an interesting asset. So that’s another buch of objects to learn using…


October 9, 2013 | 3:36 pm

…and is anyone aware of any dict tutorials or other learning resources around, other than c74 documentation?


October 9, 2013 | 3:47 pm

yeah, I was kind of hoping for that, too.

These are the closest I’ve come, and they’re not exactly… the ones that help you learn how to use dict, hehe.


October 9, 2013 | 4:22 pm

seems like a good introduction/start; would be nice to know about other dict objects/functionality too


October 9, 2013 | 7:29 pm

"The ability to reference the same dict throughout a multi-level patch[...]"
That part is possible with coll too.

Of course; didn’t say that it wasn’t!


October 9, 2013 | 11:51 pm

seems like a good introduction/start;

I wouldn’t say so, I think it’s an odd angle to approach from. Don’t get me wrong, I think it’s fun, but I didn’t learn how to use the system.


October 10, 2013 | 12:27 am

^i agree with Wetterberg.
also, from the video, Sam spoke, "sure as shit forget about Pure Data"
what a dict-thing-to-say! ;p
(thanks to PD we’ve got PDlib which allows for awesome things on iOS and Android, and the only thing similar with Max is the pathetic ‘Mira’ which is not at all like bringing the best functions of max to iOS… but more like a rich-yuppie’s remote-control for the laptop which they’re too high-maintenance to place in their lap :p)


October 10, 2013 | 12:44 am

^i disagree with the asswipe. Mira is great to avoid repetitive stress syndrome, or avoid being intimately involved with your computer. I use it everyday, because it allows me to hold a glass of champagne in one hand, keep a boar’s head in my lap to feast off of, and control my max patches with the other hand by mundanely tapping on a pane of glass like it’s actually expressive :D

(also, the tutorial may not be a great ‘introduction’ but it sure as shit gets to more interesting usage quicker than an introduction might. still… on the other hand, anytime i hear someone say that a max patch looks ‘sexy’, i hear something like a jedi-mind-trick in my head: "this isn’t the dork you’re looking for"…. haha, that Sam, got alot of… strangely directed passion :D)


October 10, 2013 | 4:58 pm

also, the tutorial may not be a great ‘introduction’ but it sure as shit gets to more interesting usage quicker than an introduction might.

Of course; but if you’re still unable to use dict after watching the tutorial, then it’s merely a demonstration, or paint-by-numbers.

This isn’t characteristic of Sams videos, and it doesn’t make it a bad video at all; It’s just not really useful to me as a tutorial, hehe.


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