# decibel to midi velocity

• Dec 19, 2019 - 18:09

Hello,
This is maybe asked before, but is there a way to calculate dB values (unweighted SPL-values) to midi velocity values?
The dB values are however in 'positive' numbers, so not the 'negative' ones we find on level meters for instance. I suppose there should be a reference dB corresponding to the zero reference on the level meter?

While the positive decibel does not have much meaning, we can reverse the value we have.
example (bottom to top):
57.6 - 36 = 21.6
57.6 - 23.9 = 33.7
etc.

``` +----+-----+------+------+-----+
| Vel| Dyn.|   dB |rev.dB|   % |
+----+-----+------+------+-----+
| 127| fff |   0.0| 57.6 | 100 |
| 112| ff  |  -2.2| 55.4 |  86 |
|  96| f   |  -4.9| 52.7 |  71 |
|  80| mf  |  -8.0| 49.6 |  57 |
|  64| mp  | -11.9| 45.7 |  44 |
|  48| p   | -16.9| 40.7 |  31 |
|  32| pp  | -23.9| 33.7 |  19 |
|  16| ppp | -36.0| 21.6 |   8 |
|   0|-off-| -57.6|    0 |   0 |
+----+-----+------+------+-----+```

Decibel values here are the values used in soundfont. It's not a percentage. The percentage is also specified.
I wonder where you want to go with this. So what's the use of positive-decibel? Since the values are logarithmic, I don't think it makes much sense.

Based on the fact that when we use a sample two times in a row in a sound-font, the sound increases by 6dB: we can say that in a sound-font, a sound increases at most 9.6 times (6dB).
6 (dB) * 9.6 = 57.6

We also try not to reach zero decibels for soundfont construction, because if a single instrument's single sound is set to 0 dB, it easily enters peak (square-wave/clip) and distortion occurs when a chord plays.

In reply to by Ziya Mete Demircan

Ok, I understand the limit problem of the 'zero'-reference.
But if you speak of 6dB, isn't this rather sound POWER level, than sound PRESSURE?
I'm not an engineer but isn't the doubling in sound pressure an amount of 3dB?

As far as I know, VU and PPM are taking normal measurements.
PPM has a small attack time and the options you have are only 5 or 10 milliseconds.
"VU", measures non-weighted db-linear scale

cite from Orban:
Note that the VU meter is defined as an averaging meter, which the Orban VU meter is. The average value of a sinewave is 3.9224 dB below its peak value.
By design, when the Orban meter’s VU Meter Gain is set to 0 dB, the VU meter indicates what might be called “equivalent sinewave peak” with respect to digital full-scale.
In other words, a VU Meter Gain setting of 0 dB makes a 0 dBFS sinewave indicate 0 on the VU meter, not –3.994

I'm using Reconstructed Peak.

cite from Orban:
Reconstructed Peak meter’s reading is essentially independent of original material’s sample rate, having a maximum error approximately ± 0.2 dB compared to the true peak output of an ideal D/A converter and reconstruction filter.

I attached the Orban settings I used.

Attachment Size
orbanSetup.png 133.37 KB

In reply to by Ziya Mete Demircan

Actually, I notice you have quite some expertise, and I had a question regarding MIDI-orchestration and dB.
Would it be alright if I send you the question in a private message through the MuseScore-email here?
(It's a rather lengthy question and not necessarily connected to MuseScore)