Weird Constructor / Posts / HexoSynth 2022 - Devlog #1 - Getting Back Into The Code

HexoSynth 2022 - Devlog #1 - Getting Back Into The Code

I've put HexoSynth on a break to dive into 3D Printer building, but now I'm getting back into it!

What Is HexoSynth

First of all, what is HexoSynth some of you might wonder. HexoSynth is a modular synthesizer programmed in Rust. It already was quite far, and I was able to make first music like sounding noises with it. Here is a demonstration of the original GUI before I started the complete GUI rewrite:

A little ambient patch

Why Did Development Stall?

I had a problem with the HexoTK GUI implementation at that point. It was consuming way too much CPU (20%) on one core for my taste. I wanted to have more head room in the GUI thread for other stuff, so I had to implement some form of widget caching (to prevent the drawing routines of the more or less complex widgets redrawing everything every frame).

As there was another GUI toolkit written in Rust in the making, namely "Tuix" by @geom3trik, I thought if I really wanted to rewrite HexoTK at this point. I hoped I could pool my efforts with it, in the hope the caching would come for free at some point. It also had a way more sophisticated layout algorithm: "morphorm" and used style sheets for styling the elements.

My rewrite of the GUI logic progressed nicely in the fall of 2021. Here is a video from the Tuix GUI of HexoSynth:

Testing the new quantizer after the GUI rewrite

Tuix was superseded by VIZIA - A declarative GUI library written in Rust. Unfortunately it did not really match the vision I had for the GUI of HexoSynth. I wanted to code the GUI logic in WLambda - Embeddable Scripting Language for Rust, like I had (to some limits) with Tuix. The declarative approach however favors compile time defined GUIs over runtime defined and more dynamic GUIs. That does not mesh well with a scripting language that defines the GUI at runtime like WLambda.

I had to take the plunge I wanted to prevent. I believe it was worth exploring the Tuix/VIZIA route, because I learnt more about how exactly I wanted my GUI logic to work in the end. So I cleared out old code from HexoTK - A graphical user interface toolkit for audio plugins. and rewrote a lot of stuff. I learnt how to use morphorm and how to layout the API in a way that could be easily turned into a WLambda API.

Unfortunately my motivation to work on that project dropped a bit, I was distracted and started to write a block based visual programming language (BlockDSP), that I wanted to use for scripting up DSP routines at runtime. My motivation kind of dropped more, as that undertaking was too big, I was frustrated that it pulled me out of HexoSynth development and also holidays distracted me even more in between.

I found more joy in January/February 2022 in 3D Printing. The rest of that story you can read about in the past articles about the WeirdCube 3D Printer.

Why Did You Restart Development?

The WeirdCube was completed to a point where it works well. There were still a few things to improve upon however. And I believe I will come back to develop it more eventually.

But all the time I was working on the WeirdCube I had that lingering motivation to get back to HexoSynth ASAP. HexoSynth' DSP code was quite well written and worked great. Next to WLambda, it's one of my most solid projects I started in Rust. Also my never dying love for synthesizer music kept reminding me of HexoSynth.

Restarting Development

I had extensive notes of where I left off with HexoTK and HexoSynth. I'm glad I had these notes around, so I could see at a glance what the status was.

I set the first milestone for me for getting back into HexoSynth development: Write a MVP that allows clicking a button that makes a sound. A so called "vertical slice" of all the technologies so to say. I wanted to combine HexoDSP, the HexoSynth boilerplate code, the current state of HexoTK and WLambda to lay the foundation of the new GUI. Luckily my rewrite of HexoTK was quite far already. There are just a few widgets left to port from my Tuix GUI rewrite over to HexoTK.

Anyways, the first prototype was done at the end the weekend:

First WLambda Code for the new HexoSynth GUI
First WLambda Code for the new HexoSynth GUI

A few hours later I successfully integrated the HexoSynth Jack audio driver boilerplate with everything and got something that made a sound using WLambda callbacks controlled by the GUI:

WLambda GUI event callbacks

One day later on Monday now, I was able to quickly get back working HexKnob widgets. Porting code from the Tuix GUI to this new rewrite was a breeze, and I could reuse a lot of stuff:

HexKnobs working again, created in WLambda
HexKnobs working again, created in WLambda

Future Devlogs, Milestones, Prior Art and Motivation

I will try to keep up with the development log articles here. I might not document every tiny step. But larger milestones will certainly be reflected here once I get there. The rough next steps or milestones, maybe not in order, are:

  • Port all of the widgets from my abandoned Tuix GUI to the new HexoTK project.
  • Make a proper WLambda API for implementing the GUI logic.
  • Restore all the HexoSynth the features it had from the very first video on this page.
  • Add a patch management dialog.
  • Restore all the help texts from the old GUI with the WichText widget.
  • Restore the VST2 plugin export and release version 0.1.0-alpha-4.
  • Implement more DSP nodes.

I hope I get there until end of 2022. Future will tell if I do. My personal goal is still to have a big open source modular sound toolbox that is comparable to BitWig's "The Grid", to make all kinds of ambient, experimental and techno music.

I know there is the Bespoke - Modular DAW, and it's basically right in the neighbourhood. But Bespoke is a DAW that was split up into modules. Where a modular synthesizer makes it possible to plug any output into any input. This opens up many many more possibilities to sound design and composition. Bespoke is a bit more limited in that area, as the output and inputs there are typed, any you can't freely plug stuff into each other. But this limitation can also be a strength, as Bespoke makes it easier to compose complete pieces of music and offers more high level modules, that neither HexoSynth, VCV Rack or a real hardware modular synthesizer has.

Of course there is also VCV Rack, but HexoSynth has different performance trade offs, that might make it more efficient to be used from inside a DAW.

HexoSynth is destined to be a plugin that is to be used inside another DAW (like Ardour) as instrument. And also, I want to explore the patch cable less modular synthesizer GUI idea a bit more. On top of that, it is fun for me developing this.


In case you find this project interesting or have questions, you can reach me via Discord these days, check out the #hexosynth channel in the Rust Audio Discord. Optionally I'm also online on IRC (via Matrix) in the Linux Audio Developer channel #lad on Libera.Chat:


Weird Constructor Avatar
Weird Constructor

Nice end 30 y/o guy, geek and F(L)OSS developer that messes with: Linux, Windows, Networking, Interpreters/Compilers, Games, Audio, Music, GUIs, C/C++, Rust, Scheme/Lisp, 3D printing, electronics and more.

For updates follow me on Mastodon

All the F(L)OSS development on my projects happens in my spare time. If you find what I do useful, entertaining or just want to support me, you can do this via Liberapay:

Donate using Liberapay