Wednesday 30 July 2014

Background - how I got interested in this sort of thing

Some years ago now I became interested in the hobby of analog music synthesis. My first project was Ray Wilson's "Weird Sound Generator". I did this with a home etched circuit board, didn't really understand much of it but had a lot of fun in the process. It's a great project for beginners. In fact I'm a big fan of Ray's work and highly recommend his MFOS website and his book on Analog Music Synthesizers.

My next step was one of Ray's "Sound Lab Minisynth". Again I hand etched the board based on Ray's PCB artwork. It took a lot of trial and error to get any sound out at all and I learned a lot about how to, and not to, construct synths. Some of the soldering was substandard and the wiring was definitely a mess. The case was a plastic food container with an aluminium faceplate epoxied on.






It was however lots of fun and even though it's never been perfectly in tune and some aspects have never worked, I was thrilled to get some real "synth" sounds out of it.

From this project however I could see that "normalized", self-contained, synths were a little limiting. My next project was to construct a more traditional modular system. This I assembled using modules from various places - some hand etched using Ray's designs, some strip board and a number of PCBs kindly given to me by my friend and colleague Piotr Rotkiewicz  who has an amazing modular system.

My own modular system is a lot more modest:



Still it has all the basics and given the very diverse origin of the modules is likely unique in the world. The large module on the right is a MIDI-CV converter that I constructed using an Arduino and a 10 bit SPI controlled DAC. I do regret that I only thought to build a single oscillator (but three LFOs!) however it's perfectly usable and is musically accurate over four octaves or so. Here's an example of a track produced with it. Apologies to JS Bach.



My current modular project is building one of Ray Wilson's Sound Lab Ultimate and the Ultimate Expander.  These will go in a cabinet that's the same size as my existing modular and should supplement it quite well. This time I actually bought the PCBs and faceplates and it has made the whole thing a lot easier. I have the PCB populated and all the intra-faceplate wiring done and I'm beginning working on the board to faceplate wiring. Trying to keep it as neat as possible.

While I enjoy working on the modular systems and will likely eventually expand to a third cabinet, I had a desire for something a bit more portable. Plus, especially since I don't do a lot of coding now in my day job, I like the idea of a project with a programming component.  I enjoy having two projects on the go at once, it's useful when one gets stuck or just simply when the work is tedious! However I really need to work hard to make sure it's not more than two projects....


A synth that's both mega and mini?

The Basic Idea

Yes, it's pretty much an oxymoron but I was at a loss to think of a better name.  In some later post I will explain my background and how I got interested in this sort of thing. But I want to start simply describing my idea. This blog is mostly for my own documentation purposes but I've been aware for some time that I've benefited from reading about the often painstakingly documented projects of others. Sometimes even a brief mention in a blog or website can be enough to trigger an "ah-ha" moment that is all that's required to resolve some problem in one's own project.

Anyway - the idea. I want to create a hybrid analog/digital music MIDI driven music synthesizer based on an Arduino Mega2560. The Arduino will provide the digitally controlled oscillators, therefore always be in tune unlike many fully analog synths, and will provide the user interface and command and control features. The digital oscillator will drive wave shapers, then there will be more conventional analog voltage controlled filter, a voltage controlled amplifier and envelope generator. The whole system can be described in a block diagram:




OK - that's a lot of lines! But I'm hoping by careful design of the ArduinoMega shields I can minimize wiring and make routing feasible.

Requirements

This is definitely a hobby project rather than anything commercial. As such a lot of the decisions have been primarily made to increase/exercise my skills. The requirements can be summarized as follows:

  • Mostly SMD where possible
  • Not strictly modular in the conventional sense but at least extensible without having to redo the whole thing. 
  • Provide a base for experimentation - it would be good to be able to prototype modules on a breadboard for example. 
  • Small and portable with a single-rail 9v (battery or adapter) supply
  • MIDI input with CC mapping to nearly every adjustable parameter
  • Minimal user interface
  • Not much, if any, wiring (I don't enjoy wires)
  • Programmable via Arduino interface
  • Settings saved to SD card
  • Open source hardware and software

Features

Very Likely:

  • MIDI Input
  • Two DCOs
  • Two LFOs
  • Noise generator (I like noise)
  • Mixer
  • Voltage Controlled Filter
  • Envelope Generator (A/R at least)
  • Voltage controlled amplifier
  • LCD display 
  • Rotary encoders for input

Possible:

  • A third oscillator (The Arduino Mega has 4 16-bit timers)
  • Arpeggiator
  • Some sort of built-in sequencer

Keeping in mind:

  • Software based envelopes, LFOs etc. Might be worth considering a DAC "just in case"
  • Additional 5V voltage regulator to take the load off the Arduino one
  • CV/Gate input?

Inspiration

There are lots of great projects out there and a huge number of enthusiastic analog synth builder who are willing to share their projects and ideas. I'll describe some of my general inspirations in a subsequent post. However there are several projects that I'd like to mention as being especially important (and I'm sure many I don't know about!):

PicSynth - Also from New Zealand! This is a great project and I openly acknowledge taking a lot of the ideas from this. The creator does not release his software but sells pre-programmed Pic chips which is fine because then I'm not tempted to steal his software as well. He has however generously shared his schematics and I'm planning to use the waveshapers, filters, VCA and envelope generators with only small modifications. I really like his hand-drawn faceplates!

Sinneb - This blog hasn't been active for a while but there's some great "problem solving" type explanations and some useful Arduino examples

Audiono - Although this is based on granular synthesis and not very closely related to the current project it did show me how an Arduino could be used to make music. I built one a couple of years ago, added a photo-resistor and linear soft-pot as options to make a Theremin and/or ribbon controller type interface.


Technology

Here's some of the bits and pieces I'm planning on using. Some of these I have no experience with so I'll have to do some initial tests before I commit to them.

Arduino Mega 2560 - When I first thought of this project I had it in mind that I would develop my own board with some sort of AVR processor just for the fun of it. After I thought about it however I realized it might not be that much fun and I'd just be redoing an Arduino anyway. Using a standard Arduino Mega gives me a solid base to work on, with basic power supply, USB connectivity and pin breakout issues all solved. The Mega should have enough pins, likely enough memory and has the required two 16-bit timers to support two oscillators.

2.2" TFT LCD Display with MicroSD card - My initial experiments with this show it seems to work well, is nice and clear and bright and solves two problems (display and storage) at once. Like all AdaFruit products it seems well made and well supported.

RGB illuminated rotary encoder - The RGB part of this might not really be necessary however it will add a bit of glitz and may help with UI cues. The comments section on the product page is not actually that encouraging since it seems a number of people have had problems with them but I'll give them a try and see how they go before I commit. I've used simple rotary encoders in the past with an Arduino and once you get the hang of them they are pretty useful. I've also picked up the clear knobs which work pretty well with these.

MCP4161 Digital Pot - These are a key part of the design if it's to be able to save patches and to avoid having to wire up manual pots. I don't have any experience with these but they seem to be widely used with Arduinos and well supported with a library. I have no idea if 256 resolution steps will suffice but I'll need to experiment

SP3T Digital Switch - Again these are new to me. I have no idea if they will actually work in this context but they seem like what I need for routing signals. Definitely some experimentation required here.