summaryrefslogtreecommitdiff
path: root/klangfarbrs/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'klangfarbrs/src/lib.rs')
-rw-r--r--klangfarbrs/src/lib.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/klangfarbrs/src/lib.rs b/klangfarbrs/src/lib.rs
index 087cbd7..0fc7936 100644
--- a/klangfarbrs/src/lib.rs
+++ b/klangfarbrs/src/lib.rs
@@ -13,9 +13,10 @@ use gdnative::prelude::*;
use gdnative::core_types::TypedArray;
mod osc;
-use osc::{Osc};
+use osc::Osc;
-mod adsr;
+pub mod adsr;
+use adsr::Envelope;
/// Aliasing some types to distinguish various audio properties.
type Sample = f32;
@@ -184,6 +185,13 @@ impl MonoSynth {
self.fm_depth = fm_depth
}
+ fn envelope(
+ &self, _owner: &Node,
+ attack: Millisecond, decay: Millisecond, sustain: Amplitude, release: Millisecond
+ ) -> Envelope {
+ Envelope::new(attack, decay, sustain, release)
+ }
+
#[export]
pub fn frames(&mut self, _owner: &Node, samples: i32) -> TypedArray<Vector2> {
let mut frames = TypedArray::new();