flatten monitoring

This commit is contained in:
🪞👃🪞 2024-12-28 23:45:08 +01:00
parent ee2406c1ae
commit 4812012f39

View file

@ -19,7 +19,9 @@ pub trait MidiRecordApi: HasClock + HasPlayPhrase + HasMidiIns {
for input in self.midi_ins_mut().iter() {
for (sample, event, bytes) in parse_midi_input(input.iter(scope)) {
if let LiveEvent::Midi { message, .. } = event {
if self.monitoring() {
midi_buf[sample].push(bytes.to_vec());
}
update_keys(&mut notes_in.write().unwrap(), &message);
}
}
@ -46,12 +48,12 @@ pub trait MidiRecordApi: HasClock + HasPlayPhrase + HasMidiIns {
phrase: &Option<Arc<RwLock<MidiClip>>>,
midi_buf: &mut Vec<Vec<Vec<u8>>>
) {
if let Some(phrase) = phrase {
let sample0 = scope.last_frame_time() as usize;
let start = started.sample.get() as usize;
let recording = self.recording();
let timebase = self.clock().timebase().clone();
let quant = self.clock().quant.get();
if let Some(phrase) = phrase {
let mut phrase = phrase.write().unwrap();
let length = phrase.length;
for input in self.midi_ins_mut().iter() {