Plotting points in 'Function' in real time

Grubby's icon

Hello wonderful maxmsp enthusiasts!

I'm looking for a bit of guidance with the 'function' object.

I'm using it to control the volume of several sounds over the span of 5.6 mins. The object has its X axis size set to 336000 (336s) and there is a new point at every 12s interval. The graph is pre-plotted so all I have to do is send a bang into the object and it reads the Xaxis data over the 5.6mins.

I would like to know if there is a way of having the points plotted on the graph in real time, i.e. a point is plotted a x-0 y-0.1, a line is then drawn in real time up to x-12000 y-0.4 etc. I can figure out how to have a new point plotted every 12seconds but I'd like to be able to see the gradient between each point moving in real time (e.g. every second).

Also......how would you stop the function object reading the graph and return to point 1? (i.e. if I send it a bang it takes the 5.6mins to read all the plots but sometimes I want to stop it from doing that so I can re-start from the beginning).

Max Patch
Copy patch and select New From Clipboard in Max.

Hope that all makes sense!

Thanks in advance.

nick

Grubby's icon

It's really just the visual element that I'm after, function performs as I want it to do it's just that I need the points plotted in real time so that the audience can see the visual element corresponding with the audio.
LCD makes sense visually but I'm not as familiar with it as function and can't find a way to plot data in the same way as you would in function.

I don't appear to have the plot~ object, I'm using Max 5 so not sure if it's not in that version.
Any idea on how to stop function from reading the data mid flow?

Thanks for your help.

nick

Grubby's icon

Ah yes, the arguments 'stop', 'pause' and 'resume' sent to line~ does the job - thanks for that!

If only I could figure out the visual aspect of function...

Mark Durham's icon

There probably is a way, by having another function and feeding it individual points one at a time (or possibly adding to a list). Probably going to be fiddly as function wasn't exactly designed to do that.

Max Patch
Copy patch and select New From Clipboard in Max.

If I need to visualise this sort of thing I ususally use snapshot~ and multislider like this:

Maybe that works for you? There are a few other scroll options in the inspector. Adjusting the snapshot affects the update rate.

Grubby's icon

That seems like a good option, thanks. Not quite there yet visually though, I can't seem to get it to plot the data from left to right so that it follows the contours of the function graph, I thought that changing the slider style to reverse might do it but it then just plots the data from right to left.