Introduction: Turn Your Arduino Into a 4 Voice Wavetable Synth With Only a Few Components...

Picture of Turn Your Arduino Into a 4 Voice Wavetable Synth With Only a Few Components...
Multiple synthesizer projects have been done for the Arduino, but few have been able to utilize the full power of the Arduino processor. DZL from GeekPhysical wrote a 4 voice wavetable synthesizer that is one of the more advanced software based synths for the Arduino.  It has wavetables included (sine, saw, square and triangle) and envelopes to create beats.

This instructable will show you how to make a simple sequencer that plays a little melody. You can hear how it sounds here:

It is up to you to modify the code to do many other things. Possible examples could be a midi controlled synth (sample code included), it could be a strange noise machine like this one:

Or you could detect touch and convert it into sound patterns:


Step 1: Parts

Picture of Parts
You should use the following parts:

  • Arduino board
  • BreadBoard
  • Wires
  • 2.2k Resistor
  • 100n Capacitor
  • 100u Capacitor
  • Jack where left and right channel has one wire and one wire to ground
  • A pair of computer speakers

  • Don't worry if you don't have the exact values. It will probably work, but might be with lower sound quality. The Arduino is not powerful enough to drive a pair of headphones so you will need some kind of preamp for that - e.g. a headphone preamp like this one.

    Step 2: Add the Components to Your Breadboard

    Picture of Add the Components to Your Breadboard

    Start out with adding the components to the breadboard as the picture depicts. If you want diagram based instructions look at the third slide in this step.

    Step 3: Connect to the Arduino Board

    Picture of Connect to the Arduino Board

    Connect one wire from pin 6 to the breadboard and one wire from ground to the breadboard.

    Step 4: Connect to the Speakers

    Picture of Connect to the Speakers

    Connect the jack connector to the breadboard as shown and plugin the jack from the speakers.

    Step 5: Upload Code

    Picture of Upload Code
    ***Remember to read the update below (keeping the old info for consistency)***

    Below are the simplified steps to uploading the code to your Arduino board. If you are brand-new to Arduino, you can find a great step-by-step guide here to help you get your board connected and up and running, it's very simple and then you can continue with the below steps.

    • Download Arduino:
    • Connect the Arduino board to the computer via usb.
    • Download the code from github here: (Old code - look below)
    • Upload the code to the Arduino board.

    Congratulations - you are ready to go!

    A new version of the synth can be found below:

    This version works with the newest version of the Arduino Ide and the whole synth has been simplified. It should be more simple to hack and modify for ones own needs.

    The output should be connected to pin 11 (Configurable to 3 as well). In the old code one should use pin 6.


    РазживинД made it! (author)2017-11-07

    Thank you for the article! I built an 8 step sequencer using the synth library, works perfect.

    ColinM74 (author)2016-08-25

    its not clear at all how to upload the files to the board. do I need an .ino file like in the examples? can i use any of the examples and how? and how do I get it to add a .h file as a directory. please help thank you :)

    AlexanderP9 (author)ColinM742017-02-10

    Download the zip archive from github, then add it to your arduino libraries as described here ("Add .ZIP Library", then choose "the_synth" folder from the archive). Then just launch any .ino from the examples folder and upload to your arduino (song.ino will play the melody instantly after uploading). Pay attention that you should use pin 11 instead of 6 and 1K resistor instead of 2.2K. Good luck %)

    FrankD104 (author)AlexanderP92017-02-20

    Works like a charm on my Leonardo ( thanx df99 for the conversion !).

    However, I would like to use a standard 5 pole Din midi cable at d0/rx.

    Can someone help me out here to do this ?

    I already have the midi interface ( 6N138 opamp & peripheral components installed on breadboard ).

    Thanks in advance

    df99 (author)2014-10-05

    Excellent library! However, it would not work with any Atmega 32U4-based boards (Leornardo, Micro, Pro Micro, etc) as it uses Timer 2 for the timer output compares. Timer 2 is missing from the 32U4. I re-wrote the library using Timer 4. This has the advantage of offering a few more differential output modes that were not possible with Timer 2. This is possible because the 32U4 has two addition timer output pins that mirror the state of the primary pin. Not all pins are available on all 32U4 Arduinos, but if they are, the library mod now supports them. The pins mentioned are the standard Arduino pin mappings to the Atmega 32U4.

    The new modes are:

    DIFF_10_13 - Differential mode on pins 10 and 13, same as old diff. mode

    CHB_9 - Single-ended mode on pin 9 (channel B)

    CHB_10 - Single-ended mode on pin 10 (channel B)

    CHB_DIFF_9_10 - Differential mode on pins 9 and 10 (with Channel B only!)

    CHA_5 - Single-ended mode on pin 5 (channel A)

    CHA_13 - Single-ended mode on pin 13 (channel A)

    CHA_DIFF_5_13 (default) - Differential mode on pins 5 and 13 (with channel A only!)

    Example: edgar.begin(DIFF_10_13);

    New library is at:

    I used the library to build an old-school phone phreak blue box, as it allows generation of multiple sine waves. See df9999999999 YouTube channel for details.

    LucasM104 (author)df992016-05-21

    I can't seem to be able to access that link, it keeps 404ing, could you please upload it again?

    mvelamazan (author)df992016-03-14

    Hi df99, I am quite desperate looking for a way of making this four voices synth to work with arduino mega adk or due, I assume your codedoesn't help but do you have any suggestions?


    mvelamazan (author)2016-03-14

    I would really appreciate some help to make it work (as other people posted below, there is no sound) in an Arduino Mega ADK or Due.


    ejective (author)2016-02-08

    why no answers on the question asked the most??? how the #]%]%]< can I play the synth?? do i need to hook it up analog style and control it with midi out of a keyboard or can it be done through usb to arduino comm link?? a simple answer please! thanks ;)

    Qsilverrdc (author)ejective2016-03-10

    I can try and help..

    This is a self playing 4 part song.

    VilleV1 (author)2016-01-01

    I made this couple of days ago, and love it! Such beefy low end :) . I'm trying to implement velocity sensitivity, but I'm kinda stuck. I passed midi_2nd from midi parser to synth like so


    Then modified mTrigger function in synth.h:

    void mTrigger(unsigned char voice,unsigned char MIDInote, unsigned char velocity)


    FTW[divider] = PITCH[voice] + (int) (((PITCH[voice]>>6)*(EPCW[voice]>>6))/128)*MOD[voice];


    It compiles fine, but doesn't change anything. Any suggestions?

    DanieleP1 (author)2015-10-31

    i'm sorry, i feel a bit stupid : i built the thing and loaded the code on atmega328.... how do i play it now? I loaded the midi synth... should i play it from my daw? thanks

    wgrabarz (author)2015-04-09

    would it be possible to use just two voices, but each on a separate PWM output to get effectively two detunable oscillators (detune realized by global pitchbend wheel and a dedicated detune knob, both read by analog inputs). Also how hard would it be to add a keyboard without using another Ardunio/uController?

    Maxx36 (author)wgrabarz2015-05-05

    I want to do the same thing did you ever figure out how to output different pins?

    wgrabarz (author)Maxx362015-09-02

    unfortunately no. I'm building a Meeblip Anode instead, but check out the Midimuso website, a guy sells preprogrammed atmegas that do just that, they cost about 8 pounds each

    wgrabarz (author)Maxx362015-07-08

    unfortunately no, I just had to lower my expectations and use single pin :/

    fizz.manchester (author)2015-03-12

    Has anyone got this to compile in the 1.6.0 IDE? thanks

    derekdp6 (author)fizz.manchester2015-03-19

    I'm getting compilation issues as well fizz. Are you getting error messages like this?

    In file included from IllutronBDemo0_2.ino:32:0:

    sin256.h:4:23: error: variable 'SinTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

    PROGMEM char SinTable[]=


    DanielL33 (author)derekdp62015-06-21

    I had that problem, just go through the tables.h file and add "const" before all the tables

    fizz.manchester (author)derekdp62015-03-23

    My problem was the Import/Add Libary automatic installation method does not
    work with the folder structure of the zip file. For any arduino newbies like myself,
    open, then the_synth-master folder, then copy and paste
    or drag and drop the_synth folder(not synth-master) into My Documents\ Arduino\libraries

    AndrewM24 (author)2015-05-07

    I've been having endless fun with this! I've been making a sequencer with lots of functionality that I'll make available soon.

    Could anyone tell me if there any way to reduce aliasing noise? In particular with "clean" sounding waveforms like sine and longer-duration notes, there's quite a bit of noise as the note decays. Is this unavoidable? Thanks!

    Regarding some of the problems other have mentioned below: It's necessary to add "const" to the variable declaration for the tables stored in PROGMEM.

    Partyghost (author)2013-11-26

    Hey there, awesome project. Im actually working on the groovesizer by MoShang but am not able to get any sound out so I came over to yours as there are less components to see if I could get sound out at all.

    Im having the same problem, code is uploading error free but Im still not able to get any sound out!

    Im running windows 7 and using an Arduino Mega2560 and have the circuit built on a breadboard. The sound is going out to an iHome rechargable speaker.

    My questions are is there anything that I need to change in the code since Im running a different board? And is there anything that I can be looking for or testing with a multi-meter to see if theres something I have messed up in the building of the circuit itself?


    Have you solve the problem? I am facing the same problem. Can you share with me what should be done?

    Partyghost (author)Partyghost2013-11-26

    I also have an Arduino Micro that I could try this out on if its supported

    anath11 (author)2014-10-29

    Great tutorial. Could you please explain a bit more about the circuit. How does it all work. I've noticed that when I use 1 K ohm resistance instead of 2.2. I get better louder and better quality sound

    milo888 (author)2014-05-03

    I've just built this with the new version of the code and the differential circuit. It sounds great with headphones. I found a rather oversize (high current) 9mH inductor that is very bulky. My background is programming, not electronics. What type of inductor would you recommend for the low pass filter of this circuit?

    df99 (author)milo8882014-10-07

    I've been using a 12mH inductor with a .33mf capacitor for the low pass filter, with excellent results in both the single-ended and differential output modes. It is optimized for telephony frequencies from 300Hz to 3000Hz. It reduces the 20KHz sampling frequency by 40dB. You can also substitute a 150 ohm resistor for the inductor. It provides 20dB of attenuation of the 20KHz, with a small loss of volume. The inductor sounds better.

    skeblik (author)2014-05-28

    My speaker have 12Ohm + 100Ohm rezistor.

    For tune command was working OK.

    skeblik (author)2014-05-28


    I try to use your instructions and run one of your examples, concrete different_pins_and_modes.

    I'm using Arduino Leonardo. I try mostly everything but I cannot hear any sound from my speaker. Should I change some settings or what can be a problem?

    Thank you

    jairova (author)2014-05-20

    Please ignore my previous comment! I just had to move the header files to the directory of the sketch. I want to know how to control the MIDI synth though. I'm not sure what you mean by the Arduino receiving MIDI over serial. Is it the Serial Monitor?

    jairova (author)2014-05-19

    Thanks for uploading this! Unfortunately I'm having some trouble and can't get the new code to work though. the old code works just fine however. Whenever I try to compile the new code, I get an error like this:

    song:22: error: 'synth' does not name a type

    song.ino: In function 'void setup()':

    song:27: error: 'edgar' was not declared in this scope

    song:27: error: 'DIFF' was not declared in this scope

    song:29: error: 'SINE' was not declared in this scope

    song:29: error: 'ENVELOPE0' was not declared in this scope

    song:31: error: 'ENVELOPE2' was not declared in this scope

    This was for the song file, but it's the same error for every file.

    CharlieMcF (author)2013-08-02

    Great project, thanks! I'm having problems getting a sound output using a Mega 2560 - the code seems to run fine (at least it streams the counter values out to the terminal) but there's no output that I can find on any of the PWM pins. Is there a simple fix do you know, or is it a huge amount of work to get it to run on the Mega due to the different architecture?

    Partyghost (author)CharlieMcF2013-11-26

    Im having the same issue, did you ever discover a fix for this?

    madshobye (author)Partyghost2014-02-14

    Try the updated version.

    Jbou (author)2014-01-24

    Hey! How can we try the code if the cpp files aren´t there??

    madshobye (author)Jbou2014-01-25

    The ino files contains what would normally be a part of the cpp file. It is an Arduino way of doing things.

    gavox (author)2013-09-27

    I'm relatively new to arduino, but the program keeps telling me various parts of the code contain errors...
    Running ubuntu 64-Bit, Arduino Duemilanove.

    krlos16 (author)2013-04-29

    hi my friend,, please might upload the code for arduino leonardo, thanks, regards from Bogota Colombia

    The nerdling (author)krlos162013-09-04

    if your wondering if it works on the leonardo yes it should

    d33d (author)2013-07-09

    awesome projects, Mads! can you share a link to code/wiring or at least some more info about the touch sensing-sound conversion circuits as in the "mediated body" clip? I am interested in integrating something like this into a larger project out on the playa...

    madshobye (author)d33d2013-07-10

    Look at the instructable on touche or the singing plant under my profile and you will find two good examples. Good luck with BM.

    Neurotheist (author)2012-10-31

    Hey so I have everything set up, but because Im very new to this I guess I'm a bit confused on how to upload this code. Ive downloaded all the what should I do?

    mcruise (author)2012-10-08

    Hello, i'm seriously thinking to build this project, but what code i have to choose from link?

    madshobye (author)mcruise2012-10-08

    All of it, but open it with the "synthOriginal.ino" sketch.

    soggymushrooms (author)2012-10-07

    That is one chunky breadboard...

    blinkyblinky (author)2012-07-04

    Wonderful. I noticed you commented out some midi support. If I un-comment it, what pins should I use or it it not completed yet?

    rezponze (author)2012-07-03

    That was really inspiring. I've reproduced your tutorial and everything was smooth and clear. It worked the first attempt.

    However, I found a bit difficult to understand how External Midi works in this code and with this hardware layout.

    It would be great to know where is supposed to come in the MIDI IN signal.
    Could you possibly link to any MIDI interface compatible with your design?

    Thanks in advance for any further information or links to better understanding the MIDI interfacing.

    zcarlos (author)2012-06-18

    I have two questions:
    I've tested it and it sounds better (and louder) without caps and resistors, wiring ardu pin to jack directly. What have I done wrong?
    And, please, can you post a more hackable code? Sound is awesome but I can't imagine how to do things, p.e. read some buttons for change pitch.
    BPM: Your video demo song is slower than my attempt, Where can I change BPM?
    Thank you very much.

    energon (author)2012-05-25

    G E N I U S !!!

    largowork (author)2012-05-25

    Funny!! but I don´t know very well where can I change the parameters. Thanks!

    About This Instructable




    Bio: IMPORTANT: Please do not message me personally with technical questions. Use the comments in the respective Instructables. I really love sharing and helping people makes ... More »
    More by madshobye:Guino: Dashboard for your ArduinoMaking noise machinesMaking sound (noise) machines
    Add instructable to: