[gmpi] Re: Ramps

  • From: Jeff McClintock <jeffmcc@xxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Tue, 11 Jan 2005 10:04:36 +1300

> I am confused anyway. Smoothed up to what degree? Can
> a plugin trust a host to "smooth enough"? What is
> "smoothed enough"?

This is not voodoo.  This is not subjective.  This is resampling.

Your MIDI CCs arrive at a known rate, perhaps 20Hz.

GMPI controls are sample accurate. Ramps are directly convertible to an audio rate signal. Therefore GMPI ramps are an audio rate signal.

The correct smoothing is equal to the MIDI CC period. (in this case 1/20 = 50ms). No more, no less.

Converting MIDI CC to ramps is upsampling. Sampling theory is well understood. When upsampling, interpolate between samples. Linear interpolation is the simplest method, and translates directly to ramps.

CC's are about 1000 times slower than audio rate, but as an example, lets upsample *2.


Original MIDI CC values: 1 2 3

Good upsampling...
1
1.5
2
2.5
3

Bad alternative, sending CC as 'point' updates. Is equivalent to upsampling by repeating the same sample several times.

Upsampling via 'point' updates... (ramps with duration = 0 )
1
1
2
2
3
3

this is a stair step, the crudest resampling method.


Upsampling to ramps is very straight forward. You don't actualy generate the in-between samples...you generate ramp 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....

50ms is just an example, a GUI for example generates updates at a higher rate e.g. 50Hz. The host adjusts the ramping duration dependant on the control source.

Best Regards,
Jeff



Crudesoft wrote:
At the risk of being silly and all that, but if it is
the host's responsability to smooth events, then why
isn't the requirement more explicit? Why not add
something to req. 25 like "Plugins may expect smoothed
events for their controls." and leave it up to the
plugins to smooth some more if they want to?

I am confused anyway. Smoothed up to what degree? Can
a plugin trust a host to "smooth enough"? What is
"smoothed enough"? Wouldn't a plugin smooth anyway
just to be sure? If so, then this req. doesn't make
anything any simpler and it would probably be better
to simply ditch it. (This has been proposed before,
but I haven't seen an answer.)

Crudesoft



__________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail


----------------------------------------------------------------------
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




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