MIDI Velocity, dB, Dynamics, dB% and Differences Table

MIDI Velocity, dB, Dynamics, dB% and Differences Table

   
In this table: Velocity, dB, Dynamics and diff. values are in cross-comparison.

              v············ top2botm ············v 
             +---------------------+------------------------+
             |    real decibels    | SF2 attenuations (144) |
  +----+-----+------+-----+--------+------------------------|
  | *1 |     |      |     |        |cumula-|differ-|reverse |
  |vel.| dyn.|  dB  |dB(%)|diff(dB)| -tive | -ence |  diff. |
  |----+-----+------+-----+--------+-------+-------+--------|
  | 127| fff |   0.0| 100 |     0  |     0 |     0 |   -5.5 |
f | 112| ff  |  -2.2|  86 |  -2.2  |   5.5 |   5.5 |   -6.8 |
  |  96| f   |  -4.9|  71 |  -2.7  |  12.3 |   6.8 |   -7.7 |
  |  80| mf  |  -8.0|  57 |  -3.1  |  20.0 |   7.7 |   -9.8 |
m |....|.....|......|.....|........|.......|.......|........| mezzo(*2)
  |  64| mp  | -11.9|  44 |  -3.9  |  29.8 |   9.8 |  -12.5 |
  |  48| p   | -16.9|  31 |  -5.0  |  42.3 |  12.5 |  -17.5 |
p |  32| pp  | -23.9|  19 |  -7.0  |  59.8 |  17.5 |  -30.2 |
  |  16| ppp | -36.0|   8 | -12.1  |  90.0 |  30.2 |  -54.0 |
  |   0|-off-| -57.6|   0 | -21.6  | 144.0 |  54.0 |      0 |
  +----+-----+------+-----+--------+-------+-------+--------+
     *3                                            ^\ botm /^      
                                                     \2top/ 

* diff. shows the difference between two successive values;
  ordered by top to bottom.



Please note:

  • MIDI velocity (V) values are linear. // n+16
  • dB calculations are logarithmic. // dB = 40 log (V/127)
  • Musical dynamics are average values.



 1 : Because of the "Velocity:0" means "Note-Off" at the same time, there is a difficulty in calculating the dynamic range from 1 to 127.

If this range was 128, the calculation could be very easy. But the maximum value of the 7bit is 127.
We also do not have a chance to reach 128 because we exclude the zero value from the calculation.

So I made a correction on the very top point ("fff" area)


*2 (mid. point): Between the values "mp" and "mf" there is should have (theoretically) an imaginary a "m" (mezzo) value (but not used anywhere). The velocity value of this dynamic is 72 = -10dB =  50% // Notice: The Band-in-a-box software uses 72 as the default velocity value.


*3 (maximums) : 0=off, 1-16 = "ppp", 17-32 = "pp", ... ,  64-79 = "mf", ... , 112-127 = "fff"

to get real "zero" decibel:

  • in MIDI:  master volume: 127, expression: 127
  • in Audio: the master volume of your mixer must be set (tuned) accordingly.



7 comments:

  1. Nice work! I'm wondering specifically what formula did you use to convert from midi velocity (1-127) to dB % column? Does it involve the log40(V/127) formula? Thanks!

    ReplyDelete
    Replies
    1. Yes.
      But for velocity values less than 8, the dB value will decrease to 96dB. I equated 0 with this since the minimum value for 57.6dB. you should actually get 96.2 for a value of 0.5. The soundfont specification says this transition will not be noticeable on a 16-bit system. (The value 144 in the spec must be divided by 2.5. =57.6)

      excel equivalent code:
      =(40*(LOG(velocity/127,10)))
      Where you see velocity there can be a cell reference or a velocity value.

      example1: =(40*(LOG(D49/127,10))) //cell reference
      example1: =(40*(LOG(64/127,10))) //velocity value

      the 10 at the end of the formula represents the base value of LOG (LOG10)

      Delete
    2. Gotcha! So it's 40 * Log10! I mistook it as Log40 at first. So, then to compute the dB % column what formula did you use? Something that figures every 2 or 3 dB reduction sounds like half volume?

      Delete
    3. The question is difficult, the answer is even harder.

      The above formula will produce negative values. because 0 decibel is the maximum value. While doing the calculation, we need to convert this value to absolute value.

      Calculating the percentage is a bit tricky, as the decibel value increases logarithmically (or exponentially).

      Hint: ABS was used to convert a negative value to a positive value.

      excel equivalent code:
      =100/(2^(ABS(dbValue)/10))

      As in the previous MIDI velocity value to dB example, a cell reference or a negative dB value can be used where it says dBvalue.

      Delete
    4. Perfect! Works like a charm! I had forgotten 10dB sounds like half volume in terms of psychoacoustics. Thanks so much.

      Delete
  2. I was wondering where you got the constant of 40 from in this equation?

    ReplyDelete
    Replies
    1. The values in these formulas are predetermined values. There isn't enough room here to describe how it works. But in case you were wondering, You can see the related formula on page 9 of "GM Level 1 Developer Guidelines" of MIDI org's "Complete Midi" book.

      Delete