Files
osc-vst-gui/include/midi_input.hpp
T

35 lines
585 B
C++
Raw Normal View History

#ifndef MIDIINPUT
#define MIDIINPUT
#include <rtmidi/RtMidi.h>
#include <iostream>
#include <stdexcept>
#include <cstring>
#include <array>
#include "../include/synth.hpp"
class MidiInput{
public:
MidiInput(Synth& synth, Synth& synth2) : synths{&synth, &synth2} {
pitch = 8192;
mod_wheel = 0;
}
void list_ports();
void open_port(unsigned int port);
void read_message();
private:
RtMidiIn midiIn;
std::array<Synth*, 2> synths;
uint16_t pitch;
uint8_t mod_wheel;
};
#endif