MIDI Input Smoothing Curve

Hi all. I play keyboards live and have a variety of sound layers I bring in and out via 8 midi faders (MIDI Ch5, CC 102-109, values 0-127). I often have to change fader positions quickly while playing, maybe from 85 to 0, but this is a very jarring thing to hear. My current solution uses a Max for Live plugin called Smoothie to sort of decelerate the parameter movement towards the destination value along a logarithmic curve, but I am hoping to use Bome to handle this input smoothing before the input data even reaches the DAW. It would need to organically smooth out dynamic and continuous changes to the fader values as well as have a customizable milliseconds value to get the feel right.

Is what I’m describing doable in Bome? I’ve seen an example elsewhere on the forum for smoothing a single fader but this appears to be linear and not responsive to continually changing input values.

Many thanks!

Yes, this might pose a bit of a challenge. You can certainly start a timer (and even a different one for each fader) and set an interval between ticks with a target destination value. You would have to write a formula for the curve you want to use and if you dynamically change the interval, restart the timer on another point in the curve. Since Bome MIDI Translator Pro does only integer arithmetic, I believe this would be a challenge. I’m not saying that it can’t be done with Bome MIDI Translator Pro, just that it would be quite difficult and probably better suited for happening with a plugin of sorts.

As you said, you already looked at timer solutions where you set an interval and target value and the timer runs until you hit the target value. If you want to change the interval mid stream, then you would change the interval and restart the timer with the new interval. Any time you start a timer the old timer goes away. If you want to change 5 different values, you would have to do this with 5 different timers, each controlling a given CC and with a given interval.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi Michael,
as Steve says (and in the forum post you’ve found), this is relatively simple to do in MT Pro for linear fades. But if you are not particular about the exact shape of a logarithmic curve, also that can be done easily in MT Pro.

The idea will be:

  1. In the project, you maintain one variable for the target fader value (as received by the MIDI fader), and the current fader value (the last one sent as CC message). Let’s say, h0 is target, and k0 is current fader value.
  2. When you move a MIDI fader, this will happen:
    • h0 is set to the MIDI fader value
    • the timer fader 1 smoothing is (re)started. A timer, which repeats indefinitely every, say, 50ms.
  3. Whenever the timer fader 1 smoothing triggers:
    • rules will calculate a new value for k0 (which is somewhere in between h0 an k0).
    • the MIDI CC message is sent with value k0
    • if k0 equals h0, the timer is stopped.

Now the key is in 3. above, how to calculate the new value k0.

A linear fade can be done like these rules:

// calculate difference pp of h0 and k0
pp = h0 - k0
// limit how much k0 is adjusted in every step (at maximum 3 values -- as an example)
if pp<-3 then pp = -3
if pp>3 then pp = 3
// finally, calculate new value of k0 (to be sent as MIDI CC)
k0 = k0 + pp

Now implementing a logarithmic fade is not so hard. In this example, the fade will start in big steps, then ease off as it approaches the target value. We just send the center value between current and target value. With every iteration, the center becomes closer to the target value, and once it’s close enough, we’ll stop it.

Rules for logarithmic fade (50% each iteration):

// calculate difference pp of h0 and k0
pp = h0 - k0
// Calculate the jump qq, which is 50% of pp
qq = qq / 2
// If we get too close (rounding error), jump to the target value
if qq==0 then qq = pp
// finally, calculate new value of k0 (to be sent as MIDI CC)
k0 = k0 + qq

What do you think?