Sysex patches

pull/287/head
BeZo 3 years ago
parent 44d9c7e432
commit a1c9ec0e76
  1. 3
      .gitignore
  2. 11
      build.sh
  3. 42
      rebuild.sh
  4. 40
      src/mididevice.cpp

3
.gitignore vendored

@ -41,3 +41,6 @@ MiniDexed*
sdcard sdcard
*.zip *.zip
*.img *.img
# Visual Studio artefacts
.vs

@ -3,6 +3,7 @@
set -e set -e
set -x set -x
echo "Clean: ${CLEAN}"
if [ -z "${RPI}" ] ; then if [ -z "${RPI}" ] ; then
echo "\$RPI missing, exting" echo "\$RPI missing, exting"
exit 1 exit 1
@ -22,19 +23,27 @@ fi
# Build circle-stdlib library # Build circle-stdlib library
cd circle-stdlib/ cd circle-stdlib/
if [ ! -z "${CLEAN}" ] ; then
make mrproper || true make mrproper || true
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
make clean || true make clean || true
fi
make -j make -j
cd ../sensor/ cd ../sensor/
if [ ! -z "${CLEAN}" ] ; then
make clean || true make clean || true
fi
make -j make -j
cd ../Properties/ cd ../Properties/
if [ ! -z "${CLEAN}" ] ; then
make clean || true make clean || true
fi
make -j make -j
cd ../../../.. cd ../../../..
@ -42,7 +51,9 @@ cd ..
# Build MiniDexed # Build MiniDexed
cd src cd src
if [ ! -z "${CLEAN}" ] ; then
make clean || true make clean || true
fi
make -j make -j
ls *.img ls *.img
cd .. cd ..

@ -0,0 +1,42 @@
export RPI=3
export CLEAN="true"
export PATH=$(readlink -f ./gcc-*/bin/):$PATH
# Build dependencies and MiniDexed
./build.sh
cp ./src/kernel*.img ./kernels/
if [[ $? -ne 0 ]] ; then
exit
fi
# Get Raspberry Pi boot files
cd ./circle-stdlib/libs/circle/boot
make
if [ "${RPI}" -gt 2 ]
then
make armstub64
fi
cd -
# Make zip that contains Raspberry Pi 4 boot files. The contents can be copied to a FAT32 formatted partition on a microSD card
#cd sdcard
#../getsysex.sh
#cd ..
cp -r ./circle-stdlib/libs/circle/boot/* sdcard
if [[ $? -ne 0 ]] ; then
exit
fi
rm -rf sdcard/config*.txt sdcard/README sdcard/Makefile sdcard/armstub sdcard/COPYING.linux
cp ./src/config.txt ./src/*img sdcard/
if [[ $? -ne 0 ]] ; then
exit
fi
echo "usbspeed=full" > sdcard/cmdline.txt
cd sdcard
cp ../kernels/* . || true
if [[ $? -ne 0 ]] ; then
exit
fi
zip -r ../MiniDexed_$(date +%Y-%m-%d).zip *
cd -

@ -174,6 +174,7 @@ 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
@ -187,6 +188,7 @@ 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);
} }
} }
@ -334,8 +336,11 @@ void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nL
int16_t sysex_return; int16_t sysex_return;
sysex_return = m_pSynthesizer->checkSystemExclusive(pMessage, nLength, nTG); sysex_return = m_pSynthesizer->checkSystemExclusive(pMessage, nLength, nTG);
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:
@ -426,6 +431,39 @@ void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nL
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]);
m_pSynthesizer->setAftertouchTarget(pMessage[5],nTG); m_pSynthesizer->setAftertouchTarget(pMessage[5],nTG);
break; break;
/* BeZo patches */
case 80: // Set midi channel
m_ChannelMap[instanceID] = pMessage[5];
break;
case 81: // Reverb level
m_pSynthesizer->SetReverbSend (maplong (pMessage[5], 0, 127, 0, 99), instanceID);
break;
case 82: // Compressor toggle
break;
case 83: // Transpose
break;
case 84: // Detune
if (pMessage[5] == 0)
{
// "0 to 127, with 0 being no celeste (detune) effect applied at all."
m_pSynthesizer->SetMasterTune (0, instanceID);
}
else
{
m_pSynthesizer->SetMasterTune (maplong (pMessage[5], 1, 127, -99, 99), instanceID);
}
break;
case 85: // Panning
m_pSynthesizer->SetPan(pMessage[5], instanceID);
break;
case 86: // Volume
m_pSynthesizer->SetVol(pMessage[5], instanceID);
break;
case 87: // Pitch Bend
break;
case 88: // Portamento
break;
/* End of BeZo patches */
case 100: case 100:
// load sysex-data into voice memory // load sysex-data into voice memory
LOGDBG("One Voice bulk upload"); LOGDBG("One Voice bulk upload");

Loading…
Cancel
Save