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

DSP, Plug-in and Host development discussion.
padillac
KVRian
627 posts since 27 Nov, 2011

Post Thu Nov 12, 2020 2:50 pm

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?

mystran
KVRAF
6108 posts since 12 Feb, 2006 from Helsinki, Finland

Post Thu Nov 12, 2020 5:08 pm

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).
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.

User avatar
Markus Krause
KVRian
775 posts since 2 Jul, 2018

Post Fri Nov 13, 2020 2:50 am

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.
Tone2 Audiosoftware https://www.tone2.com

padillac
KVRian
627 posts since 27 Nov, 2011

Post Sat Nov 14, 2020 12:55 pm

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?

JCJR
KVRAF
3027 posts since 17 Apr, 2005 from S.E. TN

Post Sat Nov 14, 2020 1:47 pm

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. :)

Fire Sledge - Ohm Force
KVRist
121 posts since 2 Nov, 2000 from 404 - Not found

Post Thu Nov 26, 2020 1:54 am

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.

mystran
KVRAF
6108 posts since 12 Feb, 2006 from Helsinki, Finland

Post Thu Nov 26, 2020 2:24 am

+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).
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.

Return to “DSP and Plug-in Development”