Files

35 lines
585 B
C++
Raw Permalink 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 <array>
2026-11-14 13:01:54 +06:00
#include "../include/synth.hpp"
2026-11-14 10:23:02 +06:00
class MidiInput{
public:
MidiInput(Synth& synth, Synth& synth2) : synths{&synth, &synth2} {
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;
std::array<Synth*, 2> synths;
2026-11-14 10:23:02 +06:00
uint16_t pitch;
uint8_t mod_wheel;
2026-11-14 10:23:02 +06:00
};
#endif