The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: treena_12 on February 06, 2005, 09:23:25 AM

Title: How to synchronize music with led
Post by: treena_12 on February 06, 2005, 09:23:25 AM
How can I synchronize music with leds using asm?
Is it also possible to build a miniature fountain without destroying your circuit and leds?


Thanks a lot for your time.
Title: Re: How to synchronize music with led
Post by: pmpnfrsh on February 06, 2005, 09:35:25 AM
Are you talking leds as in Light Emitting Diodes?

Im not quite sure exactly what you want to do and/or how external leds would connect to your computer. However.

If it is the "hard-disc in use" led that you want to synchronize w/ music, the is sure to be a windows api function you could use to manipulate it. (look it up on msdn.microsoft.com)

Once you find that function, you would then have to write the code to play an mp3 file (or whatever format you music is in). In the music-play code you could then call the function to turn that hd light on and off whenever you want.

That is a lot to do. You can get a lot of *detailed* help from msdn.microsoft.com and google.com.

Iduno if you are talking about something completly different - i.e. with external leds. You certainly cant build a minature fountain with the hd light  :lol

Sorry i cant help more
Title: Re: How to synchronize music with led
Post by: donkey on February 06, 2005, 10:12:33 AM
First, since you failed to explain completely the hardware involved I will make a couple of assumptions..

1. The LED's are external, ie not part of your PC
2. You are using MS Windows
3. You are playing either a WAV or MP3 or some other kind of music file on a PC
4. You want the LED's to follow the "beat" of the music and pulse for each "beat"
5. You already have a driver that you can use to send a pulse to the LED's

This is not an easy problem, first you must decide how to detect a "beat", generally this is done using a particular channel frequency and slaving the LED's to that at some predetermined amplitude. For example once the channel reaches a certain decibel level you pulse the LED's. In order to do this you would need to have access to the audio drivers data stream, a difficult proposition. A much easier way is to use WinAmp and it's API to get the spectrum analyzer information and use that as your reference. Track one channel of your choosing and pulse the LED's accordingly. I am not familiar with the WinAmp API other than to control music from my applications but the NullSoft site has full documentation and should be able to answer all your questions.
Title: Re: How to synchronize music with led
Post by: lifewire on February 06, 2005, 01:41:25 PM
synchronizing music with leds is very hard, synchronizing leds on music is somehow easier :toothy

QuoteIf it is the "hard-disc in use" led that you want to synchronize w/ music, the is sure to be a windows api function you could use to manipulate it. (look it up on msdn.microsoft.com)

not really, at least i can't believe that it exists.

what donkey said is true, you can maybe improve it with a (digital) low pass filter to sync on bassdrums and such, in stead of amplitude detection. digital low pass filters can be very easy to implement, usually they are just some delays, multipliers and adders with some feedback stuff.
Title: Re: How to synchronize music with led
Post by: treena_12 on February 07, 2005, 08:23:57 AM
Thanks for all the info and straightening things . Pardon my ignorance. :red
I am required to pass a project on our subject Microprocessor (ICs). This should be  interfaced on the computer using the parallel port and assembly language to make it work. If it's not a bother could you please give me procedures and schematics on how to do it?
Using external  Light Emitting Diodes or light bulbs, I need to create different sequences with the lights that would be synchronized on a song. Now that I realized that programming the song along with the lights would be a difficult task, I'll just play the song with  the programmed sequence of lights. Could you please help me?

Thanks for reading my post.   
Title: Re: How to synchronize music with led
Post by: donkey on February 07, 2005, 11:45:12 AM
Hi treena_12

We have a policy here of not doing peoples homework for them. We can offer suggestions, guidelines and even general information on how to do what you need but that is all. You don't learn anything and generally neither do we so there is no point to it and frankly, it is also dishonest. If you come up with something we would be happy to critique it and to help you debug it. However, if you can find a way to give me the degree instead of yourself, I would be happy to do the work to earn it.