Introduction: MIDI-Controlled Analog Synthesizer

Synthesizers are electronic instruments which can turn notes played on a keyboard into sounds. With these instructions, you can make your very own analog synth which takes input from an electronic keyboard, converts the MIDI data into an analog signal using a Raspberry Pi, and outputs the sound through a headphone jack.

A huge thank you goes out to Moritz Klein for publishing his CD40106 VCO series, which this project is based on. Check him out on Youtube!

Big thank you to Ms. Berbawy and Berbawy Makers, who made this project possible through her Principles of Engineering class!

Supplies

Materials:

  • 1 Large Breadboard (10 holes by 63 holes) and 1 Small Breadboard (10 holes by 30 holes) with adhesive backing
  • Raspberry Pi 3B+ and Power Supply
  • 8 GB MicroSD Card (These do not seem to be available anymore, but a 16 GB one will work just as well)
  • USB-Midi Cable
  • Stereo Headphone Jack Component
  • Adafruit MCP4728 Quad DAC
  • TL074 Quad Op-Amp IC
  • CD40106 Inverting Schmitt Trigger IC
  • 2N3904 NPN Transistor
  • 2N3906 PNP Transistor
  • 1N4148 Signal Diode
  • 0.1 µF Non-polarized Capacitor
  • 5x 0.47 µF Non-polarized Capacitors
  • 4.7kΩ Resistor
  • 5x 100kΩ Resistors
  • 1MΩ Resistor
  • 10kΩ Linear Potentiometer
  • 2x 100kΩ Linear Potentiometers
  • 2x 9V Batteries
  • 2x 9V Battery Clips
  • Solid Core Wire
  • Lead-Free Solder
  • 1/8" Green Edge Acrylic Sheet
  • Velcro with Adhesive Backing
  • Male-to-Male Jumper Wires (recommended)
  • Pre-Cut Jumper Cables (recommended)
  • Yamaha YPT-300 Keyboard (or similar keyboard with MIDI functionality)
  • 8x M3x16 Socket Head Screws
  • 8x M3 Hex Nuts
  • 4x M2x8 Socket Head Screws
  • 4x M2 Hex Nuts

Tools:

  • MicroSD to SD Card Adapter
  • Mouse and Keyboard
  • Wire Cutters
  • Wire Strippers
  • VLS3.5 Universal Laser Cutter
  • Soldering Iron and Fume Extractor
  • Tip Tinner, Solder Sucker, and Sponge (Recommended)
  • Multimeter (recommended)
  • Oscilloscope (recommended)

Step 1: Assemble the Circuit

I used a breadboard for the final design of my circuit because it's easy to add more functionality and fix any mistakes. You will need all the electronic components, a soldering iron, wire cutters, and wire strippers for this step. I used jumper cables for connections within / between the breadboards and solid core wire for connections to the potentiometers and headphone jack. Follow the schematic and use the pictures of my final breadboard as a reference.

After this, test your circuit using an oscilloscope and a pair of headphones. If it doesn't work as intended, turn the potentiometers and test for short circuits using a multimeter. Test all your components and check that there are no unintended or loose connections in the circuit. If both of these do not work, try replacing the ICs.

Step 2: Setup and Program the Raspberry Pi

You will need to flash an SD card with the Raspberry Pi Operating System. Go to raspberrypi.com/software/ using a laptop / PC and download the correct app for your system. Plug in a microSD card using the adapter. Choose "Raspberry Pi 32-bit OS" for the operating system and your microSD for the Storage. Once it installs, set up the Pi using the MicroSD card.

Connect to a valid Wi-Fi network. Open the terminal app and type the following commands:

sudo pip3 install python-rtmidi
sudo pip3 install adafruit-circuitpython-mcp4728

Next, open Thonny. The code is at github.com/abhay-harpalani/analog_synthesizer/tree/main. It uses the rtmidi python library and the Adafruit DAC to convert the digital MIDI signals into an analog voltage. Download this code and paste it in a file in Thonny.

Step 3: Make the Box

I designed a box in Autodesk Fusion 360 and moved the sketches over to Adobe Illustrator by downloading the faces as DXF files. I then used Ms. Berbawy's VLS3.5 Universal laser cutter to make the box from the Illustrator files. Depending on what laser cutter you use, you will need to follow different instructions to cut the parts. It's important to note that there is rastered text, a vector engraved circle around the headphone jack, and cut lines everywhere else. The headphone jack needs the vector engrave to be able to screw it onto the acrylic. I used 3 mm green edge acrylic to create the box.

Step 4: Assemble It All Together

Use 4 M3 screws and nuts to connect the bottom piece to the 4 small joint pieces. Use M2 screws and nuts to screw the Raspberry Pi on. Then, peel off the backing from the breadboards. Attach the batteries clips using the velcro, sticking one side to the bottom and the other to the clips. Screw on the top frame using the remaining M3 screws and nuts. Finally, screw on the potentiometers and headphone jack.

To play the synth, connect the keyboard, headphones, and 2 9V batteries. Start the Python program on the Pi and you will be able to use your synthesizer. Congratulations on completing this project!

Here is a video of the final product working.