Biquad cut off frequency - midi control

Dutton017's icon

Hi,

Im trying to control the cut off frequency of the biquad with a midi control but as midi is 0 127 and the frequency is 20-20000hz when using the scale object it jumps when it reaches around 600hz as its not a smooth scale.

This is probably a very simple solution to this but i can seem to find any information on it.

Any help would be appreciated.

Thanks

brendan mccloskey's icon

I'm not sure what you mean exactly by "it jumps"; but I would ask [slider] to output float values, then multiply that value by 100. You know you can add an exponential value to [scale] as a fifth argument, c. 1.02 - 1.06 usually works. Post a patch for math-phobes like me....

Brendan

Dutton017's icon

Sorry for the poor description!

A patch is attached. basically when you move the top dial (which represents a midi input as it moves between 0 - 127) you will see it wont smoothly control the filter cut off.

Thanks

1916.FiltCutoffmidi.maxpat
Max Patch
brendan mccloskey's icon

I see

filter cutoff values are scaled to be non-linear, probably for psycho-acoustic reasons beyond me - however, you can address this by doing what i suggested in my first response; add the value 1.08 or 1.09 to the [scale] arguments and you'll get a more linear response in the low-mid region:

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

Brendan

Dutton017's icon

Thats great, Thank you very much for your help!

James

brendan mccloskey's icon

Look at the [expr] helpfile too, for more maths fun!

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's an example where the incoming MIDI control value (0 to 127) can be scaled to cover any desired pitch range (in terms of MIDI pitch number), and that pitch range is then converted to frequency in Hertz.

Roman Thilenius's icon

psychoacoustic reasons? :) or godwins law.

the solution is [mtof], btw.

brendan mccloskey's icon

filter cutoff values are scaled exponentially in the upper and lower extremities, as human hearing tends to centre around the critical midrange, and deteriorates at those reaches. Or so I'm led to believe. Someone back me up? Fletcher-Munson?

Godwin? Hardly applicable here.

:-)

Brendan

Roman Thilenius's icon

if you really want that, they are scaled somehow, i agree. just as with gain sliders.

but i guess his question was the result of him using the linear input as is, without
any conversion from linear to frequency.

and in lesson 2 we should tell him about interpolation.

fletcher munson? that is frequency to gain ... i think we only need the bose-einstein
mtof trick. :D

brendan mccloskey's icon

"gain sliders"

just the example I was grasping for...

Roman Thilenius's icon

yeah. there was someone talking about gainsliders here at the forums like 6
months ago or so ... i remember me googling for an industry standard in
order to make an abstraction, but there seems to be none.