Hi,
I'm interested in learning to use OpenGL and I had the idea of writing a music visualizer. Can anyone give me some pointers of what elements I'll need and how I should go about learning to do this?
Hi,
I'm interested in learning to use OpenGL and I had the idea of writing a music visualizer. Can anyone give me some pointers of what elements I'll need and how I should go about learning to do this?
From my point of view...check this site: http://nehe.gamedev.net/
really good Information and Tutorials for using OpenGL
Are you trying to write your own audio/music player? Perhaps you should try writing a plugin for an existing player so you can focus on graphics rather than the minutia of codecs, dsp, and audio output devices.
I know WinAMP and Foobar have APIs for visualization plugins. I'm sure Windows Media Player and iTunes also have them. Just pick a media player and start reading. Some of them may even have existing OpenGL plugins from which you can start so you can focus on pure OpenGL.
If you're just after some basic 3D or accelerated 2D then I'd recommend purchasing a copy of Dave Astle's "Beginning OpenGL Game Programming" which covers the basics of OpenGL in C++.
For the music analysis part, you should study the basis of Fourier series, then pick a free implementation of a DFFT (digital fast fourier transform) algorithm.
If you use C++/CLI, here's an example that uses WPF four (fourier that is;) display.
He references this site that has considerable information about what your asking, here's anoutline from the specific page;
How do we split sound into frequencies? Our ears do it by mechanical means, mathematicians do it using Fourier transforms, and computers do it using FFT.
- The Physics of Sound 1.2. Harmonic Oscillator
- Sampling Sounds
- Fourier Analysis
- Complex Numbers
- Digital Fourier Transform
- FFT
Ahhh, I found this a few minutes later, it's a native C++ analyzer. Code included, that should get you off and running.
You can find implementation of FFT algorithms and other useful informations in Numerical Recipes in C book. The book is free AFAIK. There is also Numerical Recipes in C++ book.
My approach for creating BeatHarness (http://www.beatharness.com) :
now you have some nice variables to use in your graphics display. For example, show a picture where the size is multiplied by the bass - this will give you a picture that'll zoom in on the beat. From there on it's your own imagination ! :)