I can easily calculate volume in db for each instrument if it is below 100. But when volume becomes above 100, it leads to volumes of all other tracks to be decreased. Currently volume of all tracks decreases by same portion: e.g. if I set volume to 130%, all tracks volume becomes 1.3 times smaller. For each track this will mean different number in decibels - depending on db_coef and initial volume, that needs to be decreased (depends on volume_default and volume).
First detect maximum volume overshoot above 100 in decibels.
Now for each track calculate how much volume in db has to be additionally changed based on current volume
Calculation in db domain with unified scale
Use unified db scale for all instruments above 0db. This ensures at least 10 db instrument volume increase, which makes less possible that all instruments have to be decresed in volume
First detect maximum volume overshoot above 100 in decibels.
Now for each track calculate how much volume in db has to be additionally changed based on current volume
I can easily calculate volume in db for each instrument if it is below 100. But when volume becomes above 100, it leads to volumes of all other tracks to be decreased. Currently volume of all tracks decreases by same portion: e.g. if I set volume to 130%, all tracks volume becomes 1.3 times smaller. For each track this will mean different number in decibels - depending on db_coef and initial volume, that needs to be decreased (depends on volume_default and volume).