32 lines
473 B
C++
32 lines
473 B
C++
#ifndef MIDIINPUT
|
|
#define MIDIINPUT
|
|
|
|
#include <rtmidi/RtMidi.h>
|
|
#include <iostream>
|
|
#include <stdexcept>
|
|
#include <cstring>
|
|
|
|
#include "../include/synth.hpp"
|
|
|
|
class MidiInput{
|
|
|
|
|
|
public:
|
|
MidiInput(Synth& synth) : synth_(synth){
|
|
pitch = 8192;
|
|
}
|
|
|
|
void list_ports();
|
|
void open_port(unsigned int port);
|
|
void read_message();
|
|
|
|
private:
|
|
RtMidiIn midiIn;
|
|
Synth& synth_;
|
|
|
|
uint16_t pitch;
|
|
|
|
};
|
|
|
|
#endif
|