9b01cf0480
реализовано: 1. обработка MIDI Pitch Bend 2. управление глубиной вибрато через Mod Wheel (CC1) 3. реализован LFO на основе синусоидальной волны 4. добавлена частотная модуляция голосов с помощью LFO 5. реализовано совместное применение Pitch Bend и Vibrato без взаимного перезаписывания эффектов 6. добавлен пересчет частоты осциллятора с учетом всех множителей
34 lines
527 B
C++
34 lines
527 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;
|
|
mod_wheel = 0;
|
|
}
|
|
|
|
void list_ports();
|
|
void open_port(unsigned int port);
|
|
void read_message();
|
|
|
|
private:
|
|
RtMidiIn midiIn;
|
|
Synth& synth_;
|
|
|
|
uint16_t pitch;
|
|
uint8_t mod_wheel;
|
|
|
|
};
|
|
|
|
#endif
|