Got first rough prototype of the MidiP node going

This commit is contained in:
Weird Constructor 2022-08-10 22:42:48 +02:00
parent ecd6b53c65
commit 90c948d272
2 changed files with 9 additions and 3 deletions

View file

@ -85,8 +85,7 @@ impl DspNode for MidiP {
outputs: &mut [ProcBuf], outputs: &mut [ProcBuf],
ctx_vals: LedPhaseVals, 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 (freq, r) = outputs.split_at_mut(out_i);
let (gate, vel) = r.split_at_mut(1); let (gate, vel) = r.split_at_mut(1);
let freq = &mut freq[0]; let freq = &mut freq[0];

View file

@ -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] #[inline]
pub fn step(&mut self) { pub fn step(&mut self) {
let cur = self.buf_idx; let cur = self.buf_idx;
let next = (self.buf_idx + 1) % MAX_BLOCK_SIZE; 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.interleaved_chans.copy_within((cur * 16)..((cur + 1) * 16), next * 16);
self.buf_idx = next; self.buf_idx = next;
} }