Great big shield! (arduino synth)

I just got my new boards in!

I guess it could be called a shield, it has an arduino attached :slight_smile:

This is a single board version of this mess. which will be mounted on a modular synth panel.

The arduino is a 4 oscillator phase accumulator, and does a few other things.

each oscillator has a separate DAC which are mixed in the analog realm (controlling an 8 bit DAC level with another 8 bit signal gives a lot better resolution than changing its level digitally)

The levels of the DACs are controlled VIA PWM > 4 pole filter > Vref. and then the DAC output is level converted to +- rather then +

Each pair of DACs has another 4 pole filter on the output to eliminate any aliasing.

And yet another 4 pole filter on an aux envelope out.

There are 2 Multiplexers (completely copied from the mux shield) which get the values for 32 potentiometers which control various modulation and wavetable selection etc.

There are no voltage controlled filters on board, but it can output envelopes and triggers for modular synth filters/analog envelope generators

And 2 inputs for external control voltages through a special ADA4091-2 op amp which can take +_25v over the rail input, and being powered by the arduino power, it automagically protects the inputs from the higher voltages existing in a modular synth (+- 15v)

I am planning to make a cut down version which would fit on a proper shield, but i still need to experiment a bit (especially trying to make a nice sounding 5 volt voltage controlled filter!) but it will still have to be a mega.

I will continue posting as it is built and tested along the way.
so far i attached the arduino and made sure the signals and power are going to all the proper places.


Very impressive!

Help me out though: What is meant by "phase accumulator"? What exactly is the Arduino doing in this application?

Nice work!


the phase accumulator is clocked by a fixed frequency master clock (an ISR) and with each cycle increments the phase angle by an amount which determines the frequency (pitch)

In this case when a MIDI note arrives there is a lookup table which tells it the basic amount to add each cycle. that is modified by things like detuning and pitch glide etc.

the phase accumulator is a long int, and it is bit reduced to 8 bits to determine what address of the ROM wavetable is selected. that automagically does the required rounding without any additional work.

