mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
fix time trait usage
This commit is contained in:
parent
dc38fd3d52
commit
799228e366
7 changed files with 36 additions and 47 deletions
|
|
@ -12,8 +12,8 @@ pub const DEFAULT_PPQ: f64 = 96.0;
|
|||
#[derive(Debug, Default)]
|
||||
pub struct TimeUnit(AtomicF64);
|
||||
impl TimeUnit {
|
||||
fn get (&self) -> f64 { self.0.load(Ordering::Relaxed) }
|
||||
fn set (&self, value: f64) { self.0.store(value, Ordering::Relaxed) }
|
||||
pub fn get (&self) -> f64 { self.0.load(Ordering::Relaxed) }
|
||||
pub fn set (&self, value: f64) { self.0.store(value, Ordering::Relaxed) }
|
||||
}
|
||||
/// Temporal resolutions: sample rate, tempo, MIDI pulses per quaver (beat)
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
@ -274,7 +274,7 @@ pub trait LaunchSync {
|
|||
}
|
||||
}
|
||||
/// Something that defines note quantization
|
||||
pub trait Quantize<T> { fn quant (&self) -> &TimeUnit; }
|
||||
pub trait Quantize { fn quant (&self) -> &TimeUnit; }
|
||||
/// (pulses, name), assuming 96 PPQ
|
||||
pub const NOTE_DURATIONS: [(usize, &str);26] = [
|
||||
(1, "1/384"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue