Function / Lookup tables: advanced math help plz!

Brian Daurelle's icon

Hello, I'm trying to design a tool for developing and testing a response curve for an effect. I would like a simple little interface that allows a tester to manipulate two parameters to intuitively change the curve so that we can 'dial in' the curve to players' preferences in real time. I want one slider to control the 'curviness' of the curve (i.e. how much it deviates from a straight 1-to-1 response) and another to allow you to offset the center value of the curve output, so that a MIDI note of 64 might output a 44 or an 84, independent of the 'curviness'. The reason for this is that the effect is much less noticeable in the outer registers, and very sensitive within a narrow range that often is somewhere near the center, but usually not exactly at the center of the MIDI range. This is a physical limitation of the hardware it uses and how it calibrates.

I've attached a pic with a few images showing a few states it should be able to achieve:

  1. the default 'normal' response curve (probably sine curves..?)

  2. similar curve with the offset response center point

  3. similar to 1, but a flatter response

  4. flatter response than 1, but with center value offset

Anyone know how to math this into a Function object or a lookup table? Thanks!

Brian Daurelle's icon
Source Audio's icon

function can fix points, in your case

you fix 0 and 2, leave point 1 editable-

after the curve is set, move middle point.

function needs to have mode curve enabled,

you move middle point using a message that needs to contain

point number, offset, value and curve 1 value.

limit deviation from the middle to less then 100%

otherwise you loose curve value.

at least in max 8 it is so.

here is one example

Max Patch
Copy patch and select New From Clipboard in Max.