Linedrive opposite curve (frequency scaling problem)

mattybigback's icon

I have a patch that adjust the frequency of a [biquad~] via a filtergraph. I want to be able to adjust the frequency using a [dial] as well as a [flonum], and have the [dial] update the [flonum] and vice versa. The problem I have is that because I'm using a [linedrive] to add a curve to the output of the [dial], when I adjust the [flonum] the needle on the dial jumps.

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

I can't figure out how to reverse the curve of the [linedrive] so that the [flonum] lines up with the [dial]. Does anyone have any suggestions?

Peter McCulloch's icon

May I recommend using live.dial instead for the dial? Gives you the ability to edit it in frequency, plus you can specify an exponent for the scaling curve. Only downside is that the range can't be changed at runtime, but that will probably work fine for your case.

Linedrive is one of those legacy objects with the funky exponential scaling that I cringe when I see...

What does work really well for exponential mappings (and is obvious on how to reverse it!) is the following:
scale 0. 127. 20. 12000. 3 @classic 0

The "@classic 0" specifies the use of plain exponents rather than the usual funky exponential algorithm (same formula as with linedrive, IIRC)

mattybigback's icon

Thanks so much! I was tearing my hair out trying to figure out the exponents. I can't use live.dial objects because I don't have max for live at uni, and this is part of an assignment. This will end up being a cited source in my write-up. Once again, thanks for your help!

Peter McCulloch's icon

These objects come with Max 5 and up, so you could still use them if you like.