Add parameters to audio nodes and rename Delay node to Echo
This commit is contained in:
@@ -865,7 +865,7 @@ impl AudioGraph {
|
||||
"Splitter" => Box::new(SplitterNode::new("Splitter")),
|
||||
"Pan" => Box::new(PanNode::new("Pan")),
|
||||
"Quantizer" => Box::new(QuantizerNode::new("Quantizer")),
|
||||
"Delay" => Box::new(DelayNode::new("Delay")),
|
||||
"Echo" | "Delay" => Box::new(EchoNode::new("Echo")),
|
||||
"Distortion" => Box::new(DistortionNode::new("Distortion")),
|
||||
"Reverb" => Box::new(ReverbNode::new("Reverb")),
|
||||
"Chorus" => Box::new(ChorusNode::new("Chorus")),
|
||||
|
||||
+5
-5
@@ -7,8 +7,8 @@ const PARAM_WET_DRY: u32 = 2;
|
||||
|
||||
const MAX_DELAY_SECONDS: f32 = 2.0;
|
||||
|
||||
/// Stereo delay node with feedback
|
||||
pub struct DelayNode {
|
||||
/// Stereo echo node with feedback
|
||||
pub struct EchoNode {
|
||||
name: String,
|
||||
delay_time: f32, // seconds
|
||||
feedback: f32, // 0.0 to 0.95
|
||||
@@ -26,7 +26,7 @@ pub struct DelayNode {
|
||||
parameters: Vec<Parameter>,
|
||||
}
|
||||
|
||||
impl DelayNode {
|
||||
impl EchoNode {
|
||||
pub fn new(name: impl Into<String>) -> Self {
|
||||
let name = name.into();
|
||||
|
||||
@@ -79,7 +79,7 @@ impl DelayNode {
|
||||
}
|
||||
}
|
||||
|
||||
impl AudioNode for DelayNode {
|
||||
impl AudioNode for EchoNode {
|
||||
fn category(&self) -> NodeCategory {
|
||||
NodeCategory::Effect
|
||||
}
|
||||
@@ -185,7 +185,7 @@ impl AudioNode for DelayNode {
|
||||
}
|
||||
|
||||
fn node_type(&self) -> &str {
|
||||
"Delay"
|
||||
"Echo"
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
@@ -7,7 +7,7 @@ mod bpm_detector;
|
||||
mod chorus;
|
||||
mod compressor;
|
||||
mod constant;
|
||||
mod delay;
|
||||
mod echo;
|
||||
mod distortion;
|
||||
mod envelope_follower;
|
||||
mod eq;
|
||||
@@ -49,7 +49,7 @@ pub use bpm_detector::BpmDetectorNode;
|
||||
pub use chorus::ChorusNode;
|
||||
pub use compressor::CompressorNode;
|
||||
pub use constant::ConstantNode;
|
||||
pub use delay::DelayNode;
|
||||
pub use echo::EchoNode;
|
||||
pub use distortion::DistortionNode;
|
||||
pub use envelope_follower::EnvelopeFollowerNode;
|
||||
pub use eq::EQNode;
|
||||
|
||||
Reference in New Issue
Block a user