Forums > MaxMSP

Linedrive opposite curve (frequency scaling problem)

February 11, 2013 | 4:47 pm

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.

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?

– Pasted Max Patch, click to expand. –

February 11, 2013 | 5:16 pm

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)


February 11, 2013 | 5:58 pm

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!


February 11, 2013 | 6:29 pm

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


Viewing 4 posts - 1 through 4 (of 4 total)