midi ui experiments
This commit is contained in:
+5
-16
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user