some sort of ui
This commit is contained in:
38
crates/engine/src/lfo.rs
Normal file
38
crates/engine/src/lfo.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum LfoMode {
|
||||
FreeRun,
|
||||
BpmSync,
|
||||
OneShot,
|
||||
Envelope,
|
||||
}
|
||||
|
||||
pub struct Lfo {
|
||||
pub phase: f32,
|
||||
pub rate: f32,
|
||||
pub depth: f32,
|
||||
pub mode: LfoMode,
|
||||
pub wave_pos: f32,
|
||||
pub sync: bool,
|
||||
sample_rate: f32,
|
||||
}
|
||||
|
||||
impl Lfo {
|
||||
pub fn new(sr: f32) -> Self {
|
||||
Self {
|
||||
phase: 0.0,
|
||||
rate: 1.0,
|
||||
depth: 1.0,
|
||||
mode: LfoMode::FreeRun,
|
||||
wave_pos: 0.0,
|
||||
sync: false,
|
||||
sample_rate: sr,
|
||||
}
|
||||
}
|
||||
pub fn retrigger(&mut self) {
|
||||
self.phase = 0.0;
|
||||
}
|
||||
#[inline]
|
||||
pub fn tick(&mut self, _host_bpm: f32) -> f32 {
|
||||
0.0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user