Need Math help; desired range of values too large for smooth intervals?
Dear Max/MSP community,
I'm having difficulty thinking about what to do about my math within one of my patches...
Long story short I am using a MIDI controller for the first time within a patch I've created doing some FM.
Basically there are objects that I want with a range of 0-2000 and some others with a range of 0-4000...
All I've done is divide the Maximum desired value by the nice 'ol maximum MIDI value of 127, but I end up with intervals that are too large for my taste... I.E: (r [MIDI signal]) -> (*~ 15.748032) -> (flonum)...
Please, throw me any advice, suggestions, etc. I would really appreciate it.
thanks
...and you don't want to add any smoothing to the stepped output?
14 bit midi pitch bend, instead of 7 bit?
you could use the scale object followed by line to smooth out the steps
something like this
You could also experiment with using two faders alongside the smoothed steps. Either have one fader go over the whole range and add another one as a "fine-tuner" to bridge the gaps, or have one fader control the range of the other (say, between the whole desired range and a semitone).
But in both cases, you'd still need to smooth the steps with line for when you move great distances with a large-scale fader - these things just give you additional detail control.
It's really quite astounding that we're still stuck so deeply within the MIDI standard with all its antiquated limitations. Lousy 7 bits...
Thanks all for your responses. I really appreciate it, however I'm a little confused due to the fact that I still have a lot to learn in Max/MSP and I still consider myself a newbie. I apologize in advance if my response[s] seem confusing and/or rude. I'm just trying to understand is all. Thanks again folks!
Gregory Taylor, How did I imply that I DID NOT WANT to add "smoothing" to the stepped output?
Please elaborate on what "adding smoothing to the stepped output" entails... There's still A LOT that I need to learn about Max/MSP - I still consider myself a newbie.
Justin, 14 bit MIDI pitch bend, instead of 7 bit MIDI pitch bend?
Please elaborate, because I don't know what you mean by that vague question.
Chris Cousin, what do I do with that line of code?
Szrp, thanks for the suggestion. Definitely a good strategy to be aware of play around with.
copy the code and paste it into a new max patcher window.
and have a play with the input value with different smooth times and see how it effects the output. the scale object can scale a midi cc value (range 0 127) to whatever synth parameters. the line smooths the steps over time
14 bit midi has a higher resolution than conventional midi, but only certain CC support this method (pitchbend, AFAIK). if u have midi hardware that can send 14 bit data, take a look at [xbendin] object. and of course google 14 bit midi...
Chris Cousin's approach is basically what I would suggest, although I generally prefer to work in the floating-point range, since I like having a bunch more data points as compared to those squared-off integers.
Perhaps you might consider taking the following bit of code, pasting it into an empty Patcher window, and saving it with a memorable name (like, say, "midimap-smooth") in the "patches" folder inside your Max application folder.
In fact, why don't you make a new folder for yourself in the Max5/patches folder called "my-abstractions" so you've got a place you always put these things. Once you've saved this bit of code there, you've got a reuseable abstraction that you can add anywhere you need it: just type "midimap-smooth" into an empty object box and it will magically appear.
If you pay attention to these things, you might notice that rolling over the inlets and outlets for your saved abstraction gives you the same kind of assistance bubble that *any* Max external has. Wanna know how it's done? Take a look at the original abstraction you saved, open the Inspector for any of the inlet or outlet objects, and see if you can find where the text comes from.
Getting into the habit of creating these kinds of personal tools is going to save you a LOT of time - heck, your original post already mentioned you were using it twice....