shizen-components 0.1.1

A better way to create VSTs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use shizen_buffers::audio::{AudioProcessor, Sample};

#[derive(Debug, Default, Clone, Copy, PartialEq, PartialOrd)]
pub struct GainComponent {
    pub gain: f32,
}

impl GainComponent {
    pub const fn new(gain: f32) -> Self {
        Self { gain }
    }
}

impl<const CH: usize> AudioProcessor<CH> for GainComponent {
    fn process_samples(&self, samples: &[Sample; CH]) -> [f32; CH] {
        samples.map(|s| s * self.gain)
    }
}