Call for discussion: Encoders via GPIO and/or via USB(Microcontroller)


Hi @ll,

I have read the topic Encoders on MCP23017. Really nice idea and very fancy. This can solve much problems with soundcards != hifiberry…

I also had much talks at Maker-Faire-Berlin last weekend about getting a Zynthian. Most people said that they would like to get a kit, but don’t want to solder any PCB (Yes - most of us know: this is not as complicated as it seems). Also they are afraid about the bunch of connections to make. Altogether it looks more complicated as it might be.

I have been thinking about solving this complexity over the last year: A year ago I tried to use the encoders via Arduino instead of using the GPIO pins of the RPi. I connected the Arduino itself via USB(-serial) to the Zynthian and implemented a small and hacky patch for the zyncoder-library. The code for getting the turn-direction of the encoder was stored in a Arduino sketch. The Arduino was only sending:

  • B1:ON\n (Button 1 pressed)
  • B1:OFF\n (Button 1 released)
  • B3>\n (turning B3 on step to the right)
  • B3<\n (turning B3 on step to the left)

Yes - there is nearly the same problematic like soldering the PCBs - but the input section is more encapsulated and can be created as one module on one PCB. Only one USB cable would be necessary for connecting the whole encoder PCB to the rest. And the Raspi doesn’t need to catch interrupts from the GPIO anymore.

A slightly more enthusiastic approach would be a bidirectional protocol, which supports LCDs… or uses OSC as a (bidirectional) protocol. The absolute nicest way (for me) would be to use a preprogrammed display like a Nextion (this would implicate a complete rewrite of the UI… not really realistic at the moment).

… only my thoughts. What do YOU think? Is it worth to think/talk about this? Perhaps as an addition to the current encoder usage?

Regards, Holger


I am in when development is needed.
And yes, the wiring is too complex for the end user.
If we had a board with knobs connected via USB to your computer, checking out the code, and it would work…nice.
And if everything would work in a browser and we could navigate elements in the browser with the knobs…
Mod-ui and webconf directly on the raspberry screen.


Hello, in my project [Pedal Pi] ( I developed the architecture so that it was possible to add components in order to facilitate the development of new interfaces for control.

There are basically two categories of components: Open components (which basically convert the API to some protocol, such as REST or Serial) and physical components (which allows visualization and control by displays, buttons …).

At the beginning of the project, we had developed a prototype to control the device through an android application. We use ADB to send the serial commands.

I believe that installing an application on a smartphone and connecting it to Raspberry over USB is the simplest way for end users to mount a Zynthian.


Just saw this on eBay. It would be stackable with a DAC and require next to 0 wiring effort.

Edit: not sure if it breaks out the INT pins.


Do we want to declare a maximum number of HAT’s we will put on a Pi ? :fearful:


This is the way I do almost every user panel in my hardware projects.

Even in my home lights control system, the switches and pushbuttons handling is off-loaded to a dedicated uP, that says to the main controller “Pressed pushbutton 1, Switch 2 is on, Double clicked pushbutton 3” and so on…


I think Teensy can handle al the IO and communicate via usb?


Yes, I’m using a teensy for a way more complex midi controller, but honestly for four encoders, nothing more than an MCP23017 is required.

Is the goal to simplify wiring or have more elaborate on box controls?


Thanks to all for answering and letting share their ideas!

Yes - this will be an option. But having to support a software on different smart-phones is absolutely out of my scope :slight_smile: Also I am not sure if this can be really used live on stage.

This should not be a show-stopper. In fact you won’t really use a stack of more than two or three hats. This has side-effects to the cases - perhaps a standard case does not fit anymore. Anyway for my PiSound card the standard case will not fit due to the MIDI connectors on the board.

I think simplify wiring is the way to spread Zynthian over the world. For more controllers there are several additional options (MIDI, uC/USB, …). The goal should be to have a well defined system which is easy to build and use. For me: Fernandos standard design with four encoders, soundcard and a display.

What I have identified in this discussion:

  • Stage/live compatibility?
  • Is compatibility to a case important?
  • Is external hardware needed or should a smartphone/tablet (optional) be used as controller?
  • Is an expansible controller system necessary or only the four /standard) encoders?
  • Is the goal to simplify wiring or have more elaborate on box controls?

The MCP23017-hat seems to be a very nice toy! But you still have to create a set of cables for the encoders and you have to solder the MIDI input opto (also if using a uC for encoder-controlling).

Will a dedicated “all-in-one” PCB the best solution? I have something like a hat in my mind. One PCB with direct soldered encoders and MCP23017 plus MIDI opto. Only one ribbon cable to the Raspi and a cable for the MIDI connector… But one “big” PCB is a limitation for some cases or displays…and how to produce this PCB (Kickstarter?) very much problems… difficult to solve…

Regards, Holger


I’m an electronics engineer and can make a board. I’d avoid the Kickstarter approach since the expectations of backers would be high. If the campaign was a success, then someone could be soldering hundreds of boards. It would be easier to publish the gerber files so people can order boards locally or from China. I haven’t looked into it, but some China manufacturers (like Seeedstudio) offer packages with component sourcing & assembly.

I think that the biggest challenge is defining what is needed. I like the idea of a single PCB with the encoders & other logic on it. But there are many Zynthian variants out there with different screen sizes so having separate encoder boards makes sense.

Making a HID class compliant USB controller is straightforward with the right Arduino (Micro?). But then the USB port would be blocked.

