Synth GUI

I started the month with a bit of a break. Given that the full-time job that I have sometimes can be quite demanding, it’s nice to be able to just let go of any expectations you have on yourself when you get home. Even if my hobby projects all are driven by genuine passion, sometimes nothing beats doing nothing.

Synthesizer

I quickly got the itch back though. One thing I have been spending my morning walks to the office thinking about is fun ways to integrate music into a game. And what do you need to make music? An instrument! This lead me into exploring software synthesizers. This was a fun project, I (re-)learned some signal analysis, I learned about pulseaudio, read up on the WAV file format, and I even learned about the fun stuff you can do with a terminal.

GUI

Another thing I learned is that a synthesizer is no fun without the knobs. You want to hear the sound change as you turn a knob, and this was hard to capture through the terminal. This pulled me into my next adventure, GUI! I’ve used a lot of Dear ImGui in the past and it’s great! I contemplated using it here as well, but I needed something way simpler and to be honest, I got curious… So I started prototyping my own immediate GUI library.

Early widgets

Screenshot above is an early iteration. I got simple text rendering working and imlemented some common widgets and of course, knobs. It’s not fancy, it’s not fast, but it actually renders correctly and the input works!

Synth keys

Given that I want to use the GUI for a synth, I also implemented actual keys. Don’t mind the missing #.

Synth GUI

In the end I actually got something that I think might be useful. It has not been hooked up to anything yet but the library is simple enough to use, just some final tweaks then I will try to implement it with the synth. I’m working on packaging this library and the underlying Vulkan wrapper to make it available on github. This is mainly to make me able to still keep the synth repo open, but more on that in a later post.

Codex

I also tried out Codex for the first time. In general I’ve been underwhelmed by AI tools. I use ChatGPT every now and then to get a second opinion and the thinking models are actually good for finding references. But other tools, such as Github Copilot and Cursor have mostly been annoying. I installed Codex CLI and got impressed how smooth it was to get running. It immediately started chugging along on the first task I gave it. It checked compile errors, it ran tests, and produced actual functioning code.

It was not all great though, as complexity grew it required a lot more handholding and it frequently got stuck in “Fix A, Break B -> Fix B, Break A”-type loops. You also get a bit lazy. Initially I had such a flow with the prototyping that I didn’t even check the produced code but when I did I realized I’ll have to rewrite large portions of it. One fun example was a text renderer it wrote, it had a comptime function that translated every character in a string into actual draw calls, and it created one draw call for every pixel in the character…

Voxels

Voxels

I didn’t completely forget about the voxels. I’ve been working a bit on setting up a sandbox for prototyping. It was a bit tiresome having to rewrite certain game systems every time I wanted to prototype a new idea for the voxels, so I ripped out the rendering part of it. Now I can more quickly prototype and profile some ideas I have.

What’s next

In order of level of commitment:

  • Package and release the GUI + Vulkan backend.
  • Actually hook up GUI with the synth.
  • Put GUI into game.
  • Back to voxels.