Tips for working with Dict/Coll in Max for Live
Hello friends,
I'm having some problems with Dict and Coll in a M4L device. I'm using Dict to store some numbers, and this is being sent to Coll via the 'push_to_coll' method. I've used '---naming' for the Dict and Coll objects, and the Dict parameter mode *and* save is enabled.
So the aim is to send these numbers from Dict when the set is loaded to the Coll object. This works (I checked by opening the device) the data is there in both Coll and Dict. But the Coll object will not output anything, There's around 60 numbers, all with integer indexes that work fine when a new set of numbers have been generated AFTER the device has been loaded. But NOT from loading the set.
I wondered if this is something basic I'm overlooking? Max 6.1.9 / Live 9.1.4
Some guesses:
Does the coll have the embedded checkbox off and the "don't look for file" flag set? Maybe its state is restored after dict's.
What's causing the dict to push to the coll? If it's an M4L object, you might try reordering the load order; it might be sending the push before the dict is loaded. (Is dict stored as blob? Haven't looked at that in a while)
Coll isn't being stored, it's just being used as a way of ferrying data to and from Dict which does store the data. I'm using [live.thisdevice] to 'push_to_coll' when the device is loaded, everything looks like it's working but nothing comes out of the coll.
I'll post a patch later
OK, so this outlines the problem. Attached is a Max instrument device.
1. Load the device in a project, do the bang to create random, then click the keys to see the output.
2. Save the project.
3. Load the project again (nothing happens when I click keys but when I open the device everything looks fine but coll is not outputting).
damn its a nasty bug . pushing to coll allows for retrieving "key's" from coll but not index retrieval via "int" ? . it works for bangs and its dupming stuff out , works for next message ? This is weird . Now storing new data directly at new index will respond correctly but still pushed data not . :/
#EDIT
one thing that bothers me is that Dict stores numbered keys as symbols . maybe data is not properly parsed under the hood . it has to be reported
Its true . use [tosymbol] for your "int" and u will get Coll's data :/
I've now got another problem when I create new random numbers using the [tosymbol] object to recall - the output doesn't trigger the coll. Kind of like the problem I had but in reverse. Presumably because this data in the coll is now indexed via integers and not symbols? Will send this to support...
U have to store your random sequence with integers for coll naturally like before . Pulling it from coll to dict will convert indexes to symbols . Pushing back seems to not converting them back to integers which i can understand when i think of how json data is constructed . Only now u are able to retrieve your indexes from coll with [tosymbol] as coll holds those indexes as symbols after pushing data from dict . Just to note its not efficient way sticking to this workaround :/
This is known, sorry.
Can you avoid coll altogether?
Hi Andrew,
Yeah that looks good, at least you guys know of the problem :)
Yes, posting the problems you encounter will always help others (like me!). Thank you.
And here's another workaround. I hope it helps someone else.
... but I wonder why isn't this fixed already...