Files
osc/include/midi_input.hpp
T

34 lines
527 B
C++
Raw Normal View History

2026-11-14 10:23:02 +06:00
#ifndef MIDIINPUT
#define MIDIINPUT
#include <rtmidi/RtMidi.h>
#include <iostream>
#include <stdexcept>
2026-11-14 13:01:54 +06:00
#include <cstring>
#include "../include/synth.hpp"
2026-11-14 10:23:02 +06:00
class MidiInput{
public:
2026-11-14 13:01:54 +06:00
MidiInput(Synth& synth) : synth_(synth){
pitch = 8192;
mod_wheel = 0;
2026-11-14 13:01:54 +06:00
}
2026-11-14 10:23:02 +06:00
void list_ports();
void open_port(unsigned int port);
void read_message();
private:
RtMidiIn midiIn;
2026-11-14 13:01:54 +06:00
Synth& synth_;
2026-11-14 10:23:02 +06:00
uint16_t pitch;
uint8_t mod_wheel;
2026-11-14 10:23:02 +06:00
};
#endif