Close

Coding

A project log for PolyMod 2: modular digital synthesizer

New, improved version of the PolyMod modular digital synthesizer, which was a Hackaday Prize semi-finalist in 2018.

matt-bradshawMatt Bradshaw 09/04/2019 at 09:290 Comments

I've got a simplified version of the proposed final setup working on a breadboard, which is allowing me to do a lot of the necessary coding. The current plan is for the synth to use something like a Teensy LC to handle all the multiplexing etc, while a Teensy 4.0 handles the synthesis. My breadboard version instead uses an Arduino for multiplexing (with two test modules and a single potentiometer for testing), and a Teensy 3.2 for synthesis - this alternative setup is just because I'm abroad right now and am going to wait til I'm home before ordering more Teensy boards.

The coding is proving difficult, but I feel like I'm slowly getting a handle on it. I'm trying to keep everything modular, flexible, readable, and future-proof, so I'm abstracting every possible part of the design into its own class in the code. While the previous version (PolyMod V1) simply had "modules" and "patch cables", the new code has classes for "physical modules", "virtual modules", "physical patch cables", "virtual patch cables" and so on. This should hopefully keep the classes a bit smaller and cleaner, and allow more interesting uses of the polyphonic patching system.

The previous synth's polyphonic mode simply duplicated each module and patch cable four times, which was cool when you were actually doing polyphonic stuff (like playing chords with a keyboard and four oscillators), but it also enforced polyphony into situations where it wasn't needed or wanted. This new approach should be more flexible, and even allow interaction between mono modules, creating the possibility of things like arpeggiator modules, which would have been tricky with the previous codebase.

I'm currently fighting against my limited understanding of pointers and references in C++ (aka Arduino code) - my approach so far has been almost to guess whether I need a pointer or a reference, then let the compiler tell me where I went wrong, but I think I'm at the stage where I should probably go and check out a few tutorials before carrying on...

UPDATE: My problem turned out not to be directly related to pointers/references etc, but, like most bugs, was just down to me doing something simple and stupid (numbering my ports 0,2,3,4 and skipping number 1 for some reason). Everything working again for now!

Discussions