Arrays have an option to generate a bezier curve. In the attached patch, seven points are put into an array and displayed as a bezier curve. It looks nice, but does it have any function? When you read the array, you just get the points you put into it, not the points on the bezier curve. Is there a way to use the bezier curve as a wavetable or envelope, instead of the original seven points?
bezier.pd
-
How to use the bezier option in an array?
-
@jamcultur I think it's just a display option. If you want to interpolate between your 7 points, you either have to roll your own (e.g. linear interpolation), or use tabread4 (which requires you to pad your 7 points at the beginning and end). Tabread4 has some strange inflection points though that might not be what you want. Maybe someone knows of an external you could use?
-
I was looking at writing my own bezier function to generate curves when I ran across this option to generate a bezier curve in a graph. I was hoping that it would do more than make a nice looking display.
-
Yes, indeed, just for display.
And polygon surprisingly is the cheapest option of the three.For interpolation [cyclone/wave~] has more options, such as cubic, spline, Hermite and Lagrange as [tabread4~].
-
@jamcultur And @lacuna posted a handy tool for adding the guard points for 4 point interpolation here....... https://forum.pdpatchrepo.info/topic/14301/add-delete-guard-points-of-an-array-for-4-point-interpolation-of-tabread4-ect
David. -
i made this abstraction a while ago bezier.zip. There is also an abstraction "pp.xycurve" to draw and read from 2d bezier curves in the audiolab library: https://forum.puredata.info/topic/12334/audiolab-is-now-available-on-deken