aboutsummaryrefslogtreecommitdiffstats
path: root/maximilian.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'maximilian.cpp')
-rw-r--r--maximilian.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/maximilian.cpp b/maximilian.cpp
index 74e4c61..18d3051 100644
--- a/maximilian.cpp
+++ b/maximilian.cpp
@@ -1667,6 +1667,14 @@ int convert::ftom(double frequency) {
return round(12 * log2(frequency/baseFrequency)) + 69;
}
+double convert::atodb(double amplitude) {
+ return 20 * log10(amplitude);
+}
+
+double convert::dbtoa(double decibels) {
+ return pow(10, (decibels * 0.5));
+}
+
template<> void maxiEnvelopeFollower::setAttack(double attackMS) {
attack = pow( 0.01, 1.0 / ( attackMS * maxiSettings::sampleRate * 0.001 ) );
}