The Zynthian Emulator

IMPORTANT: Comments are closed in this post, please, use the forum.

Developing software for Zynthian is slighty more complex than developing software for a desktop platform. You need a Zynthian Box (ZBox) over your desk running all the time and connected to the network. You must login by ssh everytime you reboot the ZBox. Every time you want to test your changes, you have to copy the modified files into the ZBox, compile if needed, and run the program from the shell.

zynthian_emuface_control_screenshot

This cycle makes development slower than normal, and although you use scripts and tools to agilize the process, finally you realize that there is a better way ๐Ÿ˜‰

On the other hand, it would be nice if people could try Zynthian easily. Until now, you needed a ZBox to run the Zynthian User Interface (ZUI), and to be honest, currently itโ€™s a little difficult to obtain a ZBox. You have to build it by yourself, spending some time and euros.

The problem is that the ZUI depends on 4 rotary encoders and 4 switches. These elements are physical in the real ZBox, but can be easily emulated by software, so …

I’ve developed a Zynthian Emulator. A standard desktop application (mouse driven GUI) that emulates the 4 rotary encoders and the 4 switches by using standard widgets. The emulator call the ZUI, that is embbeded inside, simulating the look & feel of a real ZBox.

The ZUI doesn’t perceive the difference, and you can play with it in the same way that you play with the real thing. You can test your changes faster and easier, and the development process is improved a lot.

Furthermore, people that want to explore the ZUI, or have a first Zynthian Experience before building its own ZBox, now can do it. Enjoy!!

How does it work?

Well, the secret of the emulation is the new emulation layer added recently to the Zyncoder library. This emulation layer implements the wiringPi API over a virtual GPIO with 15 pins. These virtual pins are simulated using POSIX signals. It uses the 30 signals from SIGRTMIN to SIGRTMAX. Two signals by every pin (ON/OFF).

In that way, when Zynthian UI can’t detect a real GPIO, it uses the emulation layer, awaiting for RT signals that simulate the virtual pins of the virtual GPIO.

Then, you can send this signals from a external program, when a button widget is clicked, or when a rotary control widget is turned.

I know that this method has limitations (only 15 pins) and that the emulation could be better achieved using a more powerful IPC method, some kind of messaging protocol, like OSC. I’ve used this method (signals) by simplicity but i hope to improve it in a near future. By the moment, is enough … and it works like a charm!! ๐Ÿ˜‰

Enlaces:

Facebooktwittergoogle_plusredditmail

10 thoughts on “The Zynthian Emulator”

  1. what are system requirements to your emulator?
    and how do you install it?
    as I have lots of other question and will be building one of your boxes soon. so to try it out and see if i can make it work in my current touring rig.

  2. Hi John!

    + The system requirements are quite basic: A recent Linux distribution with the needed packages and libraries. I’ve tested on Debian (Wheezy and Jessie) and Fedora (21, 22, 23). You will find a raspbian setup script in the repositories:

    https://github.com/zynthian/zynthian-sys/tree/master/scripts

    that you can adapt to your system.

    + The installation procedure is in the README. Please, take a look to the repository:

    https://github.com/zynthian/zynthian-emuface

    Are you interested in mounting Zynthian inside a rack? You are not alone. There is a German guy doing this ๐Ÿ˜‰

    1. Thanks or the info will work on setting this up on my mac in the studio next week. I play midi guitar and have also built a 2 octave set of polyphonic foot pedals. I do not like using a laptop when i tour which means racks of synths and samplers. so hope it can simplify my rig. there are some mods to your unit as I would need balance outs, also how much heat is produced form the unit in a live stage situation should a fan go in the case? The big test is to see if one unit can be used for both pedals and guitar or would I need two units?

      Do you have an email contact information if i have other questions etc..

      thanks

      1. OK! I’m very interested in seen Zynthian Emulator running in a Mac. Please, keep me informed.

        Your setup seems really “special”, it would be a great “test
        environment” for zynthian.

        Zynthian is based in Raspberry Pi, so normally you can run it without fans. Perhaps a “heat dissipator” in the uP could be a good idea to avoid problems in “hard conditions”. I use it in my boxes. Of course, if you want to put a fan, the CPU will be happy with it, but i think you could avoid it

        I’ve tested Zynthian with 2 and 3 keyboards simultaneusly without problems. Of course, if you use very-CPU-intensive engine presets (zynaddsubfx has some presets really heavy!), you will reach the limits. What kind of sounds/synths do you intend to use?

        Also, as you probably know, Raspberry Pi 3 is out, and this give us a 30-40% performance increase. You can (must!) mount zynthian with RBPi3.

        Anyway, if you reach the CPU limits, you can use 2 zynthians

        P.D: Just for curiosity, can you send me a photo of your current rig,
        and your beautiful pedals set? Thanks!!

    1. Sorry, Zynthian is heavily Unix Based (Linux). The Zynthian Emulator uses POSIX signals, that i’m not sure being available in Windows. Also, you will need Jack Audio running, and compile ZynAddSubFX, LinuxSampler and other Synth Engines for Windows. Probably, it’s factible getting Zynthian working in Windows, but for sure, it will be a very hard battle ๐Ÿ˜‰

      Anyway, you can access the Synth Engines native GUIs of a real Zynthian Box using a XWindows Server. I’ve tested in Windwos an Mac without problems.

  3. Just what I’m been looking for! Can Zynthian be able to function as a Drum Sampler/Synth. My idea is to use Drumkv1 however, I need more than a stereo output. This could be adapted to use a USB2.0 audio interface over the HiFiBerry? I have a ESI MEGAPORT HD+ 8 channel adaptor.
    Also I’d like to include a 16 channel drum trigger board which connects directly to the Raspberry Pi hardware to reduce the latency if using a trigger to midi interface. Have a menu to adjust trigger sensitivity, X-talk and threshold. Does this sounds feasible?

    1. Hi Robert!
      Yes, Zynthian can work as a Drum Sampler/Synth. Drumkv1 and others are included in the plugin list of Zynthian Distribution ๐Ÿ˜‰ You can setup your layout as you like with a Carla patch.
      Of course, you can mount your Zynthian using other interface if you like. No problem with it, but the latency will be higher if you use USB interfaces. Zynthian “official” sound device is Hifiberry that connects directly to I2S bus and offers very low latency.
      Currently there is no “trigger sensitivity” option or other drum specific options, but it can be added. It’s an Open Source Project ๐Ÿ˜‰

Comments are closed.