Hello there blokas community! I have been on a thrilling (mostly frustrating) ride this past week, trying to get my DXFC midi foot controller to work with MODEP. It only sends program change messages and cannot be reprogrammed, so I had to figure out how to convert MIDI program change to control change messages (which are recognized by MODEP)… Then, once I figured that out, how to make the program converting those messages load automatically when I plug in the pi. Then, once I figured that out, how to prevent the program from crashing OR make it automatically reboot after crashing. This is where I am currently stuck and need support.
I tried out a long list of programs and different possible methods, including midifilter, drumstick midi monitor, puredata, reaper, qtractor, and finally qmidiroute. Trying out these different programs often required me to learn how to install programs and dependencies using cmake or cpan, and was a very steep learning curve for me. After reaching a ton of dead-ends, finally I got it to work perfectly using qmidiroute… The next issue, though, was running qmidiroute automatically on startup/login.
Again I tried a wide variety of methods, including rc.local, init.d, systemd, crontab, and finally .bashrc. For most of these methods I was able to get the script to run on startup/login, but there were various issues with calling the route map file, so I ended up with an empty qmidiroute running on startup (without any of the rules for routing MIDI messages running, so effectively useless). Finally, I was able to get it to work using a ridiculous and haphazard method: editing the .bashrc file to run the command “qmidiroute home/patch/DXFC.qmr” every time I open a new terminal window. Then, I made the file /home/pi/.config/lxsession/LXDE-pi/autostart with the command “x-terminal-emulator” to open a new terminal window at startup. This works (miraculously), but for some reason breaks the desktop environment, so that it’s just a black screen with terminal windows and the qmidiroute gui. This is fine for me, as long as I can reverse it when I need to access the desktop environment again. But now I am having another issue…
For some reason I can’t figure out, qmidiroute crashes occasionally and I lose all of my MIDI message reroutes (thus the foot controller suddenly stops working). I am thinking that there are two ways to resolve this… 1) I could modify the command or script somehow to continuously check if qmidiroute home/patch/DXFC.qmr is running - and if not, to run it again; and 2) I could modify the command/script somehow to have the “qmidiroute home/patch/DXFC.qmr” run repeatedly every x minutes. Method 2) seems like something I could actually figure out, but doesn’t seem ideal because I could end up with qmidiroute crashing and having to wait for it to reboot, or I could end up with a bunch of simultaneous qmidiroutes eating up cpu power. So I am wondering if anyone knows how I could configure option 1), based on the programs and method I described above, that would be amazing. If you have a better method of doing this, that would also be amazing.
Any support would be immensely appreciated, as I have been struggling with this for some time now. I imagine that it would be relevant to many users who have a similar foot controller (that only sends program change messages and cannot be reprogrammed) who need to convert the midi messages. Many thanks in advance!