Mapping to MIDI Pitch to EQ Frequency Knob

Brooks Frederickson's icon

Hi all - seems like a simple thing, but I'm stuck. I want to map my keyboard's MIDI pitch to the frequency knob of one of the points on the EQ8. The part that is tripping me up, is that the knob that corresponds to the frequency receives 0-127 and outputs 10-22000hz. I know the range is exponential and I tried using the exponent option in [scale 10 22000 0 127 x] but the numbers didn't match up. When I played an A at 220, the resulting frequency wasn't exact. Any ideas?

Roman Thilenius's icon


sometimes there is a lego brick which is already shaped like you need it to: [mtof]

if you want to go deeper, mtof performs [expr (440.*exp(.057762265 * ($f1 - 69.)))], where the offset of 69 is the chamber tone (you could use anything else)

another method is [expr 8.1758 * pow(1.0594633\,$f1)], which is a more accurate formula in a 32 bit enviroment (i dont have longer contants for max 8 here now), but also needs more CPU.

method #4 would be to use #3 and write the results for 0-127 into a [coll]. it will be accurate AND fast, but limited to midi/int input.

-110
@ scientific mood

Brooks Frederickson's icon

Hi Roman - I'm using [mtof] to get the freq from the MIDI note, but I'm having trouble sending that freq to the freq knob of the EQ8. The EQ8 freq knob uses 0-127.

Maybe I don't even need to go from mtof and just use the midi note number to control the EQ8 freq?

Gfrom the B's icon

Hi,
I also go around that for some time. maybe someone can advise/ post a patch?
kind of stuck just after I convert the midi to Freq in hz.
See attached.

Send note.amxd
amxd 3.76 KB




Thanks in advance.

double_UG's icon

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

Gfrom the B's icon

Thanks man, so helpful!
Few Qs:

1. What means the value 136.726274?
2. at the moment when I release a key it sends again the pitch message. (creates problems sometimes when I dont release the last note fast enough.
3. How can I add an option that will allow me to control the freqs in the same relation but to choose different starting point? for example:
every time I press the key A2 the freq will point on E2, key A3 AND the freq will point on E3 and so on...
see attached.

Keytrack eq8.amxd
amxd 149.23 KB

double_UG's icon

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

Gfrom the B's icon

Cheers :) I am learning here.

Mikki Hatfield's icon

Hey, I've been trying for so long to get this to work with the Redux Knob, but it barely moves. I know it's close because each note has a different value, it's just barely moving at all. Anything you can do to help is greatly appreciated, thank you!!

(I've really been wanting a generalized "Midi pitch to knob" effect for a long time now. Portamento/glide would be icing on the cake.)

dl CdS's icon

Hi everyone, thanks to this thread I managed to improve Expression Control Plus so it meets my needs
https://maxforlive.com/library/device/5695/expression-control-plus

This plugin can use MIDI note to control mapped knob with a nice up/down portamento option.. But it does not match the note frequency when mapped with an EQ
I used GFROM THE BE keytrack code to improve this and it really does the trick now, thanks

As I'm pretty new my next step is to add a on/off button on this.. See you around