[gmpi] Re: Optimal Parameter Smoothing. was Re: Ramps

  • From: Jeff McClintock <jeffmcc@xxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Thu, 13 Jan 2005 07:19:42 +1300

Why should the host turn controllers into ramps? What if your plugin wanted to do it's own parameter smoothing?.
How should you handle smoothing for the two main types of real-time updates? (MIDI and GUI). What is the best smoothing method?
Idealy, we would apply more smoothing to 'slow' parameter updates, and less smoothing to rapid updates.



The two main sources of updates are from MIDI CCs and the plugin GUI. My Roland keyboard sends MIDI controlers at about 20 per second ( 1 every 50ms ). When I move a knob on my on-screen GUI, I get updates every 20ms.


Smoothing is filtering. The best filter for controllers is a Low-Pass filter. You vary the ammount of smoothing by changing the filter's cuttoff frequency. A low cuttoff gives more smoothing, a high cuttoff less.
My friend Mr Nyquist told me the optimim filter cuttoff for perfect smoothing is half the update rate. If the updates are at 100Hz, the filter should be at 50Hz, etc.


MIDI for example...

Update period = 50ms
Freq = 1/Period ...  1 / 0.05 = 20Hz
Filter cuttoff = period/2 (10 Hz)

GUI...

Update period = 20ms
Freq = 1/Period ...  1 / 0.02 = 50Hz
Filter cuttoff = 25 Hz

So, my plugin's going to filter it's parameter updates ( well, mayby not all. At least for important parameters ).
Some updates come from the GUI, others from MIDI. I need the host to indicate for each event, what rate it was generated at. That way, rather than compromise, I can adjust my filter for optimum smoothing at all times.


Example events for optimum smoothing...

Host receives MIDI CC values { 1,2,3.. }, host sends events...

Event 1:
Time:0
End Value: 1
Duration: 50ms

Event 2:
Time:50
End Value: 2
Duration: 50ms

Event 3:
Time:100
End Value: 3
Duration: 50ms

etc....

Hmmmm..those look familiar.

Best Regards,
Jeff










---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: