No, probably I’m missing something really obvious here that you’re thinking ahead and that’s why we are not understanding each other. What I’m saying would look like this:
In the .csd:
gentable bounds( 10, 30, 225, 120), tablenumber(1), ctrltable(2), tablecolour(“silver”), identchannel(“table”), zoom(-1), active(1)
and then in the score:
f 1 0 4096 -2 0 ; the main table
f 2 0 6 -2 82 39 393 472 486 430 ;P1(x y), Ctrl1(x y), P2(x y)
In Cabbage’ source code we would have to check with -I’m guessing in mixed pseudo-code- something like:
if(cAttr.getIntArrayProp("ctrlTable").size()!=0)
goBezierMode;
else
JustDoWhatYouAreAlreadyDoingWithTables;
goBezierMode means Cabbage calculates the Bézier segment and replace f1 with the computed values. So InputMessage would have a really long string passed to that contains the newly generated y-values. The function provided by wikipedia doesn’t produce values at every consecutive index (using the values in f2 the first two x-values are 82 and 88), so we should find a way of interpolating between those or else changing the general strategy.
So after that you’d have an f1 with a Bezier segement like the one I attach to this post. If the user moves a lineTo point or a ctrlPoint in editMode we would have to replace f2 (which is the one the user should save) and then also f1 with the newly generated values. In the end what you’d see in Cabbage is an illusion -just like you do now- because Cabbage is constantly replacing the tables when active(1) has been set. The only difference is that Cabbage would replace f1 even with active(0) if you pass a table number as an argument to ctrlTable.
I hope that was clear and I didn’t messed up what I said!
I’dont know much about JUCE and svg editing, but we would have to create a parser for svgs in Csound to do this, shouldn’t we?
Here’s the result for that segment in gnuplot: