Skip to content

Commit

Permalink
Update 0.91_dBConversions_and_GUI.dsp
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaSpanedda authored May 11, 2022
1 parent d70983f commit 60c39e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions 0.91_dBConversions_and_GUI.dsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Il decibel (simbolo ㏈) è la decima parte del bel (simbolo B): 10 ㏈ =
1 B ed è un'unità di misura logaritmica del rapporto fra due grandezze omogenee (di potenze).
Il valore ottenuto da un logaritmo è per definizione un numero puro (adimensionale),
ma vi può essere associata un'unità di misura per indicare la base del logaritmo utilizzato.
Logarithm:
power = number at the base, and result of the number at the base for the power.
EX. power of 4 = log base 4 of 16 (16 = result base 4 to ^ 4).
Expand All @@ -21,14 +20,17 @@ The value obtained from a logarithm is by definition a pure (dimensionless) numb
but a unit of measurement can be associated with it to indicate the base of the logarithm used.
*/

// smooth function (Onepole Filter)
Smooth(G) = *(1-G) : +~*(G);

// Conversions Formula: dB to a linear gain (0-1) and linear to dB
lineartodB(g) = 20.0*log10(max(ma.MIN, g));
dBtolinear(l) = pow(10.0, l/20.0);

// GUI Slider in dB = -80 to 0 dB
SliderdB = hslider("Slider in dB",-80,-80,0,0.001) : si.smoo : dBtolinear
SliderdB = hslider("Slider in dB",-80,-80,0,0.001) : Smooth(0.98) : dBtoline
with{
dBtolinear(G) = pow(10.0, G/20.0);
dBtoline(G) = pow(10.0, G/20.0);
};

process = no.noise*SliderdB <: _,_;
process = no.noise*SliderdB;

0 comments on commit 60c39e6

Please sign in to comment.