Keyboard frequencies to generate different colored lights?
Yvonness
Posts: 4
Hi, all!· · I'm a newbie to all this.· This is my first time at a forum of any kind.· I'm a pianist and I've had only a bit of Stamp programming at our local community college.· I'd like to make a keyboard communicate with the stamp or propeller to make lights come out that match the color frequencies to the sound frequencies so that we can see the colors (using LEDs, lights, or those colored compact CCFL tubes) of the sounds. So, I'm asking a big question first: is it possible? I've heard about MIDI, but I also know it's possible to "listen" to frequencies.
I realize it's best to ask a specific question next, like "how would I connect it?" and I'll probably do that next.
So, I'd appreciate any general or specific input you could give me at this time.
I'd appreciate any help along any part of the way.· You could reply here or use the PM feature.·
···· MusicallYours,
··········· Yvonness
P.S. I'm at the UPEW expo today at Parallax.
I realize it's best to ask a specific question next, like "how would I connect it?" and I'll probably do that next.
So, I'd appreciate any general or specific input you could give me at this time.
I'd appreciate any help along any part of the way.· You could reply here or use the PM feature.·
···· MusicallYours,
··········· Yvonness
P.S. I'm at the UPEW expo today at Parallax.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
http://science.howstuffworks.com/light3.htm
Then the next link says... " While the range of frequencies that any individual can hear is largely related to environmental factors, the generally accepted standard range of audible frequencies is 20 to 20,000 hertz...
http://en.wikipedia.org/wiki/Audio_frequency
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
(My point was the frequencies don't match...)
·
Casey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I fish, therefore I lie!
Or label different lights and light up an LED next to each label.
Or make lights less or more bright.
So far as I have seen, there are just a few colors of LED lights, whereas there are all sorts of keys on a piano/keyboard.
To my knowledge there is no light which would change color depending on how much electricity is provided to it or what frequency is provided to it?
So far as I know, lights are one color and on/off?? (There are multi-color LED's, but only 3 different colors.)
For example with a red LED - on you get red. Less power a dim red LED. More power a bright red LED, etc.
Also the stamp has only 16 connections. But there are clever ways to have more outputs.
They also have bar LED's sort of like the progress bar on a computer when you are downloading something. I suppose you could use one of those for a frequency range. Then another for another frequency range. Just like a graphic equalizer on a stereo system.
Casey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I fish, therefore I lie!
Casey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I fish, therefore I lie!
I think the hardest part for you will be in interfacing your keyboard to the stamp ie the headphone output or the line output would need to be capped to a max of 5V
Microphone Frequency Sensor·<<< this site gives you a circuit (w/walkthru) to convert the freq to Analog
So...with an ADC connected, you can work out the freq:voltage ratio you're looking for.
Try this as yer starting point!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
I suppose it'd be difficult to pick off each key's contact? Too bad though, that'd be easiest. A DTMF decoder does is what you need, you just need a lot more frequencies. Perhaps someone makes such an IC?
How many lights are you interested in using? 20? 88? (one for each key?) or some other number?
Oh, and tri-color LEDs can show much more than three colors. That may be an option as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... Smile, there went another one.
What all can you do with them?
Can you mix two colors and get the mixture?
And maybe power one color just a little and power another color a lot and get variations?
·
Post Edited (skylight) : 6/28/2010 5:14:22 PM GMT
@bill190
With a Tri color LED, you shouls be able to create any color you want. You would apply PWM to each LED to vary the intensity of each color to produce the mix of your choice.
Jim
···· Yvonness
when you record sound with a microphone you are measuring the sound vibrations at a fast rate, that is you are recording the amplitude as a function of TIME. It is also likely that different notes are played simultaneously. So a microphone would sense the superposition of the individual notes. To get the individual FREQUENCIES from this you could do two things:
(1) Have a bunch of bandpass filters, each tuned to one of the notes. Bandpass filters can be designed to transmit in a narrow frequency range and thus listen to just one particular note. I guess you would need as many of those as you have notes on your keyboard. You may have seen bandpass filters on the Equalizer of an "old" high quality stereo set.
(2) Or you could record the original sound for a short period and then do what is called "Fourier transformation". This is a mathematical algorithm that will give you the spectrum of the sound, that is the result will show you what individual frequencies are contained in the original sound. Fourier transformation takes quite some calculation; I don't know if anyone did that on the Stamp and/or if it would be fast enough.
I know you're new to programming and electronics, but this is basically how the schematic works:
The negative terminal is connected to ground (vdd on the board of education) and is tied to the positive terminal of the microphone, pulsing with the frequency of the sound. The v+ (positive voltage, vss on the BOE) connected with a resistor to the positive terminal of the microphone is used·to "pull it up", meaning it allows your microcontroller (Basic Stamp) to differentiate when the electret microphone is triggered (negative) or not (positive). Due to the high frequency of the sound waves, this schematic should make a sort of AC signal·which can be filtered by a capacitor before going to·an I/O pin. Once there, you can program your microcontroller to get a measure of time·between the negative pulses (use the command "rctime" on the·Basic Stamp)·to get a·reading of the frequency of the sound being detected. Then, all you have to do is light·some LEDs!
Hope you understand this, I know it's a little complex for you at this point. My advice: listen to your professor and go through those Basic Stamp tutorials!
Good seeing you at the expo, and good luck with this project!
~ Yvonness
http://www.maxmidi.com/diy/serial/index.html
Not for Parallax products but they could be converted.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen