Hello, Molive here.

This is a blog post on the Modulin build and stuff. If you’re a bit out of the loop, you should go ask someone who was at Nova 18 about my entry into the Wild Compo. Or read this.


The setup

The idea came of course from the original analouge synth built by Martin Molin of the band Wintergatan. From the Wikipedia disambiguation page, the modulin is “A musical instrument that is a monophonic analogue homebuilt theremin/violin-esque synthesizer.” The main concept is that it’s a synth that sounds kinda soft which is played a bit like a violin whilst on stage. The actual ergonomics of the modulin, as I’ve found, are not very good at this, and so the ability to play like a violin is simply to impress an audience; whilst recording it’s way easier just to lie it on a flat surface.

In order to achieve this Martin used the A100 system by Doepfer, which is a modular synth. It is essentially a modular synth rack turned sideways, with a ribbon sensor and modulation wheels attached, which makes it a lot easier to build than mine. However, this does also mean it costs more than £1000.

I had already know Wintergatan from the marble machine, and had subscribed to thier youtube, when on the 9th of Feburary 2016 they released this video showcasing the modulin playing a song (which is remixed) from Mega Man:

This video shows what the modulin can do, with ever so slightly broken English at the end very quickly explaining what it is. The entire video was meant to be “a very simple sound example for the beginning of the video where i am explaining how the Modulin works”. This video provides most of the base and concept of what the specifications of the modulin I made are, and how I would achieve them. Here’s the video now:

At various places in the video, and with all sound whilst it is playing, the modulin is shown as a stereo synth. This is not correct, as the synth modules itself can’t process more than one input, and so all of the stereo is created after it is input into his laptop, which he has just to his right (off the left of the screen). This makes the modulin seem better than it is in a way, with an echo effect added in post which the actual synth can’t provide.

Towards the end of the video, Martin says “If you want to build a modulin yourself, I have put three suggestions in the description box.” OMG! 😀 Now, of course I, wanting to build a modulin, opened up the description to be greeted by:

Yeah sure you will

…oh
okay.
BTW I retrieved that just now, it’s been over a year and a half since he uploaded the vid and it hasn’t changed, which is a bit disappointing. TBH I only had one idea how to do it, so I have no idea how he’s going to come up with three.

Luckily the good folk of the Youtube comments (the first time anyone has said that) had already started theorising how this could be possible. If you take a look now you’ll find people discussing how to use a beaglebone black, which is a type of small computer I think. It’s just… uh lower… it seems the comments are buried by people liking the small melody at 3:47.


EDIT: After looking through all 1500 comments on the video I cannot actually find the comment I’m about to talk about. I did, however, find this, which confuses me to no end:

tf man


The comment described each wire and panel in detail, explaining what the panel was, what the inputs and outputs were and how they connected to other panels. Using this information I created a sheet of images where all the panels were linked by pencil lines. This helped amazingly whilst writing the software side.


Hardware

The design of the modulin stayed mostly the same during production. The one thing that changed dramatically was the ribbon controller; it started off as a guitar string strung over an aluminium plate, which was somehow supposed to generate resistance. After consulting the UK Demoscene Slack I quickly realised that I wouldn’t work, and Fell recommended I used a VHS tape instead, which did work well. However, in order to make one long enough to make the ribbon worthwhile I couldn’t use it, as it wasn’t stable enough. So, in the end, that was also scrapped.

Eventually I found the youtube channel Antyos, who was also trying to make a modulin. However, they were trying to do it in hardware, using fancy PCBs and stuff. Unfortunately they seem to have stopped after three episodes, which is a shame – I do hope they continue. They linked me to this potentiometer, which is what I used in the final design, along with a 2ft force sensitive resistor. These make up the ribbon section, and take up two ADC pins together. They are joined to the pcb simply by wires.

The rest of the design is split into three parts: the RPI, the PCB and the pots.

The RPI is a Raspberry 3 B mini computer, used because it was the latest model when I bought it. Since then a B+ was released, which is really annoying. The RPI is fitted with heatsinks (for some reason) and an audio injector sound card hat. This allows it to output high quality audio, and takes te audio processing off the CPU, allowing for more DSP. The entire setup is in a small purple case, and is currently held to the board by hot glue.

The PCB is custom made to hold three ADC chips, for converting the input from pots into digital data that the RPI can interpret. It features screw mount terminals to hold the incoming wires, a resistor, two capacitors, a 40 pin male GPIO header for the RPI, an ADS1115 16bit ADC with 4 pins, and two MCP3008 chips which provide 16 10 bit ADC pins. The PCB went through too many revisions until I got it working, and the current revision still requires you short pins 7 and 8 on the bottom. …I’m not good at pcb design :p Luckily Joe from the Swindon Makerspace (which I joined as part of this project) knows loads, and was able to help me complete it. Joe is the best.

The pots are 16 100k potentiometers wired up in a sort of parallel. Each vertical pair of two pots are wired to two rails, one at the top and one at the bottom – one of them is vcc, and one is ground. Each pair is wired to the top and the vcc and gnd of the other chip. This provides proper power to both of them in series, and power to all over 8 parallel circuits. All of the pots are wired into the MCP3008 chips for digital conversion. The pots control the ADSR, distortion, wave type, vibrato, stereo seperation, echo, filter and portamento.

Another element is the two wheels at the front. They provide the modulation and volume controls for the synth, and are the only actual Doepfer brand parts in the entire instrument. They are hooked up in a similar way to the pots, with a hole in the bottom on the instrument for making the wires pass through, except they are hooked into the two remaining pins on the ADS1115.

In the original video you see that at most times there are an insane number of wires spouting from the modulin at any one time, which are probably mains cables with it being a modular synth. In the version I created I wanted it to be entirely portable, in fact in the Nova 18 video there were no external wires whatsoever. In order to acheive this a small 2amp phone charger sits underneath the instrument and behind the user’s shoulder. This allows the pi to be powered for about 2 hours or so straight with no wires attached, except an audio out of course. I managed to use no wires in the final video by telling the pi to record itself, and then syncing up the video and audio in post.


Software

Oh god, do I have to talk about this?

The Pi is running the latest version of Raspbian. The synth is written in Python, using the DSP library PYO. This made the project significantly easier. The entire synth is run over two different cores of the pi – one for reading the inputs and one for the synth. This is designed so that the input reading run asynchronously from the synth and that the DSP is not stopped by the need to read all the inputs.

The synth runs at 32khz as far as I remember. It follows a pipeline as follows:

Note input -> portamento slide -> modulation added -> stereo split -> pitch separation -> vibrato added -> wave table lookup -> correct wave selected -> filter applied -> distortion -> volume vibrato effect -> stereo mixing / panning -> echo/delay calcuation and mixing

I have put some files up on a github.


Other stuff

If I could I would try and get some more of the original functions of the modulin working, as currently things like the ADSR and wave type do not work due to programming errors involving data types. I would also like to try and get the synth to try and start on power up too, which I couldn’t create. One of the biggest problems is that the latency is rather large between the note press and the reacton, which I also could not lower. This is probably due to the use of shared memory.


In conclusion

It went quite well, and I hope you all enjoyed it. I feel I’ve learnt more than I’ve created, like electronics, which I had no skill with before. I’d like to thank the Swindon Makerspace for being really useful, and my dad for doing most (if not all) of the wood and metal work. I’d also like to thank the demoscene for providing such a fun and inviting atmosphere.

~Molive