Encouraging news guys !!!
In short: the above code “rigkontrol3d.c” does what it says and so after some testing, I was able to assign parameters on MOD Duo from the Rig Kontrol Hardware using the MIDI learn feature !!!
That with the exact same hardware connections described in my first post, the only difference being the PC now runs Linux instead of Windows… Encouraging, don’t you think?
Let me describe the steps involved:
– Plug in the Rig Kontrol Hardware via USB, it is recognized by Linux as an audio interface: you can play mp3 files when selected as audio output , the sound comes out through the output jacks and the leds array VUmeter on hardware reflects the output levels… You can also plug in an instrument and see how the input level indication leds response too : But that is no news, right ? Lets devote to the “MIDI mode” that we want to workaround
– Well, I quickly noticed that pressing the foot switches on the hardware simulated the input of keyboard keys: caracters from “1” to “9” , that you could simply capture with any text editor or web browser if it’s got the focus when you press the switches: That begins to explain some translations seen in the “rigkontrol3d.c” source code: character “1” appears when pressing FootSwitch Nº5, so in the code there is a SWITCH-CASE sentence: CASE KEY_1 —> BUTTON_5 . Got it, lets move on!
–First step, compiled the source and tried to run the binary to lanch the daemon: but it asked for an argument, so went and took a look at the list displayed by file /proc/bus/input/devices to get it : "/dev/input/event13 "
– With a second try and adding that argument, the daemon was up and running, you can see all the terminal commands involved:
– Now configure MIDISnoop to monitor the messages generated by our daemon when pedal and footswitches are being actuated :
– Here the MIDI messages when pressing the switches:
–And now when moving the expresion pedal:
–Now it’s time to close MIDISnoop and capture the MIDI messages with an app that can re-route them to the hardware MIDI-OUT on Rig Kontrol ( sorry, I could not make it with MIDISnoop ) :
– That app is “Virtual MIDI Piano Keyboard” and, as you also can see in the picture above, I could successfully assign the gain control on the ouptut gain plugin to the hardware expresion pedal on Rig Kontrol, using MIDI Learn method on the MOD Duo Web IU : You also can see in the picture I moved the pedal close enough to 0db gain setting, but it only reaches -0.31db or +0.31db , I think because of the scaling and rounding set in source code to produce values between 0 ans 127 ( there is a flag called HIGHRES in the code, that can be changed to achieve more resolution for the expresion pedal message generated, MIDI CC11 ).
– Some last notes: The app vmpk reflects the pedal movements graphically by a knob when selecting “Control:11-Expresion” as seen in the picture, and the “MIDI” LED on the Kontrol Hardware lights every time a MIDI message in sent from Linux through its MIDI OUT jack , to the MIDI-IN jack on the MOD.
–Some things to fix:
Also the pressing of hardware footswiches produces some low octave note sounds ( so low they are not even displayed in the graphical piano keyboard ), which is no surprise since our daemon translates those input events as MIDI Note ON and Note Off messages: This of course should be modified in source code to produce ControlChange MIDI type of messages, in order to use the MIDILearn on Duo to assign the footswitches, right ?
Another good improvement to the code would be to add feedback through the LEDs on each footswitch, but this is not strictly necessary, of course!
Now I think I can just rest and wait for the suggestions of the MOD Team, so the last stage would be to modify the code and run it right on MOD Duo…and finally get rid of the PC