Instructables
Picture of The Arduino Synthesizer


The Arduino is able to output sound through a library that has been developed called the Tone Library.

By creating an interface and a program that can call certain values to be output to an audio out, the Arduino Synthesizer is a robust tool for making a rudimentary noise machine. It uses granular synthesis techniques to generate a distinctive sound that can be a whole lot of fun for musicians, artists, tinkerers, and hobbyists.




 
Remove these adsRemove these ads by Signing Up

Step 1: How it works

Picture of How it works
Sound is created by playing the same sound grain, or samples (small pieces of around 1 to 50ms) over and over again at very high speed. Our ears and brains turn this into an audible hybrid of the repetition rate and the original grain, and it sounds like a constant tone.

The grain consists of two triangular waves of adjustable frequency, and adjustable decay rate.

The repetition rate is set by another control.

Step 2: Materials and Tools

Picture of Materials and Tools
IMG_0501.jpg
parts_edit_11.jpg
parts_edit_02.jpg
parts_edit_12.jpg
parts_edit_01.jpg
To make this project, you will need the following things.

Parts:
(5X) 5K potentiometer- (Radioshack #271-1714)
(5X) Potentiometer knobs - (Radioshack #274-416)
(3X) LEDs - (Radioshack #276-307)
(1X) SPDT switch - (Radioshack #275-1549)
(1X) Light Dependent Photo Resistor - (Radioshack #276-1657)
(1X) Arduino - (Radioshack #276-128)
(1X) Arduino Protoboard - (Radioshack #276-140)
(1X) Tactile Switch - (Radioshack #275-002)
(1X) Project enclosure - (Radioshack #270-1807)
(1X) 1/8" Audio Jack- (Radioshack #274-251)
(1X) a whole lot of solid core wire - (Radioshack #278-1222)
(1X) heat shrink - (Radioshack #278-1627)
(1X) breadboard - (Radioshack #276-002)
(1X) jumper wire - (Radioshack #276-173)
(3X) 10K ohm resistors - (Radioshack #2271-1335)
(3X) 220 resistors - (Radioshack #271-1313)
(1X) 9V battery - (Radioshack #23-866)
(1X) 9V battery clip - (Radioshack #270-324)
(1X) size M coaxial DC power plug - (Radioshack #274-1569)

Tools:
  • soldering iron
  • solder
  • flux
  • glue
  • multimeter
  • drill

jservin11 year ago
Hello,
I was wondering if the a5k pots are a necessity? I have a bunch of b5k pots laying around but am not certain that this would effect the sound of the unit. I don't believe it would because the pots are processing data and not audio signal. Please correct
me if im wrong.
audreyobscura (author)  jservin11 year ago
the A or B orientation just indicates which direction you have to turn them to add resistance..... either one should work :D

the a and b indicates if its log or lin.

Dodgy DinghyG2 months ago

Is there any way to edit the code to run on an arduino leonardo. When I try to upload it gives me errors and i think this is because the leonardo does not have a timer2, is there any way to edit the code so it doesn' use timer2

Mr Arduino5 months ago

can you make this without LED'S?

Mr Arduino5 months ago

How do you read the data?

randelia10 months ago
Code does not work on Leonardo. Code uses timer2 - leonardo does not have a timer2.
Does anyone have an update for how to run this on a Leonardo? I read something about using timer3 & tuning it's 16bit timer as compared to timer2 being 8bit...
Using Arduino 1.0.5 IDE - i get these compiler errors (all relating to timer2):
sketch_dec10b.ino: In function 'void audioOn()':
sketch_dec10b:259: error: 'TCCR2A' was not declared in this scope
sketch_dec10b:259: error: 'COM2B1' was not declared in this scope
sketch_dec10b:259: error: 'WGM20' was not declared in this scope
sketch_dec10b:260: error: 'TCCR2B' was not declared in this scope
sketch_dec10b:260: error: 'CS20' was not declared in this scope
sketch_dec10b.ino: In function 'void loop()':
sketch_dec10b:481: error: 'OCR2B' was not declared in this scope
sketch_dec10b.ino: In function 'void TIMER2_OVF_vect()':
sketch_dec10b:525: error: 'OCR2B' was not declared in this scope
jcarroll311 months ago
Has anyone gotten the code to work for Leonardo / Micro?
darenager11 months ago
Great job, thanks for tutorial.
builder3211 year ago
hey nice projekt you did there ! I just have problems running the code on the arduino it always shows me the info that some classes are not declared please help !
audreyobscura (author)  builder3211 year ago
which board are you using? can you screen cap your error message?
i use the arduino uno board but now it unfortunally runs the code but no signal is coming out of the audio jack box :/
Parosprint1 year ago
Hi Audry,
Nice project.
I have a question. The sound that you creat can be stored some how on the computer or you just have the speaker as an output?

Thank you.
audreyobscura (author)  Parosprint1 year ago
if you use a male-male cord you can put it in the line-in of your computer and record.
Hi Audrey,
thank you for your reply.
Im in the phase learn by doing in this type of project as i dont have a big background in electronics. Could you explain me in more details instead of what I should put a male to male cable or in plus I should hook it up in the arduino board? Thank you again.

Luca
bird1234571 year ago
They don't sell the arduino proto board in the uk, is there another alternative?
audreyobscura (author)  bird1234571 year ago
you can build your own proto board with header pins
Javastar181 year ago
Your directions are spot on, I have never before seen an instructables project so neat and professional. Great job, try to make it for an attiny or even better, a picaxe chip!
audreyobscura (author)  Javastar181 year ago
thanks!
bird1234571 year ago
Hey! I love this project and I tweeted about it:
https://twitter.com/BIPTEC
Alastor1361 year ago
Followed instructions to the letter, doesn't work. IDK what went wrong.
audreyobscura (author)  Alastor1361 year ago
I would check your circuit - make sure no wires are crossed. I Have built this many times over now, and have used them in many ways. If you are still having trouble please PM me and we can try and work together to figure it out :)
audreyobscura (author)  audreyobscura1 year ago
Or it could be your jack - check the wiring on your output jack. do you have access to an oscilloscope?
krlos161 year ago
the code does not run on arduino leonardo, help me please, my email is carlosmbernal@outlook.com
audreyobscura (author)  krlos161 year ago
it does run on a leonardo - confirmed. i would check your board settings from the aruduino programming language.
jaybeesco1 year ago
I having a hard time understanding what the pushbutton and switch do. Any help is appreciated!
krlos161 year ago
hi my friend,, please might upload the code for arduino leonardo, thanks, regards from Bogota Colombia
audreyobscura (author)  krlos161 year ago
i believe the code is the same, but you will have to some how connect an additional pcb to contain your wires, before connecting them to the leonardo board.

i haven't used the leonardo arduinos yet, do you like them?
audreyobscura (author)  krlos161 year ago
i believe the code is the same, but you will have to some how connect an additional pcb to contain your wires, before connecting them to the leonardo board.

i haven't used the leonardo arduinos yet, do you like them?
faziefazie1 year ago
Can I using this mono audio jack and this SPDT toggle switch which instead in your instructables?
mono_jacks.jpgimages.jpg
audreyobscura (author)  faziefazie1 year ago
yup.
krlos161 year ago
hi my friend,, please upload the code for arduino leonardo, thanks, regards from Bogota Colombia
This is so sweet! all the ardunino instruments ive seen so far have just been digital Atari punk consoles. Do you think you could somehow set it up with Midi, or with a keyboard?

I cant wait to make one of these and run it through my bit crusher!
agreed
Very nice. Just completed it on a breadboard and works great. Had to hook it up to an amplifier to crank it up! I didn't have any 5k pots around so i used 10k instead. Thanks for a great ible and great project!