pedal working checkpoint

This commit is contained in:
2026-01-14 20:49:43 -06:00
parent cf377cf3b0
commit 5661e4662c
2 changed files with 24 additions and 8 deletions

View File

@@ -36,6 +36,15 @@ void Synth::handleNoteEvent(const NoteEvent& event) {
if(event.type == NoteEventType::NoteOn) {
// TODO: this should get fixed if we tie voices to midi notes
// end all voices already playing this note
for(Voice& v : voices_) {
if(v.isActive() && v.note() == event.note) {
v.noteOff();
break;
}
}
// TODO: find quietest voice and assign a note to it instead of just the first inactive one
// find inactive voice and start it with the given note
for(Voice& v : voices_) {
@@ -44,7 +53,6 @@ void Synth::handleNoteEvent(const NoteEvent& event) {
break;
}
}
} else {