Getting into Eurorack module development
Introduction
I have nothing better to do with my time, so I make electronic music, play it live, and build generative audio-visual experiences for the web (1, 2, 3) and outside of it.
One line of my ongoing research is generating techno tracks semi-randomly.
A toy I built (click oscilloscope for a random preset) was so good to play with that it felt like an instrument. Suddenly, I realised that finally, I had an idea that isn’t big enough to be a standalone instrument but good enough to become a module for a eurorack system.
The plan was born. Build a VCV Rack module first. If it works well with others and is liked by people, build a real thing.
It felt like a great moment to start. I already got my hands dirty with audio programming in Elementary, was able to build DSPs in Faust (so compilable into most of the targets one can imagine, including VCV Rack plugins), and played around with Bela, which felt like an easy way into hardware module development.
Visual Design
I quickly created a design concept in the Sketch app.
After a day or two of the concept refinements, I remembered that actual modules have specific sizes. After looking into it, I also discovered that building a module involves using the components that are actually available.
I spent several hours googling for different kinds of real hardware components and checking if they are also implementable in VCV Rack. I was delighted with the result.
Some hours later, I discovered that the components shouldn’t also cost a fortune and should be simple enough not to implement them in VCV Rack from scratch. This narrowed the choice of tools down to knobs, buttons and three coloured LEDs. At the same time, some feedback from my modular friends started to appear, clarifying my own vision of the module.
At that point, I knew what I was doing and quickly made the design’s last version.
Scaffolding the Project
I cheated and skipped the part about the development environment installation. Let me cover it here.
The official tutorial is a good start. The only thing that didn’t work for me was a compiler arch mismatch, I’m on Mac M1, and VCV is Intel only. Here’s the solution.
The VCV Rack SDK has a python utility to scaffold a project and convert an SVG to a module definition file. The SVG should be produced by Inkscape and have a layer named components with all the interactive elements denoted by circles with different colours of outlines for different types of the components. They will be replaced with the actual controls later by the VCV Rack engine.
Sounds easy? Well, didn’t work, up to the point when VCV Rack was dying. I spent several hours fixing the SVG imported from Sketch into Inkscape. The problem was transformation matrices on SVG elements.
There is an Inkscape extension to fold transformations into the regular SVG attributes called Apply Transforms. It will save you a lot of time and nerve.
My approach now is that everything is ungrouped, top-level, with applied transforms.
Another problem was getting an IDE with autocompletion working. I first tried CLion but couldn’t configure it, so I switched to VS Code, which I use on a daily basis.
There is an excellent tutorial on how to set up the VS Code for VCV Rack. But it’s for Windows. The good thing is there are even fewer steps to do for macOS. The most crucial part is adding VCV Rack SDK as a library for autocomplete to work.
The VS Code plugin for Makefile based C++ projects was kind enough to ask me which arch compiler to use, so everything just worked as expected.
Tweaking the UI
With autocomplete and code navigation working, I just clicked through the names of the scaffolded components, found definitions of the other ones that were a better fit, and used them where they fit well.
Finally, I could see my module in VCV Rack.
Time to make it shine and bleep!
To be continued…