Skip to content

Commit

Permalink
feat(svfmixer): impl parameters in example
Browse files Browse the repository at this point in the history
  • Loading branch information
SolarLiner committed Feb 11, 2024
1 parent 60fd5cf commit 08bb164
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/svfmixer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use nih_plug::buffer::ChannelSamples;
use std::sync::Arc;

use nih_plug::prelude::*;
Expand Down Expand Up @@ -37,6 +38,29 @@ mod extend {
}
}

use crate::dsp::{Dsp, DspInner, DspParam};

mod dsp;

mod extend {
use std::sync::Arc;

use nih_plug::params::FloatParam;

use valib::dsp::parameter::Parameter;

pub trait FloatParamExt {
fn bind_to_parameter(self, param: &Parameter) -> Self;
}

impl FloatParamExt for FloatParam {
fn bind_to_parameter(self, param: &Parameter) -> Self {
let param = param.clone();
self.with_callback(Arc::new(move |value| param.set_value(value)))
}
}
}

const MAX_BUFFER_SIZE: usize = 512;
const OVERSAMPLE: usize = 2;

Expand Down

0 comments on commit 08bb164

Please sign in to comment.