plotting functions

geotrupede's icon

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.

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

metamax's icon

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.

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

metamax's icon

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.

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

geotrupede's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

metamax's icon

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

geotrupede's icon

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