Overcoming 7bit MIDI constraint

D Vyd's icon

I am new to MAX. I would like to send the "cycle" object a smoothly changing value between 0khz and 20khz using only standard MIDI CC. I own a Novation Launch XL. One solution might be to remap the 0-127 value to being a positive or negative rate of change with 63 or 64 being zero change. So, a value of 65 might add 0.5hz and a value of 127 might add 1000hz every 1/10 of a second until reaching 20khz. This would require an update loop every 1/10 of a second (or some other update rate) whenever the midi controller is off center. A few questions:

1. Is this a good solution to MIDI stepping without requiring new hardware or OSC?
2. How difficult is this to implement in MAX?
3. Could I send such a signal to Max's MSP objects?

Thank you,
d. vyd

Source Audio's icon

Limitation is not Max or midi, but what Novation Launch XL is capable of sending.
In midi world, one can combine 2 controllers as MSB LSB, having 128 x 128 resolution,
resulting in 16384 steps. Using sysex, one could do any resolution adding more multipliers.
But it all depends on what is Novation able to assign to 1 control.

Christopher Dobrian's icon

You'll need to get a bit more rigorous and specific with the arithmetic of your description. You need to decide whether you want to control increments of frequency or increments of pitch. And based on the range of discrete values your controller can produce, you need to decide what each value will mean.

Most knob/fader/wheel controls on a MIDI controller will send out 7 bits of information, from 0 to 127. That's enough to give 128 discrete pitches , in equal-tempered semitones, from 8 Hz to 12,544 Hz if you simply map the MIDI data to mean pitches (64=E above middle C) and then convert those to frequencies with mtof. Or you can devise any other mapping scheme you want. Or, as Source Audio implies, if you have a controller capable of sending more values (on some devices the pitchbend wheel can send out 16,384 values, for example), or if you combine two different controllers, you can get better resolution of control.

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

If you want to make something more like an up/down button on a hardware interface, you might want to look at the incdec object.

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

It sounds as if you want the displacement of the control (fader, wheel, whatever) to determine the size of the increment/decrement. (I suggest incrementing/decrementing pitch rather than frequency for more "intuitive" results.) So, whenever the control is not in its centered position, scale the amount of its displacement to determine the amount of increment/decrement, and also to turn on a metro that repeatedly enacts the incrementing/decrementing. When the control returns to its midpoint, turn off the metro. I leave that arithmetic up to you.

Source Audio's icon

I would also recommend some sort of step up/down, because it will be very difficult
to set a specific value in that big range from 0 - 20 Khz using one dial, or slider,
doesn't matter what resolution could be sent.
I have used such methods for control changes, but instead of changing amount of change per
step, rather changing the speed of change.
So metro could be stoped in the middle, but then changing from for example 250 ms to 10 ms
depending on dial position.
One could even recalculate the speed depending on how much is left from current
value till top (or bottom) is reached, so to have better control under fingers.
Or one could combine speed/step amount change if that gives a better feel.
And using a line~ with some smoothing to set the frequency would also be helpful.
It would be very handy to have a dial with fixed middle position, like pitchbend wheels have.

D Vyd's icon

Thank you Source Audio & Christopher. Yes, I'm interested in the the displacement of the control determining the size of the step. I will explore the incdec object and the options you mentioned: pitch, freq, amount of change, rate of change.