Generating Audio Tones - Page 1
Forum section: electronics / projects

author: fudgebobs
author_rank: Contributor
timestamp: January 17, 2014, 11:50:31 pm
content: Hello, I am trying to build an audio tone game that will play music when you complete gestures on an LCD display.I don't know what I can use to generate tones or play audio tones when the gestures are successful.I would appreciate some suggestions in things I can use to generate audio tones. As an example, suppose I wanted to play a happy birthday song.Thanks in advanced

author: AndreasF
author_rank: Frequent Contributor
timestamp: January 18, 2014, 07:56:25 am
content: There are several options. It really depends on how much audio quality you want/need. Since you appear to have absolutely no idea, how you would do this in general, I suggest a look at this:http://learn.adafruit.com/adafruit-wave-shield-audio-shield-for-arduinoDepending on your main platform, you may already have a DAC peripheral on-board that is good enough for your purpose. Some microcontrollers also have specific modes in their serial modules that let them easily create serial digital audio formats (e.g.I2S) that can then be used to control an external audio DAC.*edit: reference to linked pages was moot as links are dead

author: zapta
author_rank: Super Contributor
timestamp: January 18, 2014, 08:10:29 am
content: Here is another examplehttp://www.arduino.cc/en/Tutorial/PlayMelodyYou will need an arduino board and a buzzer.

author: fudgebobs
author_rank: Contributor
timestamp: January 18, 2014, 08:35:34 am
content: Thanks for the input... I was looking into if and I think I will go with just generating the sound using a buzzer and a square wave generated through PWM of the uC .Good to know the other options though.

author: tszaboo
author_rank: Super Contributor
timestamp: January 18, 2014, 11:45:18 am
content: Some time ago I've seen merry Christmas and happy birthday chips. They have 3 leads, power, ground and tone output.Wait, Ive found it. Digikey (!)http://www.digikey.com/product-search/en?v=173&FV=fff40027%2Cfff80219&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25

author: electronics man
author_rank: Frequent Contributor
timestamp: January 18, 2014, 12:54:57 pm
content: Quote from: NANDBlog on January 18, 2014, 11:45:18 amIt would mean that you would need one for every tune and the whole thing will get a bit messy

author: codeboy2k
author_rank: Super Contributor
timestamp: January 18, 2014, 01:03:12 pm
content: Quote from: fudgebobs on January 18, 2014, 08:35:34 amMusic like that will sound really awful, like from the 90's. Think of those tiny handheld football games or the greating cards that play a tune.. Those are square wave tones.. they sound nasty.If your platform has enough processing power to drive an LCD screen and touch gestures then I am sure that it has more than enough power to do more than just square wave tones ..If this is something you are building and are in the development stages, then you should put an FM synthesis chip on board, or at least consider using sampled waveforms playing those back through a DAC channel and low pass filter to an external audio amplifier.

author: fudgebobs
author_rank: Contributor
timestamp: January 18, 2014, 04:12:00 pm
content: Quote from: codeboy2k on January 18, 2014, 01:03:12 pmYeah that makes sense. Think I might want to go for better audio quality on this one since this is going to be a birthday gift so it makes sense if I try to make it better quality.Yeah I am still in early development stages just gathering information in the things I will need. So I am open to any suggestions and the ones that I have seen seem like good solutions. Since I haven't done anything with audio I had no idea where to start actually. All your suggestions have helped. I'll take a look into which option will be the best for me.