Hi
I need to insert a couple of knobs in a Macro Page, knobs for adjusting the velocity curve of certain layers. Something like Halion’s Eagle and Raven have:

Both Eagle and Raven have a script that accomplish this, and I tried taking some parts of that script and adapt it, but as that script is pretty intricate, with plenty of functions and parameters (a lot of them for other elements of Eagle/Raven’s MacroPage) I couldn’t figure out how to make it work in my case.

The graph showing the curve is not extremely important in my case, the knob would probably be enough. But if it’s not very complicated to implement, then having that graph as well would be nice.

I understand that the “volume” is the resulting velocity (after the curve is applied) but why is it calculated in two ways (one time as (upperLimit / 127 - lowerLimit / 127) * volume + lowerLimit / 127 and then as math.floor(volume * 127) ) ?

My mistake. I tried another way of calculation and then wanted to compare the results. Just forgot to delete that line. So simply delete that. It doesn’t do anything right now.

When you do the calculations you can end up with decimal number. So the math floor is there to round it down to integer. You could combine the two lines into one or just ignore the math floor. It should work too.