Improving the Zynthian MIDI Router

Hi @zynthianers!

I’m currently working on improving the MIDI router, what will add new features and will solve some problems:

Channel Clone: it’s the new method for “layering” sounds while allowing to change volume and other controllers independently. Any MIDI channel can be bond to other channels, what it means that all the note on/off + pitch bending + channel presure messages received by the source channel will be cloned to the bond channels.

Multi-port Architecture: the new MIDI router allows having several input and output ports, that can be configured and routed easily (by code). This will allow to adapt the Zynthian MIDI Router to the new features as we develop it. Initially i’m working in this configuration:

  • Input Ports
    • Main
    • Net
    • Sequencer
    • Control
  • Output Ports
    • Main
    • Net
    • Ch0
    • Ch1
    • Ch15

Every input port is processed depending on a set of flags that can be set independently for each:

  • FLAG_ZMIP_UI => Capture Events for UI
  • FLAG_ZMIP_ZYNCODER => Capture events for Zyncoder Sync.
  • FLAG_ZMIP_CLONE => Enable Clone feature
  • FLAG_ZMIP_FILTER => Enable Rule Filter
  • FLAG_ZMIP_SWAP => Enable Swap Filter (MIDI learning)
  • FLAG_ZMIP_TRANSPOSE => Enable Channel Transposing
  • FLAG_ZMIP_TUNING => Enable Fine Tuning using Pitch Bending

The result can be routed to a list of output ports, that also can be configured for every input port. Output ports have an extra “by-channel” filter that can be set independently for each.

Improve Filter Rule System:

  • Add new events types: NOTE_ON, NOTE_OFF
  • Program Change event name has changed from PG to PC!!!
  • Allow specifying PC number in rules, so you can set rules for specific Prog.Nums.
  • Execute Shell Command Rules
  • More …
  • Lot of bugfixes. I hope SysEx and Clock messages will stop giving problems.

Kind Regards,


Do you need help in the webconf?

Yes, of course!

There are changes in the MIDI rule syntax:

  • PG is now PC
  • PG now supports specifying the program number
  • New NON & NOFF events, specifying the note number (0-127)
  • More …

And there are new features. Give me some days for landing the new code and i will come back to you with the complete tale :wink:


Hi @zynthianers!

You can test the new MIDI Router code by using the development branches. Like this:

cd /zynthian/zyncoder
git fetch
git checkout zmr_multiport
cd /zynthian/zynthian-ui
git fetch
git checkout zmr_multiport
systemctl restart zynthian

For coming back to master:

cd /zynthian/zyncoder
git checkout master
cd /zynthian/zynthian-ui
git checkout master
systemctl restart zynthian

Kind Regards,

1 Like

You can inspect the new multi-port arquitecture login from your Desktop Linux or Mac (with a running X11 server) like this:

ssh -Y root@zynthian.local

And then running:

qjackctl &

You should see something like that:


If someone try the current development branches, you will note that channel 1 is cloned to channels 2 & 3. This is hardcoded for testing until the new “cloning” UI is implemented, very very soon :wink:

As you can see, with this new approach, we can lay several sounds/presets, while keeping the possibility of controlling volume and other parameters independently. Some feedback about it will be very welcome :wink:


Oooohhh. . . . . . . .


I will see how the networking behaves. . .

1 Like

Hi @zynthianers!

I’ve implemented the new “MIDI channel clone” feature in the UI. You will find it as a Layer Option, by “bold-clicking” the layer you want in the layer list screen. The clone setup is saved and restored from snapshots …

If you already are in the development branches, just update software :wink:

P.S: I’m having a lot of fun playing with cloning and transposing … jejeje!!

1 Like

We have qmidinet automatically bonding zynthians!!

  1. start zynthian one

  2. Go into webconf (zynthian.local) and give it a different name :smiley:

  3. start zynthian two
    4 Go into webconf (zynthian.local) and give it a different different name
    5 Plug Network cable between zynths ( or plug in to house network)
    6 zynthian-one.local turn on Enable MIDI over Network
    7 zynthian-two.local turn on Enable MIDI over Network
    8 Press key on zynth-one
    9 Hear sound from zynthian-two

  4. Admire Jofe.


Thanks a lot for your kind words, @wyleu!! :blush:

If you want to get more fun, then you can create 3 layers like that:

  • Layer 1 @ CH#1 => ZynAddSubFX with a nice Arpeggio, like Arpeggio3
    => clone to CH#2 y CH#3

  • Layer 2 @ CH#2 => ZynAddSubFX with something like Collection->Ethereal
    => Transpose +7 (5ª)

  • Layer 3 @ CH#3 => ZynAddSubFX with something like net-wisdom->VangelisC
    => Transpose +10 (7ªminor)

You can try to distribute the layers in different zynthians or create more …


1 Like

Where would you position a MIDI record function for the admin?

Can’t see an obvious way of getting to the Layer Options menu with just a mouse and HDMI interface. . .

With No layers . . .

drawn with dia and exported as png . . .
I’m still looking for a decent flowchart drawer . . . .

What would a simple mapping be for a zynth with no layers but multiple keyboards (USB + MIDI IN) driving a remote(s) zynthians(s)?

How do you un-select a clone?

I will add it to the admin menu when i comeback from muy holidays. Something simple before diving deep in the waters of the MIDI looper/sequencer :wink:

Click “bold” on the controller widget :wink: It’s not intuitive nor elegante, but Zynthian UI is currently designed to be used with the encoders/switch es. Using touch only is quite tricky and not the recommended way. UI should be re-designed for having a decent UX with only touch …

Anyway, with the current approach there is some room for improvements. Proposals and ideas are welcome :wink:


Click it :wink:
Click for selecting, click for unselecting.

But I think we should strive to have the same experience.
Maybe we should support multi-touch only.
2, 3, 4 finger pinch in one of the 4 quadrants to simulate the three kinds of clicks.

But multi-touch gestures don’t seem be supported in tkinter.
What if we track a drag from the outside into on of the quadrants. After you hold X sec, a circle shows. If you release, it means a click. If you hold longer, the circle gets bolder…I guess you got the picture.

I’m thinking from an absolutely minimal test scenario. To be able to test functionality by a minimal abstraction which we could do down a simple MIDI control channel (see wyleu posts passim…) would make testing much more simplified. You could do it from a MIDI sequencer…

Did the Zynth play the test tunes in the right order…?

Multi touch via MIDI looks a bit . . .

  1. Complicated
  2. Buggy
  3. Unlikely to be used . . .
  4. Pointless :smiley:

I meant logically where would it go in the Zynthian MIDI Router …?

I still think a lot of remote zynth’s would be best handled over ssh -X to a central machine unless working that way would put too much strain on the outer zynth’s (Would it I don’t honestly know, althou’ I will cheerfully guess :smiley: )

Who said midi and multi-touch?
I was answering a quote of jofemodo out of the context of midi.

Probably me.

I’ve been having lot’s of chats about testing.

Just been discovered so I’ll try to have read of the C code.
Rotary encoder & switch library for RBPi GPIO (wiringPi). Implements a GPIO emulation layer for development.

1 Like