Shop OBEX P1 Docs P2 Docs Learn Events
Suggestions on getting the BS2 to get leds to dance to the music — Parallax Forums

Suggestions on getting the BS2 to get leds to dance to the music

LuckyLucky Posts: 98
edited 2008-07-06 15:36 in BASIC Stamp
basically, all i wanted was to hook up a mic. to a BS2 and then the BS2 to different sets of leds, that would light up depending on the frequency the mic. sends out, which would vary when the music went high in pitch and low·in pitch. for example a person plays a trumpet and plays a scale, different leds would light up depending which note he's on. i know something has to happen inbetween the mic. and the BS2, but i just wanted suggestions on what would be the most effective and simplest way of accomplishing this. thx.

by the way, it would probably be like regular music, not just a trumpet. like a band i guess.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-06 04:31
    Pretty much all of the work would have to be done by hardware outside of the BS2. Basically, you have a microphone preamplifier followed by several bandpass filters that filter out everything but a narrow band of frequencies. This then gets rectified and filtered to give you a voltage (say between 0 and 5V) representing the amount of energy in that frequency passband. This voltage would be digitized by an analog to digital converter like the ADC0804 (4 channels) attached to a BS2, then there would be some algorithm in the Stamp that would decide which LEDs to light up, for how long, and possibly how brightly. You probably would want more than 4 channels.

    There's a Parallax tutorial ("Basic Analog and Digital") downloadable for free from Parallax's website that shows how to use the ADC0804. There are also some Nuts and Volts Columns that are downloadable from Parallax that discuss analog to digital converters (go to the Resources tab).

    You should be able to find do it yourself articles on making a preamplifier and filters by doing a websearch. That's how I would find them
    if I wanted to build something like this. Search for "DIY Light Organ".
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-07-06 09:40
    Try to first get the rhythm of the music captured before you get into movements of frequency.

    Every piece of music has a beat to get our attention. Have the microprocessor doing something with the sound that is totally unrelated to the beat will seem quite nonsensical.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Steve in NMSteve in NM Posts: 54
    edited 2008-07-06 15:36
    "Sounds" like a spectum analyzer: http://www.aaroncake.net/circuits/3chspec.asp·smilewinkgrin.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm not a complete idiot! Some of my parts are missing.
Sign In or Register to comment.