Linedrive opposite curve (frequency scaling problem)
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. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 960.3oc0X00ihBCE8Y8WAgrOsw0zVn.tuM+G1j8AyjInT0ZfBgVcmcmr+229 AnUDQFczwMYBXub4168zSO2x71vAtyxekvcc9tyTmACda3fAZSJCCpFOvMK9 04owbsatyyyxHLg6HyyDjWEZ6+LVLekiXEwgQHIoDm0axJp8pnjvkuTrflyd ojLWXlQHHbLXjiGTeCTcw44p2ZQNSvo+gnbFhjOsxb4xYJSfcVJTyMks7fP6 YEZHVGbjczoI57Ne15u4WmmrMYTVJQnKUnUZvhyzog6Skz3TK2y2Hp8GnL92 gCUWFckn4OVQXNwIq2vERLkxOKPpqVTH7VAjnP+d.jdOb.4S6wPmEzR9NOtJ LApQAHB1CLA8ogIYDNOdI4HLgSDNeAVa1LIheWPLEmq643MsfHnI58YHrlk3 qoLvn1AjvVADz6DPf+W.HAnyiG3OM7fQ9kLANBN9pjKCFeR3XQZdr3ZHI.rF TPcsqAF7ngJoTFIojtknQGGn5OPfbv6k230CLBFNQeyWeSoyzJHE9nAR74wx V+P7XEHofIERA5hMcEDIOCT4i6T9sc82f6.FI2nHCRc71FWtahN7ImnoNpp7 BFivplMgGUlmXq4HG2YwrkmEYmkWlPJmmmlWZdevXDzC.fpSO3g78C7z+x2C hQibrIgcr61bPgH+ixV6xztE3rkGjBQSvS7Uy6DeLZhNWlfQPXTyLnThlBR4 KDV7rThcDEx0Q1Ris5hUt1SyjXtxM7NHvlnbomBTtlWGYCoGzJCpdWIOdKI4 kXgLImsQP1+KdEUphKoXLoaH4KpMWa2t1kEkPkJlikf2iOG3UMCwazIivwnX Cu1R4zNbfuJuTzN+9.+jOXYC2lhe103nd+U8sORAIfROZrktzM4vOHilsWmM 1PQeZ5QIVQyVMRYep2y8RNRt6NTpFEn0bCrHbtlO66hTST0kr65E+tcc7jSu dE4sWnRc88JTgC7CAAp7JRewSJW42eQpZtExRwv9So.cKGopRYsWrQXatAI4 lK4.dTTbNjCeZIGsePTWJN5BRebuF+iQzTIk8C2iwy2TNul8Ue1Um8jfDBWP Y6XSS2qCX4zJZRBgY2vJgxU3Sxo+5u9lO3djNJ51cJcZT4smOg2szIrOKV92 szowBQ64C79AOv9fOMX7GmOYzjhbJSTsixCDLFq5QpaUZOZ+D8ww276yJL5h p.OSEfL8RNbDJxt3htM0FpG0F9BIKFgv3hhsjRdUH0Yh7XEqM8A0GaQc1ZyP cDcKIJoai+QCUQ6uC+GbpPCW -----------end_max5_patcher-----------
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)
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!
These objects come with Max 5 and up, so you could still use them if you like.
Forums > MaxMSP