Monday 19 March 2012

NaV-1 Arduino Soundgin-BabbleBot Synth

Stage One - Building the basic circuit

This post is the beginning of the design diary of the NaV-1 project. If you want to jump right in and build the final hardware go HERE.

In this project we are going to create a custom synthesizer using an Arduino and a Soundgin SSG01 Sound Coprocessor chip. The goal is to end up with a mono-synth that can be controlled with a MIDI keyboard. For lack of a better name, I am calling this project the NaV-1.

In this tutorial, we will simply get the Soundgin wired up, connect it to the Arduino, and send its output to a LM386 amplifier to drive a Line-Level output.

We are going to build this circuit from the ground up as a learning exercise as I find the best way to learn about something is to build it from scratch. If you are simply looking to play around with this chip, you may want to purchase the GinSing Arduino Shield available HERE.

What is a Soundgin / BabbleBot chip?
  
The Soundgin is basically a Microchip PIC18F1320 Microprocessor chip that has been custom programmed to act as a six oscillator sound generator. The oscillators can be played individually or combined through the two on-board mixers to create complex sounds. The chip was originally produced by Savage Innovations but has since been discontinued. Luckily, a company called JT Technology has re-released the chip under the name BabbleBot. If you can't find a Soundgin chip, feel free to substitute a BabbleBot.

Be sure to download and read the Soundgin Datasheet. It is not only a thorough explanation of the chip functions, but also of sound synthesis in general.



HARDWARE

We are going to modify the "PIC to Soundgin" example circuit from the Soundgin Data Sheet as a starting point to get our synth making some noise. First, we'll replace the Speaker output with a Line-Level output to make it compatible with the rest of our music gear. Next, we'll replace the PIC chip with our trusty Arduino board. And since we are going to take +5 volts from the Arduino's regulated power supply we can get rid of the 7805 and it's support components for now. This leaves us with the following circuit.

Click to Enlarge

This is how this circuit works. We are taking +5 Volts from the Arduino board's regulated power supply to drive the circuit. Pins 3 and 4 of the Arduino are used to Transmit and Receive Serial messages to and from the Soundgin. Pin 2 is used to check the Busy status of the Soundgin. There is also a 10 Mhz crystal circuit to drive the Soundgin.

The output of the chip is sent through a 2-Pole Low-Pass Filter made from two 27K resistors and two 10 nF capacitors. This is necessary to filter out high frequency noise that the Soundgin generates.  It is then passed through a 10K pot to allow sound level adjustment.

Finally, the signal is processed by the LM386 amplifier chip to drive the Line-Level output.

This is how the circuit looks on my Breadboard.

Breadboard Hookup

Audio Out Jack

Arduino Hookup


SOFTWARE

Here is a test program that will setup communications between the Arduino and Soundgin and play a repeating C3 square wave note on one of the oscillators. Download the file and upload it to your Arduino. The code is commented so give it a read through. This program will verify that you have a working circuit. If all is well you will hear a pulsing note that is on for 1 second an off for two seconds. Congratulations! You have completed the first step!

The program uses the Arduino SoftwareSerial library to configure pins 3 and 4 of the Arduino as an alternate Serial Port running at 9600 Baud. It uses this new port to transmit and receive serial data to and from the Soundgin chip. The 'patch' function simply sets one of the Soundgin's oscillators to Square Wave mode. Then the main loop sends a C3 note to the oscillator for one second the shuts it off for two seconds. The Arduino on-board LED will also flash for confirmation.

Next time we will add the MIDI control circuitry. See you then!