Zynthian with MIDI knobs - MODULOX

Hello,

I love Zynthian since a long time, and recently I built and sold a midi modular controller.
https://raspiaudio.com/modulox
I made a 4 knobs controller that would fit perfectly with the Zynthian UI, but unfortunately it seems that the UI knobs can be controlled only through GPIO.
I can send any MIDI signal, like relative ones (the same than turntable controllers), or just 2 notes for left/right, or anything in MIDI, even sysex.
I thought about adding a hack to transform MIDI signal to GPIO INPUT signal, but it seems a little bit complicated. Is there an other way to do that ?
Or is it planned to add MIDI control for UI knobs ?

Thx

Gaétan

Hi @Gaetinox welcome to the community.

Check out this thread for a discussion aroung this subject. The bottom line is that support for external controllers is not baked into Zynthian control at sufficiently low level and some significant changes need to be made to the code to enable this. Although this is desirable it is not currently required to support the official hardware and hence is low urgency. The code that needs to be touched for this is complex (or at least a bit confusing) and critical for Zynthian operation hence the community who want the change has so far failed to advance this. I have taken a look at this many times but it is a lot of pain for limited gain and I have not yet managed to change things.

There is a general agreement that this should be done but finding the time to do it is proving challenging. Even if a community member was willing and able to make the changes it would require substantial effort from core developers and project lead because there are some fundamental design elements that need to be considered and to expoe maximum benefit these decisions need to be considered carefully by core team members.

Sorry - long winded way to say that there is currently limitations on what is possible. You can drive many aspects of Zynthian via MIDI but there are some core elements that you cannot.

OK thanks for the reply. So if it’s too hard to do it inside zynthian code I’ll try the external way. I’m pretty sure it’s possible to write a little C program that intercepts MIDI signal and updates Gpio port file to act as the encoders. Thanks again.

Hi did you have a look on how to control zynthian with midi messages, on the wiki it’s described in the UI user guide.

Yes, I’ve seen that. You can control several things like select UP/DOWN…
I’ve already made a preset for modulox to control that, but I would have liked to control the UI knobs that can do a lot more. It would be the perfect symbiosis between the products. But I’m not afraid, I think with a python script I can do it.
Or at worst, with a little arduino pro micro, it will be easy.

Perhaps that sort of lower level link to the UI could also be used with a recreation of the UI panel in a mobile app that would be updated by compact data messages instead of VNC screen images.

With this little piece of code on arduino pro micro, and pin 2 and 3 plugged on pin A and B of encoder 1 of Zynthian it seems to work.
Now I just have to reproduce that inside the raspberry :woozy_face:

#include “MIDIUSB.h”

void setup() {
// put your setup code here, to run once:
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);

}

void loop() {
midiEventPacket_t rx;
rx = MidiUSB.read();
if (rx.header != 0) {
if(rx.byte1==129) // NoteOn channel 1
{
if(rx.byte2==1) // Note 1 => right
{
digitalWrite(2,LOW);
delay(2);
digitalWrite(3,LOW);
delay(2);
digitalWrite(2,HIGH);
delay(2);
digitalWrite(3,HIGH);
delay(2);
}
if(rx.byte2==2) // Note 2 => left
{
digitalWrite(3,LOW);
delay(2);
digitalWrite(2,LOW);
delay(2);
digitalWrite(3,HIGH);
delay(2);
digitalWrite(2,HIGH);
delay(2);
}
}
}
}