(there is a version with internal wavetables as well, but i decided to use an external ROM because it takes too long to download all the tables everytime i change the sketch (and i have 1024 waves instead of 16)

each wave has 256 values which are only all used once at exactly one particular note (F2 if i remember right)
at higher frequencies some of the samples will be missed out to get it to play fast enough, and at lower frequencies some of them can get played twice.

the accumulator (naively in arduino) rolls over when it gets past the highest possible value, so it is like a "free running" oscillator.

I hope some of that made a bit of sense. :stuck_out_tongue:

I'm impressed. Entirely. How long/how much money did it take you to do this? What did you design the PCB in? How did you manufacture it--Fab house? Well put together video by the way.

Oh, ok, I think I understand completely. So each voice can be running through the same wavetable at independent indexes and rates, right?

How did you extrapolate the source wavetable data in the first place?


I have been working on this bit by bit over quite a while on breadboards, and with a few home made toner transfer boards.

Then i decided to build a modular synthesizer for my studio with some bought and some DIY modules (there will be a couple more arduino ones as well). and decided to use this as an oscillator, as well as a more traditional analog.

I have bought a few ICs, and other components for it but none of them are very rare or expensive.

This board was made with ExpressPCB. I had 4 of them made, and each one also has 4 header boards (they go between the MUX and the potentiometer boards) and an extra tiny 4 pole filter board which i put there because my friend wants a subwoofer crossover.

The little boards have to be cut off, but i rigged my lathe with a small slitting saw to make accurate cuts.(the one in the pic already has that part removed)

That is correct except with modulation, each voice can be playing a different wavetable depending on velocity, envelope, accent, randome, notenumber, Midi clock, and whetever else i can think of.

It is not 4 voice polyphonic (it could be with a different sketch) this version is "4 oscillator monophonic, with 303 type linear glide". it is designed to be a bass voice with a lot of expression available.

The wavetables are arranged in 64 sets of 16 evolving sets, in a simple non modulated voice it could scan from the first wave to the last one in a set as time progresses after a note is played. because there are only 16 waves per set, it can do a bit of semi random (lookup table actually) granular mixing to make the transition smoother and longer. (or deliberately not!)

The wavetables themselves came from various sources. some are home made, some came from PPG wave, avrx, waldorf and wiard, and various other places i could find any :slight_smile:

RE: 4 oscillator monophonic: That would explain why it sounds so rich and fat. Wonderful!

By any chance, do you have any affiliation with Analogue Haven?

I am so gratified to see someone doing more sophisticated musical applications with the Arduino. Please keep us posted as this thing develops!

I myself just finished an unconventional synth application with a Mega (nicely polished, but admittedly nowhere near as deeply technical as what you're doing) and will introduce it here as soon as I can get some halfway decent audio/video demos made up, probably next week.

Rock on!

Thanks for the positive responses everyone! i wonder if the anti arduino folks at hack a day will say this is "a waste of a microcontroller"

I think analogue haven would tar and feather me for making this and putting it in a modular synth :slight_smile:

for anyone who is interested the original code i based the phase accumulator on it is here.

a slightly old version of the synth code is here (a few changes since then this was current around the time the youtube video was made.) and its not called "aciduino" its called "scarab"

I have set up the opto isolator MIDI input now, it is working,
i just edited the sketch to serial.print any MIDI it recieves, so I could test it without the rest of the circuit there.

I will just add sections bit by bit and test them. thats one of the reasons why using an arduino is so good, i can modify the code for testing the circuitry.

The next stage to build will be the "pwm envelope filter" which takes PWM outputs to send to the DACs vref, which works as a voltage controlled amplifier. this filter is important to give the sound the right character, too low a frequency and the attack of the notes will be sluggish, too high and there will be a click as the level is suddenly increased.

If you look at "pwm envelope filter" section on the first pic you can see a lot of extra holes, that is because previously i was just using a 1 pole resistor/capacitor filter and some of the pwm noise would escape in to the DACs vref and cause a little noise. If i made the filter too low then the response was sluggish, (1 pole filter just does not cut it!) thats why i went with a proper 4 pole active filter. (this filter is Salen-key Bessel filter in case anyone cares)

I can put some headers on there so i can experiment with different filter frequencies, theoretically the design i did (on Ti filter designer) should give me a fast enough envelope time but i left it open for tweaking. once i am happy i just solder the proper value in next to the header.

some construction

Now i am waiting for a part i stupidly forgot to order for the power supply, which i need to test the filter. :stuck_out_tongue:


Man, that is some serious fab work going on there!

Can hardly wait to see/hear the finished product!

Here is something.

I found these wood frame things someone threw out. dovetailed solid oak!

It so happens that the height is just right for 2 modular units as well.

this will stand up when it is finished, its a good size for me to test things with just a few other modules. I put the aluminum bar across, and those bolts will be to hold the modules in place without using wood screws.

did some testing :slight_smile:
I have built everything except the control voltage input, which i cant really test until i get more modules anyways.

And I have to make a nice panel and cut the pot shafts a bit to fit the knobs on (not looking forward to that but)

Eeeeeexcellent! Super nice video work too!

I am porting this code to work on a "midivox" shield. it will have a few less features, but i should be able to squeeze most of it in there. (back to onboard wavetables as well).

Ill try and keep the controls down to 16, because most of the cheapo MIDI controllers have 16 knobs on them.

then you can have an accurately tuned cool sounding wavetable synth oscillator with 12 bit output for just the price of ardiono 2009 + midivox
Or optionally with "doublewide shield" + "mux shield" it could have its own controls.


I like you project and it sound great.

Can't wait about your smaller version for the midivox.
it would be great to learn wavetable oscillators

quite a lot has been done, It has become quite the project, which i thought was worthwhile making in to a proper useable prototype in a modular synthesizer.

I have made a new board with switches and a MAX7221 LED driver to display the wavetable and bank numbers, as well as some indicator LEDs
The MAX chip only uses 3 lines, and the switch multiplexer uses the same counter lines from the pot multiplexors, and 3 more digital inputs.
2 of the switches on the switch panel are grayhill hexadecimal output 16 way machanical switches, they are very nice but the price is :o (lucky i found some on ebay!) that way i can select the wavetables and output a proper number to the MAX chip and see what the hell is going on! When i was using a pot to select the wavetable sometimes it would be halfway between 2 values and glitch all over the place as it switched between them.

(and i can use this same board for an arduino based sequencer or drum machine as well, so i made a few)


populated and added to the monster arduino project

New panel properly drilled, but with no labels. the labels are photoshopped on(except those stickers lol)
sorry big pic

back. mostly wired

The 3 unused knobs are for the analog mod inputs which are not implemented yet, and for another LFO control which i haven't finished (i put the knob on once its working!)

I did do some work on the MIDIVOX version, and it is making noise, but i have to mess about with the code because the serial DAC is hogging too much processor time.

good work ! Thanks for sharing

Hi Defex,

I'm interested to view your code of the first prototype with 2 wavetable , ADSR, Wavetable mix and a pwm output.
i wanted to try similar project and it could be very interesing to see your first code to learn from beginning. (your actual project code is very complex i think.)