[sdiy] Smoothing MIDI data

Tom Wiltshire tom at electricdruid.net
Thu Mar 1 13:08:26 CET 2018


I do this too. I tend to use shift-based filters, which means you can only tune the time constant by octaves, but usually there’s a value which works.
Smoothing filters help a lot, since you don’t know when the MIDI data will arrive, and you probably need data at a quicker rate. The filter acts to interpolate between the individual points of MIDI data, and can also provide more resolution, so the output from the filter could be 10-bit or 12-bit rather than just 7-bit. For all these reasons, it’s very useful.

How slow depends on the parameter. MIDI pitch bend is better heavily smoothed. I have a cheap Axiom controller which only sends Pitch Bend at about 50Hz. It’s noticeably steppy if you don’t filter it.

There’s a good discussion of the technique on Stack Exchange:

https://electronics.stackexchange.com/questions/30370/fast-and-memory-efficient-moving-average-calculation

To actually answer your question, with a CV sample output rate of 31.25KHz (which is “fast” as these things go - 5KHz is ok too) I used a full byte shift, equivalent to a coefficient of 1/256. This was fine for the data from both wheels, pitch and mod.

HTH,
Tom

==================

       Electric Druid
Synth & Stompbox DIY
==================

> On 28 Feb 2018, at 18:47, Amos <controlvoltage at gmail.com> wrote:
> 
> often times I'll throw a digital single-pole filter in between the received MIDI value and the sound-engine parameter being updated.  SPFs are pretty cheap and well-behaved, and you can tune the time constant to whatever works/sounds best for your application.
> 
> On Tue, Feb 27, 2018 at 4:56 PM, Bruno Afonso <bafonso at gmail.com> wrote:
> Hi,
> 
> I've been developing a few MPE modules for VCVRack and I'm wondering what do people that develop firmware for hardware synths do when it comes to smoothing midi data, typically 7bit. I guess my question is a bit along the lines of how fast or slow do you move to the new mapped CV voltage. Are there good time constants that empirically work better?
> 
> thanks
> 
> 
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at synth-diy.org
> http://synth-diy.org/mailman/listinfo/synth-diy
> 
> 
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at synth-diy.org
> http://synth-diy.org/mailman/listinfo/synth-diy




More information about the Synth-diy mailing list