add preliminary TX81Z SysEx response
- load voice data
This commit is contained in:
parent
38b4d1d39e
commit
2c643aca4c
10 changed files with 237 additions and 4 deletions
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include "taAudio.h"
|
||||
#include "../ta-log.h"
|
||||
|
||||
void TAAudio::setSampleRateChangeCallback(void (*callback)(SampleRateChangeEvent)) {
|
||||
sampleRateChanged=callback;
|
||||
|
|
@ -62,6 +63,7 @@ bool TAMidiIn::gather() {
|
|||
}
|
||||
|
||||
bool TAMidiOut::send(const TAMidiMessage& what) {
|
||||
logE("virtual method TAMidiOut::send() called! this is a bug!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ bool TAMidiInRtMidi::gather() {
|
|||
m.type=msg[0];
|
||||
if (m.type!=TA_MIDI_SYSEX && msg.size()>1) {
|
||||
memcpy(m.data,msg.data()+1,MIN(msg.size()-1,7));
|
||||
} else if (m.type==TA_MIDI_SYSEX) {
|
||||
m.sysExData.reset(new unsigned char[msg.size()]);
|
||||
m.sysExLen=msg.size();
|
||||
logD("got a SysEx of length %ld!",msg.size());
|
||||
memcpy(m.sysExData.get(),msg.data(),msg.size());
|
||||
}
|
||||
queue.push(m);
|
||||
}
|
||||
|
|
@ -105,6 +110,7 @@ bool TAMidiInRtMidi::init() {
|
|||
if (port!=NULL) return true;
|
||||
try {
|
||||
port=new RtMidiIn;
|
||||
port->ignoreTypes(false,true,true);
|
||||
} catch (RtMidiError& e) {
|
||||
logW("could not initialize RtMidi in! %s",e.what());
|
||||
return false;
|
||||
|
|
@ -140,8 +146,18 @@ bool TAMidiOutRtMidi::send(const TAMidiMessage& what) {
|
|||
break;
|
||||
}
|
||||
if (len==0) switch (what.type) {
|
||||
case TA_MIDI_SYSEX: // currently not supported :<
|
||||
return false;
|
||||
case TA_MIDI_SYSEX:
|
||||
if (what.sysExLen<1) {
|
||||
logE("sysExLen is NULL!");
|
||||
return false;
|
||||
}
|
||||
if (what.sysExData.get()==NULL) {
|
||||
logE("sysExData is NULL!");
|
||||
return false;
|
||||
}
|
||||
len=what.sysExLen;
|
||||
port->sendMessage(what.sysExData.get(),len);
|
||||
return true;
|
||||
break;
|
||||
case TA_MIDI_MTC_FRAME:
|
||||
case TA_MIDI_SONG_SELECT:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#ifndef _TAAUDIO_H
|
||||
#define _TAAUDIO_H
|
||||
#include "../ta-utils.h"
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -93,7 +94,7 @@ struct TAMidiMessage {
|
|||
double time;
|
||||
unsigned char type;
|
||||
unsigned char data[7];
|
||||
unsigned char* sysExData;
|
||||
std::shared_ptr<unsigned char[]> sysExData;
|
||||
size_t sysExLen;
|
||||
|
||||
void submitSysEx(std::vector<unsigned char> data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue