node ui and interaction improvements
This commit is contained in:
+5
-4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user