Right you are, Todor -- I just meant MIDI 1.0, as the DLS specs don't
govern general-case MIDI, only DLS. GM2, and it's spawn SP-MIDI,
also have specified volume curves; maybe others too, I forget...
-- Chris G.
I don't know if this is helpful or not:
There is a MIDI standard for volume. It came belatedly in the form of the DLS standard.
The DLS specification provides a formula for converting a MIDI volume (or velocity for that matter) into dB:
db = 20 * log10((127/midivolume)^2)
This produces a curve that makes good use of the limited 128 step range. It's a formula that was agreed upon because quite a few hardware manufacturers had converged on something close to, if not exactly, this.
In my own work, I use this equation to convert into my internal MIDI message format, which uses floats for everything. Volumes can be added and subtracted in dB land, then converted back at the very end if sent to MIDI equipment.
Todor
-----Original Message----- From: gmpi-bounce@xxxxxxxxxxxxx [mailto:gmpi-bounce@xxxxxxxxxxxxx] On Behalf Of Chris Grigg Sent: Wednesday, June 16, 2004 7:59 PM To: gmpi@xxxxxxxxxxxxx Subject: [gmpi] Re: 3.15 MIDI
Jeff said:Ron said:theI'm not convinced this is achievable. For example, let's considerhave aconversion of MIDI volume controller to GMPI. MIDI volume doesn'tgetstandard mapping from 0-127 to gain values. So how does this valueroundconverted within GMPI? How the does the converted value survive thewe'retrip through a processor that does: MIDI -> GMPI - > [Event Processing] -> GMPI -> MIDI.
All 7 bit controllers get converted like so....
float gmpi_value = (float) midi_cc / 127.0;
.. and converted back like so...
int midi_cc = (int) (gmpi_value * 127.0 + 0.5);
( as usual, i've probley made some terrible coding error, like forgot a semicolon, or rounded down instead of up, but I hope you get the gist)
Don't assume the conversion to GMPI is some over-complicated thing,controllersnot going to convert everything to Angstroms or anything. It's just a converion to floating point.
The intention isn't to reinvent the whole thing, only to givemore resolution by converting to floating point.
I think what Ron meant is, out of 0-127 MIDI CC values, where's the nominal 0 dB point? What midiVolNumber-to-dB-curve is used? MIDI per se doesn't specify either thing, whereas we said GMPI parameters would use natural/perceptual units, so for volume presumably that would be expressed as dB. There is no MIDI-spec-governed conversion between the input and the output, so each plug can decide to do a significantly different thing, so in fact the host doesn't have enough information to make the conversion, contradicting your claim that the conversion is always trivial. You can see the problem.
-- Chris G.
---------------------------------------------------------------------- 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
---------------------------------------------------------------------- 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