How to load .mtx file into max/msp

Jan 31, 2012 at 7:13pm

How to load .mtx file into max/msp

Hi All.

I have some data which is in a format of .mtx. Which is a M by N matrix. Anyone knows how to import this data into Max as a stream which row value is the list and column represents the channel.

Thanks

Jiajun

#61561
Jan 31, 2012 at 9:40pm

Is it a text-based file format? If yes JavaScript would be a possibility.
j.

#222184
Jan 31, 2012 at 11:28pm

Hi Jan.

Yes, it is text-based format. Can you be a bit more specific as I never use JavaScript before.

Thanks

#222185
Feb 1, 2012 at 7:28am

Hi wiccy,
I am not sitting at a computer right now. But take a look at the js file-object docomentatiom and also at the [filein] object.
J

#222186
Feb 1, 2012 at 1:23pm

Here is an example of how to read a (text) file. Depending of the character encoding of the file you might create your one lookup-table i order to translate back into readable characters.

– Pasted Max Patch, click to expand. –

Of course you still have to do the parsing into a usable format….

Jan

#222187
Feb 2, 2012 at 12:00am

Thank you so much Jan. This really helps.
Now I can load the file in, but the problem now is how to pack them back into a stream of data. like originally: 0.2 0.3 0.4 now becomes: “0″ “.” “2″ “SPACE” “0″ “.” “3″ …….

#222188

You must be logged in to reply to this topic.