[basic_gain] m
parent
6941c17f52
commit
b53fa00e86
|
@ -9,5 +9,4 @@ crate-type = ["cdylib"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
baseplug = { git = "https://github.com/wrl/baseplug.git", rev = "9cec68f31cca9c0c7a1448379f75d92bbbc782a8" }
|
baseplug = { git = "https://github.com/wrl/baseplug.git", rev = "9cec68f31cca9c0c7a1448379f75d92bbbc782a8" }
|
||||||
serde = "1.0.126"
|
serde = "1.0.126"
|
||||||
|
utils = { path = "../utils" }
|
||||||
# utils = { path = "../utils" }
|
|
||||||
|
|
|
@ -7,21 +7,15 @@ use serde::{Deserialize, Serialize};
|
||||||
baseplug::model! {
|
baseplug::model! {
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
struct GainModel {
|
struct GainModel {
|
||||||
#[model(min = -90.0, max = 3.0)]
|
#[model(min = 0.0, max = 1.0)]
|
||||||
#[parameter(name = "gain", unit = "Decibels",
|
#[parameter(name = "gain")]
|
||||||
gradient = "Power(0.15)")]
|
gain: f32,
|
||||||
gain: f32
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for GainModel {
|
impl Default for GainModel {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self { gain: 1.0 }
|
||||||
// "gain" is converted from dB to coefficient in the parameter handling code,
|
|
||||||
// so in the model here it's a coeff.
|
|
||||||
// -0dB == 1.0
|
|
||||||
gain: 1.0,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue