Hallo, Chris McCormick hat gesagt: // Chris McCormick wrote:
This is a 2 dimensional control surface. The number box adds new controllable points. Banging the inlet outputs a sequence of values (n x y) where n is the number of the controllable point, x is it's normalised x value, and y is it's normalised y value. You can unpack these to assign different points to parameters in your patches.
Actually for this kind of surface, you wouldn't need to go through the metro-banging to set borders anymore. (I'm not sure yet how to do this with arrays, though, as you ask in your other mail.)
Attached is a version, which uses the scaling of coordinates in structs to greatly simplify your patch. Note that I also avoided the constant traversal of the graphing subpatch, because that can be very expensive CPU-wise. I avoided it by auto-creating a little abstraction (ctl-parser.pd) that receives the pointer of the newly created graphical control object and caches this. This way, no traversal at all is done and you only get a little "spike" in CPU the moment, you create the new dots.
The other "trick" out of my bag is, that the struct doesn't have fields for "float x float y" at all, these two are always 0 here. Instead I use different fields for the coordinates of the dots: x0 and y0. These two are scaled with (a:b)(a+?:b+?) to keep the whole displayed graph inside of an area of 200x200. Note that the output isn't normalized. You could use for example [list-normalize] out of my [list]-abs collection for this.
Frank Barknecht _ ______footils.org_ __goto10.org__