mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: simplifying timebase
This commit is contained in:
parent
238d307817
commit
b3e6206b08
5 changed files with 50 additions and 89 deletions
|
|
@ -138,8 +138,7 @@ impl Track {
|
|||
if self.reset {
|
||||
all_notes_off(&mut self.midi_out_buf);
|
||||
self.reset = false;
|
||||
}
|
||||
else if reset {
|
||||
} else if reset {
|
||||
all_notes_off(&mut self.midi_out_buf);
|
||||
}
|
||||
// Play from phrase into output buffer
|
||||
|
|
@ -168,7 +167,7 @@ impl Track {
|
|||
}
|
||||
if recording {
|
||||
if let Some(phrase) = phrase {
|
||||
let pulse = timebase.frames_pulses((frame0 + time) as f64) as usize;
|
||||
let pulse = timebase.pulse_to_frame((frame0 + time) as f64) as usize;
|
||||
let pulse = pulse % phrase.length;
|
||||
let pulse = (pulse / quant) * quant;
|
||||
let contains = phrase.notes.contains_key(&pulse);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue