Retrieving Y values from Breakpoint at X value

Discuss problems and solutions.
Post Reply
Harromelt
Newbie
Posts: 3
Joined: 03 May 2014 07:31

Retrieving Y values from Breakpoint at X value

Post 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!
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: Retrieving Y values from Breakpoint at X value

Post 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
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Harromelt
Newbie
Posts: 3
Joined: 03 May 2014 07:31

Re: Retrieving Y values from Breakpoint at X value

Post 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
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: Retrieving Y values from Breakpoint at X value

Post 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
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Post Reply