From 5cd14492ea47e306b68be7307b14078509a93aed Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 26 Jan 2022 11:49:32 +0100 Subject: [PATCH] Use the new decibel to gain function --- plugins/gain/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/gain/src/lib.rs b/plugins/gain/src/lib.rs index b40e4034..9228877c 100644 --- a/plugins/gain/src/lib.rs +++ b/plugins/gain/src/lib.rs @@ -20,6 +20,7 @@ extern crate nih_plug; use nih_plug::{ params::{FloatParam, Params, Range}, plugin::{BufferConfig, BusConfig, Plugin}, + util, }; use nih_plug_derive::Params; use std::pin::Pin; @@ -105,8 +106,7 @@ impl Plugin for Gain { }; // TODO: Smoothing - // TODO: Gain to decibel function in a separate module, add a minus infinity check when I do - *sample *= 10.0f32.powf(self.params.gain.value * 0.05); + *sample *= util::db_to_gain(self.params.gain.value); } } }