Hi, if you try to make a synth that generates different sounds based on touch velocity (like a piano) you will soon notice that you need some way to change the velocity curve to adapt it to the sensibility of your midi keyboard. In many midi keyboards you have some way to change the “hardness” of the touch response (i.e. the velocity curve), in other keyboards you have only some standard presets like light, normal, hard, etc. and there are some cheap keyboards that doesn’t have this ability at all. Anyway, it’s always nice to be able to change precisely the velocity directly in the GUI of your instrument.
I would like something like in the following tool:
Where you can add some points in the graph and move them as you like, to generate your personal velocity curve.
For now, in my experimental instrument, the velocity curve is hard-coded with a global array such this:
giVelCurve[] fillarray 0, 0, 0.2, 0.05, 0.5, 0.2, 1, 1
where each pair means: (original_velocity => modded_velocity), a bit like in the above graph of that tool.
Then I have a little macro that does a simple linear interpolation to convert from the original velocity (that you give to the macro as a parameter) to the modded one, based on the above array (note that it’s not limited to 4 points… The array could have all the pairs you want and the macro would calculate the correct interpolation).
Now, if only there was some widget in Cabbage that allowed to “draw” some points in a XY graph and return these points as an array of pairs (x,y), we could have a very cool velocity curve changer…