Do most (all?) plugins and DAWs do MIDI CC smoothing / interpolation?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I have noticed, when experimenting with different MIDI controllers, that they tend to skip a lot of values - especially when moving the faders and encoders quickly. So moving a fader from the bottom position to the top position might result in the controller sending out CC values 0 28 52 74 98 127 - not smooth at all.

I've been researching this a bunch and really haven't seen anyone even bring it up. So I'm curious - is this something that's well-known, and that plugins and DAWs account for? Smoothing out CC changes, or interpolating between them?

Post

Plugins should smooth them internally when the parameter is something where smoothing makes sense (as opposed to say a discrete parameter with just a few distinct choices). Even if no values were skipped, the 7-bit CC resolution is low enough that you usually have to smooth it anyway. Usually plugins will smooth host automation as well, just because the rate of events might be low (eg. once per audio buffer).

Post

We internally do support smoothing of midi CCs in most plugins. It does not make sense for all assignments, but is very useful for cutoff for example.

Post

Thanks for the insight... it's something I've been curious about. So I guess there would have to be a bit of lag. If successive values are 10 and 20, you have to spend some time interpolating the internal assignment. But I guess this is occurring within just a couple milliseconds or so?

Post

I like computers for digital audio and mixing/mastering etc, am not a luddite, but mainly over 3.6 decades have the most hands-on experience with MIDI Hardware synths. Maybe some HW synths do smoothing, dunno.

In my experience fast PitchBend or CC gestures, well they do tend to be sparse/gappy from most hardware controllers. For hardware MIDI they need to be "relatively sparse" even drawing gestures into a computer piano roll, because if the PB or CC gestures are too dense they will choke out, compete with note information/timing on the slow MIDI pipe.

But fast sparse gestures generally sound smooth to me. For example at 120 BPM, a Pitch-Bent eighth note would last 250 ms. Even if this is a 2 semitone bend only using 4 MIDI events, the changes are sequential 32nd note quarter-tone pitch changes, each about 62 ms duration. At that speed and "fairly small" pitch increments, many ears might not hear much zipper effect just because it goes by too fast in too-small increments, even without smoothing?

Maybe zipper effects would be more noticeable on long-duration slow-moving gestures? But in that case, the gesture would typically contain more MIDI events, finer-grained and less gappy in values?

If you maybe have a 10 ms smoothing time constant: Then in the case of a painfully slow gradual filter sweep maybe it could sound a little steppy even with the smoothing applied, simply because 10 ms is not very long if there are "relatively long" time gaps between messages?

OTOH maybe much longer than 10 ms could excessively "time smear" quick snappy gestures? Dunno. Just thinking out loud, don't mind me. :)

Post

For adaptive parameter smoothing, I would recommend the “Dynamic Smoothing” filter from the Cytomic technical papers. It works remarkably well. You’ll probably have to tweak the sensitivity and base frequency a bit. I personally use a sensitivity of 0.1 at 2 Hz. I wrote a free implementation here: Smooth.h, Smooth.cpp.

Post

+1 for adaptive, although personally I generally prefer (adaptive) linear interpolation, since it's generally the best value for a given active smoothing time (ie. number of samples before the parameter can be treated as a constant), has no recursive pipeline dependency and allows for a random access. YMMV.

ps. Generally a decent heuristic is to aim to smooth "slightly past the expected next event" when automation is arriving at a reasonably constant rate, although there is a case to be made for using a shorter interval for isolated events with large delta (eg. automation that represents intended steps).

Post Reply

Return to “DSP and Plugin Development”