Table Analysis/New to Max

rnb7880's icon

Hello!
I am new to MAXMSP so this may be a very easy question.
I am trying to read a file produced by MATLAB in MAX (.wav or .csv is what I have been trying) and analyze it. I need to send a bang whenever the table reads above a certain value, in real-time if possible. The file in MATLAB is a basic table with values for each second.
Any help on how to do this is greatly appreciated.
Thank you

nealriley's icon

I think the coll object might be a good place to start.
You can read in a file, and iterate through each row/etc in your file.
The output from coll can be filtered using an object like [>] or [expr] to check whether the value has reached a specific threshold, and bang if it does.

Hope this gives you a good start!

rnb7880's icon

Okay yes! [Coll] is exactly what I needed... Thank you!
However I cannot seem to get it to go line through line of my text data.
Maybe you can help again? I have a txt file that is all ones and zeros, (two data points on each line, 1,0:2,0;3,0;4,1...) and I just need to count the ones and zeros.
I have the [coll] reading the file, and I have [metro] on a [counter] so numbers are being submitted into the [coll] one at a time. I expected this to then output the number that the input corresponds to, a 1 or 0, and then an if statement sends it one way or the other, but that is not happening.

Here is an image link if it helps at all.
http://postimg.org/image/j9oshd209/

Thanks for your help!!

Untitled1.png
png
nealriley's icon

Not sure, maybe the if statements? Try a [sel] instead?

col_reader.maxpat
Max Patch