WAV file sampling........

Hi, I'm relatively new to programming. Have bought several books on C++ and I'm awash in terminology and conventions....Read tutorial on opening a window and it had like 15.6 billion lines of code (Converted to light years, equals age of the universe......). So, I figured I need help, badly.......LOL

Basically I'm hoping someone can show me a fairly simple way to open a WAV file and derive the frequency of the sample and it's amplitude....

What I want to do is take those values and use them to manipulate, say some image file about the size of a desktop icon.

Let's say I take the frequencies of the bass guitar and have the image move up and down, depending on the frequency being played. (And perhaps left to right if I can seperate the frequencies of each string.) Then according to how loud the sound is, vary the brightness of the image. Basically change it's properties according to the sound being played.

So, if I can figure out how one frequency is isolated, it's a simple matter of changing the values of the code, right? I would build a seperate filter for each frequency range, eventually.

So, just some basic info,( I hope) on how to isolate the bass frequencies, I'm sure would allow me to break the code into smaller chunks and into higher ranges........

I realize frequencies for various instruments and vocals are fall into similar ranges, but the louder frequencies will dominate the in the filter and be represented in the image..... (I think........LOL)

TIA
First, get the .wav file description (should be on www.wotsit.org). Open and read the file into main memory. Then you can perform a (discrete) Fourier transform of the raw wav data, getting access to the frequencies (you'll have to perform that for a given time interval, which should be dependent on the bpm of the music. You could try to deduce that from a transform of the whole file, but that's a science in itself. Furthermore, for the fast Fourier transform, the number of samples has to be a power of two - otherwise you can't evaluate the polynomials at the multiples of the n-th primitive root of unity in O(n log n), which is the crucial factor of the FFT.) The "amount" of a given frequency (in a given time frame) is then directly available in the transformed data for that frame.
Thanks for the reply, but I have very little idea of what you're talking about. LOL. I went to wotsit, can't find any files that talk about getting access to frequencies. I guess I have gotten as far as understanding that each sample is only a portion of what is eventually sent to the sound card or something. I guess I'll try looking for FFT source code or something.......
Topic archived. No new replies allowed.