diff --git a/src/dsp/node_midip.rs b/src/dsp/node_midip.rs index 8fe4c34..bfe8a80 100644 --- a/src/dsp/node_midip.rs +++ b/src/dsp/node_midip.rs @@ -85,8 +85,7 @@ impl DspNode for MidiP { outputs: &mut [ProcBuf], ctx_vals: LedPhaseVals, ) { - let out_i = out_idx::MidiP::freq(); - + let out_i = out_idx::MidiP::gate(); let (freq, r) = outputs.split_at_mut(out_i); let (gate, vel) = r.split_at_mut(1); let freq = &mut freq[0]; diff --git a/src/nodes/note_buffer.rs b/src/nodes/note_buffer.rs index d1c8038..42d847f 100644 --- a/src/nodes/note_buffer.rs +++ b/src/nodes/note_buffer.rs @@ -42,11 +42,18 @@ impl NoteBuffer { } } + #[inline] + pub fn step_to(&mut self, buf_idx: usize) { + while self.buf_idx < (buf_idx % MAX_BLOCK_SIZE) { + self.step(); + } + } + #[inline] pub fn step(&mut self) { let cur = self.buf_idx; let next = (self.buf_idx + 1) % MAX_BLOCK_SIZE; - println!("COPY {}..{} => {}", (cur * 16), ((cur + 1) * 16), next * 16); + //d// println!("COPY {}..{} => {}", (cur * 16), ((cur + 1) * 16), next * 16); self.interleaved_chans.copy_within((cur * 16)..((cur + 1) * 16), next * 16); self.buf_idx = next; }