midi ui experiments

This commit is contained in:
Sebastian
2024-10-20 01:17:18 +02:00
parent ee8d50fc0a
commit 32462a6574
4 changed files with 65 additions and 58 deletions
+5 -16
View File
@@ -5,11 +5,9 @@
#include "libremidi/observer_configuration.hpp"
#include "raylib.h"
#include <iostream>
#include <map>
#include <memory>
#include <ostream>
#include "datatypes.h"
struct NoteTimer{
int midi_out;
@@ -21,17 +19,6 @@ struct NoteTimer{
bool erase = false;
};
struct MidiOutPort{
libremidi::output_port port;
int number;
bool enabled;
};
struct MidiOut{
libremidi::midi_out out;
};
class Midi {
public:
@@ -63,8 +50,10 @@ class Midi {
void note(int midi_out, int channel, int note, int velocity, int gate){
if(!midi_outs.empty()){
midi_outs[midi_out]->send_message(libremidi::channel_events::note_on(channel, note, velocity));
notes.emplace_back(midi_out, channel, note, velocity, GetTime(), gate);
if(midi_outs[midi_out]->is_port_open()){
midi_outs[midi_out]->send_message(libremidi::channel_events::note_on(channel, note, velocity));
notes.emplace_back(midi_out, channel, note, velocity, GetTime(), gate);
}
}
}