Patches to support TG settings using sysex.

pull/287/head
BeZo 3 years ago
parent a1c9ec0e76
commit b13c1f2705
  1. 49
      build.sh
  2. 15
      src/mididevice.cpp

@ -22,34 +22,35 @@ if [ "${RPI}" -gt "1" ]; then
fi fi
# Build circle-stdlib library # Build circle-stdlib library
cd circle-stdlib/ #cd circle-stdlib/
if [ ! -z "${CLEAN}" ] ; then #if [ ! -z "${CLEAN}" ] ; then
make mrproper || true #make mrproper || true
fi #fi
./configure -r ${RPI} --prefix "${TOOLCHAIN_PREFIX}" ${OPTIONS} -o KERNEL_MAX_SIZE=0x400000 #./configure -r ${RPI} --prefix "${TOOLCHAIN_PREFIX}" ${OPTIONS} -o KERNEL_MAX_SIZE=0x400000
make -j #make -j
# Build additional libraries # Build additional libraries
cd libs/circle/addon/display/ #cd libs/circle/addon/display/
if [ ! -z "${CLEAN}" ] ; then #if [ ! -z "${CLEAN}" ] ; then
make clean || true #make clean || true
fi #fi
make -j #make -j
cd ../sensor/ #cd ../sensor/
if [ ! -z "${CLEAN}" ] ; then #if [ ! -z "${CLEAN}" ] ; then
make clean || true #make clean || true
fi #fi
make -j #make -j
cd ../Properties/ #cd ../Properties/
if [ ! -z "${CLEAN}" ] ; then #if [ ! -z "${CLEAN}" ] ; then
make clean || true #make clean || true
fi #fi
make -j #make -j
cd ../../../.. #cd ../../../..
cd .. #cd ..
# Build MiniDexed # Build MiniDexed
echo "Build MiniDexed"
cd src cd src
if [ ! -z "${CLEAN}" ] ; then if [ ! -z "${CLEAN}" ] ; then
make clean || true make clean || true

@ -174,7 +174,6 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
{ {
float32_t nMasterVolume=((pMessage[5] & 0x7c) & ((pMessage[6] & 0x7c) <<7))/(1<<14); float32_t nMasterVolume=((pMessage[5] & 0x7c) & ((pMessage[6] & 0x7c) <<7))/(1<<14);
LOGNOTE("Master volume: %f",nMasterVolume); LOGNOTE("Master volume: %f",nMasterVolume);
printf("Master volume: %f",nMasterVolume);
m_pSynthesizer->setMasterVolume(nMasterVolume); m_pSynthesizer->setMasterVolume(nMasterVolume);
} }
else else
@ -188,7 +187,6 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
if (m_ChannelMap[nTG] == ucSysExChannel || m_ChannelMap[nTG] == OmniMode) if (m_ChannelMap[nTG] == ucSysExChannel || m_ChannelMap[nTG] == OmniMode)
{ {
LOGNOTE("MIDI-SYSEX: channel: %u, len: %u, TG: %u",m_ChannelMap[nTG],nLength,nTG); LOGNOTE("MIDI-SYSEX: channel: %u, len: %u, TG: %u",m_ChannelMap[nTG],nLength,nTG);
printf("MIDI-SYSEX: channel: %lu, len: %lu, TG: %lu\n",m_ChannelMap[nTG],nLength,nTG);
HandleSystemExclusive(pMessage, nLength, nCable, nTG); HandleSystemExclusive(pMessage, nLength, nCable, nTG);
} }
} }
@ -338,9 +336,7 @@ void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nL
sysex_return = m_pSynthesizer->checkSystemExclusive(pMessage, nLength, nTG); sysex_return = m_pSynthesizer->checkSystemExclusive(pMessage, nLength, nTG);
uint8_t instanceID = pMessage[2]&0xF; uint8_t instanceID = pMessage[2]&0xF;
LOGDBG("SYSEX handler return value: %d", sysex_return); LOGDBG("SYSEX handler return value: %d", sysex_return);
printf("SYSEX handler return value: %d\n", sysex_return);
printf("TG %i\n", nTG);
printf("%02X\n", instanceID);
switch (sysex_return) switch (sysex_return)
{ {
case -1: case -1:
@ -433,9 +429,11 @@ void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nL
break; break;
/* BeZo patches */ /* BeZo patches */
case 80: // Set midi channel case 80: // Set midi channel
m_ChannelMap[instanceID] = pMessage[5]; LOGDBG("Set midi channel for TG %i", instanceID);
m_pSynthesizer->SetMIDIChannel(pMessage[5], instanceID);
break; break;
case 81: // Reverb level case 81: // Reverb level
LOGDBG("Set Reverb Level for TG %i", instanceID);
m_pSynthesizer->SetReverbSend (maplong (pMessage[5], 0, 127, 0, 99), instanceID); m_pSynthesizer->SetReverbSend (maplong (pMessage[5], 0, 127, 0, 99), instanceID);
break; break;
case 82: // Compressor toggle case 82: // Compressor toggle
@ -443,6 +441,7 @@ void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nL
case 83: // Transpose case 83: // Transpose
break; break;
case 84: // Detune case 84: // Detune
LOGDBG("Set detune for TG %i", instanceID);
if (pMessage[5] == 0) if (pMessage[5] == 0)
{ {
// "0 to 127, with 0 being no celeste (detune) effect applied at all." // "0 to 127, with 0 being no celeste (detune) effect applied at all."
@ -454,10 +453,12 @@ void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nL
} }
break; break;
case 85: // Panning case 85: // Panning
LOGDBG("Set panning for TG %i", instanceID);
m_pSynthesizer->SetPan(pMessage[5], instanceID); m_pSynthesizer->SetPan(pMessage[5], instanceID);
break; break;
case 86: // Volume case 86: // Volume
m_pSynthesizer->SetVol(pMessage[5], instanceID); LOGDBG("Set volume for TG %i", instanceID);
m_pSynthesizer->SetVolume(pMessage[5], instanceID);
break; break;
case 87: // Pitch Bend case 87: // Pitch Bend
break; break;

Loading…
Cancel
Save