Accessing a table or coll from javascript

Lee's icon

Hi there, does anyone know if its possible to access a table and/or coll defined in max from a fragment of javascript code? I'm looking for the javascript to be able to modify the contents without having to load it in from the table and then dump the modified contents out again.

Cheers, Lee

Hypnotist's icon

this is really needed information as is good reference of all max js. link to mozilla.org does not help much. I'm long term web-developer so js ain't problem. My only problem is how to manage data with max objects with js.

Lee's icon

I've moved all my datastorage into the js objects - makes it much easier to manage as can create proper structures.

pid's icon

you need

Dict

you can use Dict directly in js.

Pvdn's icon

If there is indeed no way to access coll-data from javascript, what kind of speed drawbacks would i have if i replace the coll with my own storage in js?

Also: what is Dict? Is there some kind of special dictionary available on the js object?

do.while's icon

HI .
javascript is for relatively slow data io . you cant uzi it 1000 times or more without notice of a max/system hangs . it also needs more resources at that point . But if you will have relaxed data flow , you will actually benefit from it . In terms of structuring your data with code for dedicated scenarios . is a good idea . Dict also helps there . check help

Pvdn's icon

Im building an arpeggiator, and my plan is currently as follows:

- collect currently held notes in js
- also in js: reorder those notes and add octaves based on settings
- get them out of js, into a coll so i can rely on better timing when requesting them (with 'next' messages) by metro.