Add audio nodes to the patch bay
Also make the patch bay responsive.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
//! Uses phase accumulation; bandlimited variants (BLEP/BLAMP) to follow.
|
||||
|
||||
use crate::{AudioProcessor, CVProcessor, config::SampleRate};
|
||||
use crate::descriptor::{ComponentDescriptor, Direction, JackDescriptor, ParamDescriptor, SignalKind};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum Waveform {
|
||||
@@ -26,6 +27,19 @@ impl Vco {
|
||||
Self { waveform, freq_hz, phase: 0.0, sample_rate }
|
||||
}
|
||||
|
||||
pub const DESCRIPTOR: ComponentDescriptor = ComponentDescriptor {
|
||||
kind: "vco",
|
||||
label: "VCO",
|
||||
jacks: &[
|
||||
JackDescriptor { id: "cv_in", label: "CV", direction: Direction::Input, signal: SignalKind::Cv },
|
||||
JackDescriptor { id: "audio_out", label: "Out", direction: Direction::Output, signal: SignalKind::Audio },
|
||||
],
|
||||
params: &[
|
||||
ParamDescriptor { id: "freq_hz", label: "Freq", min: 20.0, max: 20_000.0, default: 440.0, unit: "Hz" },
|
||||
ParamDescriptor { id: "waveform", label: "Wave", min: 0.0, max: 4.0, default: 1.0, unit: "" },
|
||||
],
|
||||
};
|
||||
|
||||
#[inline]
|
||||
fn next_sample(&mut self) -> f32 {
|
||||
let p = self.phase;
|
||||
|
||||
Reference in New Issue
Block a user