Forums > MaxMSP

plotting functions

January 14, 2014 | 11:38 am

Hi all,
see enclosed.
this is a straightforward (or not) attempt to plot a function.
I am using lists, expression and a multi slider to show the values.
I does not work. Meaning that the function visible is not the one that is meant to be seen.
Interestingly if I use just a linear function all works…
Any idea what is wrong?
G.

<code>

– Pasted Max Patch, click to expand. –

</code>


January 15, 2014 | 6:33 am

Lot’s of ways to do this sorta thing. And a lot of details that can throw it off.

Regarding your patch. zl group can only handle 256 list elements unless it is given an additional argument to specify more. ex. [zl 1000 group 1000]

The other thing I would suggest is throwing a metro in there so the multi slider is continually refreshing. That way, you can tweak the $f2 input value until you find what you’re looking for.

I also added ‘ghost lines’ to the points (in the inspector) to give the waveforms more body.

– Pasted Max Patch, click to expand. –

January 15, 2014 | 6:45 am

You can also use a line object to drive the drawing. Set the multislider in reverse point scroll mode to plot the function a single pass.

– Pasted Max Patch, click to expand. –

January 15, 2014 | 7:02 pm

Thanks a lot for the examples.
I found the error!
cos works in radiants…
;-)
All good now.
G

<code>

– Pasted Max Patch, click to expand. –

</code>


January 15, 2014 | 8:01 pm

Your range is set from 0 to 1… not -1 to 1. I think that’s causing trouble too.


January 16, 2014 | 10:37 am

thanks, but that is fine. the key issue was the cos.
G


Viewing 6 posts - 1 through 6 (of 6 total)