Musical Note Detection Possibilities?
erco
Posts: 20,256
I'm working on a music project for the twins, who are learning to play recorders (little flutes). It's simple enough to detect sound versus silence, I'm wondering if there is a simple microphone+audio amp+filter/clip circuit that might condition the recorder sound so a Stamp could tell the difference between 3 or 4 different tones using COUNT and light different LEDs. The notes can be spaced apart as necessary, don't need to be adjacent.
No doubt, it will come down to the purity of the sound produced (harmonics+other noise) by the recorder. An electronic square wave generator could make audio frequency tones that would be easier to detect, but it would be more magical to use their recorders. My backup plan is using more hardware like several 567 tone decoders, but a software solution would be much simpler.
Has anyone tried anything along these lines? Those silly little whistle keychain beepers that are nothing but a piezo sensor/speaker and epoxy blob make it look easy.
No doubt, it will come down to the purity of the sound produced (harmonics+other noise) by the recorder. An electronic square wave generator could make audio frequency tones that would be easier to detect, but it would be more magical to use their recorders. My backup plan is using more hardware like several 567 tone decoders, but a software solution would be much simpler.
Has anyone tried anything along these lines? Those silly little whistle keychain beepers that are nothing but a piezo sensor/speaker and epoxy blob make it look easy.
Comments
I found the attached "record/playback" circuit at http://www.engineersgarage.com which is a fun site to poke around. It's got a 1-transistor amp input to a PIC, may be a good place to start.
Probably possible on the Prop. Depending on what kind of accuracy you want.
What you need is a Fast Fourier Transform to tell what frequencies are present in your signal.
There is one here : http://propeller.wikispaces.com/FFT
Or my FFT is here : http://forums.parallax.com/showthrea...ier-Transform.
Or there are a few similar transforms you can use. Check out this nice Propeller Sound analyser demo video: http://www.youtube.com/watch?v=qvjG2j6uh94
You may need a steep low pass filter to get this working nicely.
Here is Pete Hemery detecting notes played on a Kalima with a Propeller: https://www.youtube.com/watch?v=xQUO_jfl8SE
http://petehemery.github.io/Final-Year-Project/
It's pretty impressive.
Decades ago I remember some fellow students in my physics department trying to measure the frequency of a big old brass bell using that technique and a frequency counter.
Their output was pretty much random numbers.
I think a kazoo is all harmonics. The sound is made by humming into it, which is itself already a complex waveform, made even more complex by adding timbral effects to it. For detecting raw tones, the recorder is much better, I'd think.
Hmmm. I wonder if I could modify the CRT from an old TV into something along those lines. But where might I possibly find a discarded old CRT TV?
-Phil
There are probably plans somewhere for building an audio spectrum analyzer. Somewhere. But it might be easier to find some freeware or demo software that does it. Alls you'd need is a microphone connected to your sound card. Save your old CRT for the Ercovision for your Corvair.
And yes, listen to Phil. Just get a damn Propeller already! Geez!!
Try this http://forums.parallax.com/attachment.php?attachmentid=48409
Jim
http://forums.parallax.com/showthread.php/96099-Propeller-Application-DEMO-Spectrum-Analyzer-(for-Audio)
The Spin files have disappeared from the thread, but I attached them.
Why don't you plug a microphone in to your PC and record one of your kids playing the flute. If you record it as a .wav file you could use Audacity or a similar program to look at the waveforms. I'm pretty sure the output from any flute like instrument produces a fairly simple to square up wave.
There are a lot of SoundCard package out there, and some commercial scopes even include a sound-card option (makes a nice way to test/learn the software, and is good in class).
eg Cleverscope claims this, but I have not tried it.
You can also use a Schmitt trigger http://en.wikipedia.org/wiki/Schmitt_trigger
In electronics, a Schmitt trigger is a comparator circuit with hysteresis, implemented by applying positive feedback to the noninverting input of a comparator or differential amplifier. ** It is an active circuit which converts an analog input signal to a digital output** signal. The circuit is named a "trigger" because the output retains its value until the input changes sufficiently to trigger a change. In the non-inverting configuration, when the input is higher than a certain chosen threshold, the output is high. When the input is below a different (lower) chosen threshold, the output is low, and when the input is between the two levels, the output retains its value. This dual threshold action is called hysteresis and implies that the Schmitt trigger possesses memory and can act as a bistable circuit (latch or flip-flop). There is a close relation between the two kinds of circuits: a Schmitt trigger can be converted into a latch and a latch can be converted into a Schmitt trigger.
Schmitt trigger devices are typically used in signal conditioning applications to remove noise from signals used in digital circuits, particularly mechanical switch bounce. They are also used in closed loop negative feedback configurations to implement relaxation oscillators, used in function generators and switching power supplies.
Also by using a low pass filter you can set a range of frequencies that you want to detect.
(Diagram on page 4)
https://www.fairchildsemi.com/application-notes/AN/AN-140.pdf
Yes, the backup plan was to use a 555 oscillator, but this is already working better than expected with the recorder flute, so I'm good to go.