pitch bend scale question

gershwin's icon

With a scale object scaling midi values (1-127) to -2. and 2. the idle value is 0. when I want it to be 1. with a range of -2. and 2. (this will be the multiple used to shift the pitch, 2 = +1 octave etc.)

How would I use scale and get 1 to be the idle value?

Ploki's icon

I'm not sure if i understand this. pitch bend (7bit pb that is) like every other midi message sends out values from 0-127, idle value is usually 63 which gives you -63 in one extreme and +64 in other extreme.
you could if then to set the value to 1 whenever the input is 0.
Also, scaling 0 127 -2. 2. won't give you an absolute 0 value.

Could you be more specific? Perhaps paste a patcher?

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

I think this sums up what my problem is. I'm guessing this is a really easy thing to solve. I managed to do it ages ago but i've not used max for a while and im a bit rusty.

frjurado's icon

i think you're having some scaling misconception: if you want a pitch bend range of +/- 1 octave, the frequency multiplier should be between 2 (+ 1 octave) and 0.5 (- 1 octave), with 1 as idle (no bend). so it's not a linear scaling what you need.

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

i tried this: scale to +/- 12 (semitones), do a floating point midi sum, and only then to mtof. the other way you have to go through some nastier maths...

Christopher Dobrian's icon
Ploki's icon

Good answer oldTurtle, and good solution.
I rarely use 14bit pb, find it a tad useless because i don't have a controller that would need such high resolution output.

frjurado's icon

i don't have any 14bit pitch bend controller either. when using max, simple [$1 100] message to [line] does the trick, avoiding steps if you're using large PB ranges like 1 octave...

gershwin's icon

is there an easier way to scale bendin values to multiply a frequency value? I've tried the solutions above and I'm stumped.

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

this example maps pitch bend (7bits) to -1/+1 range, then directly to frequency multiplier: the [expr] object. i just find it easier the other way, because the non-linear conversion is kept hidden in the [mtof]. hope it helps.