node ui and interaction improvements

This commit is contained in:
Sebastian
2024-10-27 00:40:57 +02:00
parent cb08f69e3b
commit bd17288ab0
8 changed files with 88 additions and 23 deletions
+5 -4
View File
@@ -86,13 +86,14 @@ class Midi {
void update(){
float time = GetTime();
for(auto it = notes.begin(); it != notes.end(); ++it){
if(time - it->start >= (float)it->gate / 1000.0f){
midi_outs[it->midi_out]->send_message(libremidi::channel_events::note_off(it->channel, it->note, it->velocity));
it->erase = true;
for(auto &n : notes){
if(time - n.start >= (float)n.gate / 1000.0f){
midi_outs[n.midi_out]->send_message(libremidi::channel_events::note_off(n.channel, n.note, n.velocity));
n.erase = true;
}
}
std::erase_if(notes, [](const auto& item){return item.erase;});
for(auto& p : midi_out_ports){
if(p.enabled) {
open_midi_out(&p);