Author Topic: Generating Audio Tones  (Read 3948 times)

0 Members and 1 Guest are viewing this topic.

Offline fudgebobsTopic starter

  • Contributor
  • Posts: 13
  • Country: ca
  • The geek shall inherit the Earth
Generating Audio Tones
« on: January 17, 2014, 11:50:31 pm »
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 :)
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: Generating Audio Tones
« Reply #1 on: January 18, 2014, 07:56:25 am »
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-arduino

Depending 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
« Last Edit: January 18, 2014, 08:00:30 am by AndreasF »
my random ramblings mind-dump.net
 

Online zapta

  • Super Contributor
  • ***
  • Posts: 6598
  • Country: 00
Re: Generating Audio Tones
« Reply #2 on: January 18, 2014, 08:10:29 am »
Here is another example

http://www.arduino.cc/en/Tutorial/PlayMelody

You will need an arduino board and a buzzer.
 

Offline fudgebobsTopic starter

  • Contributor
  • Posts: 13
  • Country: ca
  • The geek shall inherit the Earth
Re: Generating Audio Tones
« Reply #3 on: January 18, 2014, 08:35:34 am »
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.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 9852
  • Country: nl
  • Current job: ATEX product design
Re: Generating Audio Tones
« Reply #4 on: January 18, 2014, 11:45:18 am »
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
 

Offline electronics man

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: Generating Audio Tones
« Reply #5 on: January 18, 2014, 12:54:57 pm »
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

It would mean that you would need one for every tune and the whole thing will get a bit messy
follow me on twitter @get_your_byte
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Generating Audio Tones
« Reply #6 on: January 18, 2014, 01:03:12 pm »
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.

Music 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.


 

Offline fudgebobsTopic starter

  • Contributor
  • Posts: 13
  • Country: ca
  • The geek shall inherit the Earth
Re: Generating Audio Tones
« Reply #7 on: January 18, 2014, 04:12:00 pm »
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.

Yeah 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->