some sort of ui

This commit is contained in:
2026-04-19 16:20:33 +03:00
parent 4f14980610
commit cdff703f7e
30 changed files with 1504 additions and 184 deletions

38
crates/engine/src/lfo.rs Normal file
View 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
}
}