As Johnny Nash sang…“There Are More Questions Than Answers”


The basic interface is built around four encoders and a flat screen, but I would suggest a lower level option.
A pure hifiberry amp or hiberry DAC+ in a hifiberry case with an external USB driven 4 knob box, and an HDMI touch screen.
You loose two usb connectors certainly but the only self build component is the usb connected ( & powered) knob interface box. It separates the interface from the device.

It allows me to place my hifiberry amp on the floor driving the speakers and the USB control interface a usb cable away on the mic stand with a hdmi screen somewhere, I don’t even need it to be touchscreen, loosing only xy control.

Simple, easy to transport to gigs and means you keep Ethernet, HDMI, Power connections and audio signals or speakers off the stage. but give a user an awful lot of power in a very neat contraption.

Plus we have an easy to use approach to the encoder issue that pushes hardware-software crossover into a much less core functionality. The hobbyist is more empowered.

Just thinking . . .


@C0d3man :After reading @beckdac topic about jack2midi … maybe using a game pad like a xbox or PS controller (a standard Item many people have around anyway) as a makeshift easy to use default input device is an great idea! This might help people to get a easy first entrance into the zynthian world.

Of cause that would not be integrated into the case but as soon as someone likes the zynthian that way is open for a more serious approach.


Stop reading my mind! :wink:

This is exactly what I was trying to figure out.


Thank you @beckdac that is a genius idea of yours!

Just great!


The other bonus is that there are a bunch of bluetooth based “joy” devices which would not require any wires or power.


Do we have a MIDI sysex code and suggested protocol for remote control via MIDI?

0xF0 xx

encode 1 left 0x00
encoder 1 right 0x01
encoder 1 switch 0x02

encoder 2 left 0x10
encoder 2 right 0x11
encoder 2 switch 0x12

encode 3 left 0x10
encoder 3 right 0x11
encoder 3 switch 0x12

encoder 4 left 0x10
encoder 4 right 0x11
encoder switch 0x12

sort of thing . . .


Hi all,

I think we have to differ the different approaches. And we should have in mind, what Zynthian should be. My personal point of view:

  • a dedicated music instrument (black box - no idea of what is inside) stable and usable on stage
  • easy to use and build

A game-controller might be a nice thing for controlling - but nothing for a real instrument on stage. Don’t misunderstand: I like the ideas! All ideas mentioned are really good - but IMHO as a 2nd way to control a Zynthian.

So I think there are three groups of interested users (a user might be in more than one group):

  • Musicians
    • wants to use a stable instrument on stage
    • need reliable hardware (and software :wink: )
    • has money :slight_smile:
  • Maker
    • want to tweak the system
    • likes to build from scratch
    • don’t fear solder irons
  • Fun-User
  • likes the idea of open source synth
  • won’t invest much money
  • won’t solder PCBs

And we have currently the following ideas:

  • Standard encoder/MIDI PCBs (as the current ones: solder by yourself)
  • PCBs with preinstalled hardware (e.g. Seeedstudio) and connection via USB
    • uC based (Arduino, Teensy)
      • MIDI compatible (sysex)
      • OSC compatible
      • own protocol
  • Game-controller (PS, XBox, “BT”)

So there should be three ways for building a Zynthian:

  1. Standard controller for Makers
  2. Easy controllers (Game controller) for Fun-Users
  3. Prebuild controllers (uC) for Musicians

For 2.) “only” programming is needed. For 3.) a hardwaredesign and programming is needed.

Ok - stopping here to give time for disassemble my ideas :slight_smile:

Regards, Holger


I think you have missed a group of users.
Roadies or Keyboard Assistants, Assistant Stage Managers, Mixing Engineers … all kinds of names
basically people who are not performing but are technically adept enough to install and operate stage related equipment . . .

wants to use a stable equipment on and off stage
need reliable hardware (and software :wink: )
has No money :slight_smile:
don’t fear solder irons

These people can often be found building the stage kit, mixing the pa, providing foldback mix, panicking on talkback, loading up samples and patches for on-stage musicians, stripping it all down and humping it out at the end of the night…
They are REAL experts on connectors…

They are the real users of swiss army knifes , ( and gaffa tape…)

ON their behalf I would ruthlessly reduce the numbers of cables on stage in any system and beef up the connectors to something you could take on military maneuvers .


==> More or less also makers :wink: perhaps they drink more beer :joy:


It’s the ruggedising that probably differentiates the two:
A Maker knows the idiosyncrasies of their own kit but may not understand the implications of stage use, thank god the Internet never got a picture of the first synth I built :fearful:
The first time I plugged it in on stage it took out the Residual Current Device simply because they were a fairly rare device back then (1979) Earth/Neutral Short, and I knew no better.

I also witnessed an early testing of a drum synth, nice electronics but it lasted about two minutes with a fairly light fingered drummer cos all the mountings were anchored in plastic …

Sorry to bore with nostalgia, but a roadie will point you at use cases that often the musician doesn’t really appreciate.
I still see people turning up at open mic nights with kit in the original cardboard boxes, and wonder why after a couple of wire trips wonder why the input jacks crackle, and who are surprised by quite where the final volume control should be. . .
Also Stage Assistants tend to be the people who play in the effects, click tracks, backing tracks and set up the patches for theatrical performances and I see the zynthian as eminently suitable for that kind of use.

Sound effects for stage performance become so easy with fluidsynth for instance.

I will shut up now . . .