Add deeper simulation of USB midi

This commit is contained in:
John Stäck 2019-06-23 14:30:32 +02:00
parent 2d034b6369
commit 3d38f50d98
6 changed files with 96 additions and 59 deletions

View file

@ -0,0 +1,59 @@
#include <cstdint>
#include <cstdio>
#include "Arduino.h"
/*************************************
* Stub simulation of Teensy usbMidi
*/
void SimUsbMidi::sendNoteOff(uint8_t note, uint8_t velocity, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::noteOff] note %03d vel %03d ch %02d\n", note, velocity, channel);
}
void SimUsbMidi::sendNoteOn(uint8_t note, uint8_t velocity, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::noteOn] note %03d vel %03d ch %02d\n", note, velocity, channel);
}
void SimUsbMidi::sendPolyPressure(uint8_t note, uint8_t pressure, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::polyPressure] note %03d p %03d ch %02d\n", note, pressure, channel);
}
void SimUsbMidi::sendAfterTouchPoly(uint8_t note, uint8_t pressure, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::afterTouchPoly] note %03d p %03d ch %02d\n", note, pressure, channel);
}
void SimUsbMidi::sendControlChange(uint8_t control, uint8_t value, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::controlChange] cc %03d val %03d ch %02d\n", control, value, channel);
}
void SimUsbMidi::sendProgramChange(uint8_t program, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::programChange] prg %03d ch %02d\n", program, channel);
}
void SimUsbMidi::sendAfterTouch(uint8_t pressure, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::afterTouch] p %03d ch %02d\n", pressure, channel);
}
void SimUsbMidi::sendPitchBend(int value, uint8_t channel, uint8_t cable)
{
printf( "[usbMIDI::pitchBend] pb %05d ch %02d\n", value, channel);
}
void SimUsbMidi::sendSysEx(uint16_t length, const uint8_t *data, bool hasTerm, uint8_t cable)
{
}
bool SimUsbMidi::read(uint8_t channel) {
return false;
}