Wednesday, January 2, 2013

16 Voice MSP430 Synth


Here is my MSP430 launchpad midi synthesizer:


This is a synth with 16 voice of polyphony.
It accepts midi massages from channel 1-8 and 10 (for the drum sounds).
Each midi channel has it's own different settings for:
-MIDI program
-LFO width and speed (CC01 for combined mod wheel control, CC02 for width,CC03 for speed
-Oscillator type (simple with any waveform or with ADSR square or sine wave)
-Pitch bend
-Portamento on/of (CC65)
-Portamento speed (CC05)
-Channel volume (CC07)
It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.

The DAC used is a TI TLC5615, it's not the best choice, but i only had this in my parts bin.
Probably any other SPI DAC could be used with minimal modification, or even PWM.
(I don't sound good with PWM IMO.)
The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.

The crystal is required, because it tunes the DCO on every start up to a pre-defined value
( i ran it at 19Mhz without any problems)
If you change the frequency , you only need to change the bit rate divider for the USCI UART.


There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.

Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.

Here are two songs i recorded with it: https://soundcloud.com/hunyeti/sets/my-msp430-synth-sounds

Here is the schematic:


and a photo how it looks on my breadboard:


the source code can be downloaded from here : The 43oh forum post
There is a contest on 43oh.com, if you like this project pleas vote on me :)
43oh.com Projcet of the month contest

Tuesday, November 20, 2012

The Beginning

Welcome!

I'm starting this blog to tell about my MCU projects.

The first project I'm going to publish is a 16 voice polyphonic synthesizer based on TI's MSP430 Launchpad with the MSP430g2553 chip.
This chip is as far from a DSP as it can be, it has 512bytes of RAM and 16K Flash, running at a maximum of 16Mhz, it's a really bad choice for something like this, I know, but I take this as a challenge.

My aim is to make the cheapest usable,practical MIDI synthesizer EVER!

The final board will include a Microchip MCP4921 DAC, a 16 or 32Mbit serial flash (the exact part is still undecided, and it is optional), and opamp as an anti aliasing filter and an optocoupler for midi input, it's going to be very easy to make since all the parts are available in DIP package.

The flash is an optional part to store high quality drum samples and waveforms.
If you don't really care about the drum sounds and additional waveforms, you can easily leave this part out.

The PWM DAC is a possible, but not really good solution, because : you want to have a sample rate of at least 16Khz, you have to run the PWM at at least 32Khz, at 16Mhz that limits the resolution to 9 bits and at 16 sound that leaves each sound at a 5bit resolution, and a fair bit of PWM noise.

The best solution wound be a 16bit  Delta Sigma DAC , but  almost all of those have an I2S interface, which is impossible to implement, as DMA is require to generate a synchronous bit stream to the Master clock that drives the modulation.

The next best option is the Microchip MCP4921. It is the cheapest 12bit dac with a simple SPI interface and it's also available in a DIP package.
If anyone knows anything better I'm open to suggestions, as the design is not finalized yet.

The 16 Voice polyphony consists of 8 sine/square oscillators, with independent ADSR curves, 4 samplers for drum sounds, and 4 simpler oscillator without ADSR curve but with any waveform.

I try to make it possible the exchange the drum sound to simple oscillators and vice-versa (to have 8 drums channels or 8 simple oscillators).

It can have different patches on 8 midi channels, each of these channels have independent pitch modulation control (speed and depth), pitchbend and portamento, ADSR (if the ADSR oscillator is selected).

The code is fully written in C, it needs commenting to make it readable and there is a lot to optimize.

As soon as i'm ready with the code and the hardware I'm going to release it as fully Open Source.
I recorded some sounds with the synth, you can listen to them here : Soundcloud
Meanwhile if you have any ideas, questions, suggestions, request don't hesitate to contact me!

The Future:

When I finalized this synth I'm going to start making the next version with an Msp430f5510, it's going to have much more features as it has 8x times more memory,56% maximum faster clock and a hardware multiplier.