Pages: [1]   Go Down
Author Topic: send digital output based on sound frequency.  (Read 758 times)
0 Members and 1 Guest are viewing this topic.
brooklyn
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a wave shield attached to the arduino and I am trying to send digital output based on sound frequency.  I would like to be able to analyze the wave file and assign different outputs to different peaks.  In short I am trying to build my own player piano that will run with solenoid pistons.  I have the wave file of the piano playing.  The audio will come from speakers, but to get the keys to move I need to figure this out.  Does anybody know the code that would help me do this.
Thanks
Adam
Logged

brooklyn
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a wave shield attached to the arduino and I am trying to send digital output based on sound frequency.  I would like to be able to analyze the wave file and assign different outputs to different peaks.  In short I am trying to build my own player piano that will run with solenoid pistons.  I have the wave file of the piano playing.  The audio will come from speakers, but to get the keys to move I need to figure this out.  I am thinking that the best way to do this is to figure out a way to analyze the wave file, compare it to the musical score and then assign outputs to the different solenoid pistons/keys.  Does anybody know the code that would help me do this.

Thanks
Adam
Logged

brooklyn
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a wave shield attached to the arduino and I am trying to send digital output based on sound frequency.  I would like to be able to analyze the wave file and assign different outputs to different peaks.  In short I am trying to build my own player piano that will run with solenoid pistons.  I have the wave file of the piano playing.  The audio will come from speakers, but to get the keys to move I need to figure this out.  I am thinking that the best way to do this is to figure out a way to analyze the wave file, compare it to the musical score and then assign outputs to the different solenoid pistons/keys.  Does anybody know the code that would help me do this.


Thanks
Adam
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which waveshield you have ? Post a link please ..

you need an FFT filter to split the sound in individual frequencies. And depending on the amplitude of the freq. you can trigger a solenoid or so.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 10
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Something called Fast Fourier Transform Algorithm may help you. Complicated stuff for a beginner though. You've got to have advance level in math to properly process that. Signal peaks? that's amplitude. Frequency components maybe is what you need. The FFT will do that. I'm not sure if Arduino "speed" at high audio frequencies will allow to do the FFT in real time if that's the case. Maybe others have experience on that.
Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24449
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Topics merged.
OP, do NOT cross-post, it just wastes time.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Does anybody know the code that would help me do this.

Programming is simple: all you need to do is to pretend to be a computer trying to replicate activities that a human would otherwise perform to achieve the goal. So in your case, ask yourself how YOU as a human would have done here to achieve your goal.

Once you have that cleared, it is a breeze to tell the computer to do it for you.
Logged

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 10
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This chip may help you make things easier and simpler to begin; but you will be limited in the amount of keys you can play (7). I suggest you start by using this chip and you will learn in the process. It does the frequency separation inside. Simply by connecting some of this chip's outputs to the Arduino analog inputs and then your software will control your pistons, etc.
https://www.sparkfun.com/products/10024
Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

Montreal
Offline Offline
Edison Member
*
Karma: 23
Posts: 2487
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://coolarduino.wordpress.com/2011/09/03/arduino-musical-note-recognition-pushing-the-limits/

 Though, it'd be much easier to process MIDI file, arduino will just drive pull of solenoids based on text - note information.
Logged

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 10
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Kool, I didn't know that. Thanks.
Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

brooklyn
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

this is the wave shield I have- http://www.adafruit.com/products/94
Logged

brooklyn
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am NYC based and would be willing to hire somebody to help me complete this project.  Any recommendations? 
Logged

Pages: [1]   Go Up
Jump to: