Page 1 of 1

Retrieving Y values from Breakpoint at X value

Posted: 03 May 2014 08:35
by Harromelt
Hi !

Been tearing my hair out all day on this. I am trying to 'scan' though a breakpoint periodically and report the y value at point x. I have managed to generate basically a sawtooth LFO using the time variable, so values going from 0. to 1. over and over in time, and want to retrieve the y value at x(sawtooth). When I just parse out all the breakpoint data in Max/MSP, I can feed it to "function" object (breakpoint box) which allows me to feed it x values and receive the y value in return, so that's a slight indirect way to get it.... problem is, things would be much more elegant and useful in Reaktor and other places if I can just get the expression right in the Lemur. What obvious phrasing of an expression am I missing? There's the "breakpointat(x[], y[], phase)" function but I haven't been able to make that useful, and just want a simple x-y relationship. Please help!

Thanks!

Re: Retrieving Y values from Breakpoint at X value

Posted: 03 May 2014 10:49
by Macciza
Hi
Have a look in the Object Reference in the manual
The x and y variables give the values for the discrete breakpoints, i.e. Breakpoint.x = {0,1,0) so Breakpoint[0]=0,Breakpoint[1] =1 etc
Same thing with the y variable - together they give the discrete x,y breakpoints. The z variable is a similar array that gives 0/1 depending on touching the point.

If you want to get the y value of an arbitrary point x, you would just need to do the maths; work out where it is is between two point and therefore where it is between the two values
The breakpoint at function is for adding points from memory

Re: Retrieving Y values from Breakpoint at X value

Posted: 03 May 2014 18:52
by Harromelt
Thanks for the response! Right, so if I am trying to "scan" evenly through the x-axis, I would want to interpolate between Breakpoint.y[0] and Breakpoint.y[1] in time Breakpoint.x[1]-Breakpoint.x[0], right? Is there a clever way to express that in generic terms so I can live edit the breakpoint, adding and subtracting points on the fly?
Macciza wrote:Hi
Have a look in the Object Reference in the manual
The x and y variables give the values for the discrete breakpoints, i.e. Breakpoint.x = {0,1,0) so Breakpoint[0]=0,Breakpoint[1] =1 etc
Same thing with the y variable - together they give the discrete x,y breakpoints. The z variable is a similar array that gives 0/1 depending on touching the point.

If you want to get the y value of an arbitrary point x, you would just need to do the maths; work out where it is is between two point and therefore where it is between the two values
The breakpoint at function is for adding points from memory

Re: Retrieving Y values from Breakpoint at X value

Posted: 04 May 2014 03:06
by Macciza
Hi
Had a bit of a look and its all pretty straight forward for getting the values - sorry about earlier misinformation
breakpoint at returns it for you - breakpointat(Breakpoint.x,Breakpoint.y,.25) gives you the value at .25 across x axis
Breakpoint, is the object - Breakpoint.x returns an array of values, and phase means where it is between them
Can also find between points in array - breakpointat({Breakpoint.x[0],Breakpoint.x[1]},{Breakpoint.y[0],Breakpoint.y[1]},.5)
Adding removing points is either done via Live Editing mode and touch - or by simply changing the x/y arrays of the object