mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
rudimentary input quantizer
This commit is contained in:
parent
665885f6ff
commit
f6a7cbf38e
8 changed files with 108 additions and 54 deletions
|
|
@ -115,6 +115,7 @@ impl Track {
|
|||
input: MidiIter,
|
||||
timebase: &Arc<Timebase>,
|
||||
playing: Option<TransportState>,
|
||||
quant: usize,
|
||||
panic: bool,
|
||||
scope: &ProcessScope,
|
||||
(frame0, frames): (usize, usize),
|
||||
|
|
@ -158,6 +159,7 @@ impl Track {
|
|||
if let Some(phrase) = phrase {
|
||||
let pulse = timebase.frames_pulses((frame0 + time) as f64) as usize;
|
||||
let pulse = pulse % phrase.length;
|
||||
let pulse = (pulse / quant) * quant;
|
||||
let contains = phrase.notes.contains_key(&pulse);
|
||||
if contains {
|
||||
phrase.notes.get_mut(&pulse).unwrap().push(message.clone());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue