summaryrefslogtreecommitdiff
path: root/src/synth/triangle.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/triangle.rs')
-rw-r--r--src/synth/triangle.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/synth/triangle.rs b/src/synth/triangle.rs
index 4f62e4c..19a2296 100644
--- a/src/synth/triangle.rs
+++ b/src/synth/triangle.rs
@@ -27,7 +27,7 @@ impl Generator for Triangle {
self.phase = (self.phase + pvel * (self.buf.len() as f32)) % 1.0;
&self.buf
}
- fn buffer<'a>(&'a self) -> &'a SampleBuffer { &self.buf }
+ fn buffer(&self) -> &SampleBuffer { &self.buf }
fn set_buffer(&mut self, buf: SampleBuffer) -> SampleBuffer {
mem::replace(&mut self.buf, buf)
}
@@ -38,7 +38,7 @@ pub struct TriangleFactory;
impl GeneratorFactory for TriangleFactory {
fn new(&self, params: &mut FactoryParameters) -> Result<GenBox, GenFactoryError> {
Ok(Box::new(Triangle {
- freq: params.remove_param("freq", 0)?.as_gen()?,
+ freq: params.remove_param("freq", 0)?.into_gen()?,
phase: params.get_param("phase", 1, &ParamValue::Float(0.0)).as_f32()?,
buf: SampleBuffer::new(params.env.default_buffer_size),
}))