Files
midi-dj-controller/include/midi_handler.h

24 lines
716 B
C++

#ifndef MIDI_HANDLER_H
#define MIDI_HANDLER_H
#include <Arduino.h>
#include <MIDIUSB.h>
class MIDIHandler {
private:
static void noteOn(byte channel, byte pitch, byte velocity);
static void noteOff(byte channel, byte pitch, byte velocity);
static void controlChange(byte channel, byte control, byte value);
public:
static void init();
static void sendNoteOn(uint8_t note, uint8_t velocity);
static void sendNoteOff(uint8_t note, uint8_t velocity);
static void sendControlChange(uint8_t controller, uint8_t value);
static void processIncomingMIDI();
static void (*onNoteOnCallback)(uint8_t note, uint8_t velocity);
static void (*onNoteOffCallback)(uint8_t note, uint8_t velocity);
};
#endif