The actual amplitude is given within the ‘sec’ statement.
There are some variables that define a constant loudness.
They refer to the usual terms in a score, such as
forte fortissimo = lfff
mezzo piano = lmp
ranging from lppp to lfff.
There are another 12 dB subtracted, presumably to keep the output volume low.
Thank you.
Thus we choose the value of the factor after all to avoid of the saturation.It is thus necessary to think of the following equivalences:lfff = 12 db = …? (peak),
lff = 9.0 dB = 4.0, lf = 6.0 dB = 2.0, lmp = -3.0 dB = …?, lp = -6.0 dB = 0.5,lpp = -9.0 dB = 0.25, lppp = -12 dB = 0.125.
It is right?
Thus, we can write the following code if we want to use the note: [note d4 q lff]
I can write the following code if the most powerful note is: [note d4 q lmp]
(defun note (pitch dur amp )
(scale-db (+ amp 2.99) (osc pitch dur *table*)))
(abs-env
(seq
(note c4 i lp)
(note d4 i lpp)
(note f4 i lpp)
(note g4 i lppp)
(note d4 q lmp)))
I listened to well the audio file generated by this code. There is a problem. Why has your not the impression that it is the last note which is the most powerful? We would almost have the impression that it is the f4. The impression is very different if I write:
(abs-env
(seq
(note c4 i lp)
(note d4 i lpp)
(note f4 i lpp)
(note g4 i lppp)
(note f4 q lmp)))
The fact that there is no value for 0 dB = factor 1 indicates that all those loudness values are relative.
The dB values for MIDI aren’t to be taken seriously. It depends on the machine how the 127 possible values are mapped to a specific volume/loudness/velocity.