I've always wondered if it would be possible to make an equalizer visualization in love2d, since I've tried adobe aftereffects and that was just too much headache inducing work. It'd honestly be much easier for me if I could do it in lua or if you can think of another alternate method, go ahead and suggest that.
the kind of thing I'm thinking about is how you see some of those videos where you have different bars that react to specific frequencies in the music. example:
http://www.youtube.com/watch?v=oGgIxtoeFCc
I tried it in the past with SoundData but I just kept getting a white screen with "not responding", I was probably doing it wrong, haha
[hr]
Also, please be light on the terminology as I am no expert with love, just yesterday I found out you could find the width of an image object, haha.
A music equalizer visualization?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: A music equalizer visualization?
hey there,
in an equilizer every single bar represents a specific frequency (or better a range, for example 220Hz-250Hz)
In order to get this information you have to analyse the music on the fly. This is called "fourier transformation"
(see wikipedia for more information)
These calculation can be very fast and efficient (fast fourier - FFT), but still be a big effort.
Handling all these algorithms in lua is some heavy lifting and I don't think this is possible in real time....
If you are still interested, have a look at "LuaFFT"
http://www.mindfarming.de/luafft/
in an equilizer every single bar represents a specific frequency (or better a range, for example 220Hz-250Hz)
In order to get this information you have to analyse the music on the fly. This is called "fourier transformation"
(see wikipedia for more information)
These calculation can be very fast and efficient (fast fourier - FFT), but still be a big effort.
Handling all these algorithms in lua is some heavy lifting and I don't think this is possible in real time....
If you are still interested, have a look at "LuaFFT"
http://www.mindfarming.de/luafft/
Re: A music equalizer visualization?
Well, there's this.
Re: A music equalizer visualization?
Well if you are really intent on coding an equalizer, then there are two solutions I present that are not of the moon, but from a drop of milk.
Milkdrop 2.x, with free testing available from foobar2000's Spheck plugin (Windows)
Or if you take the more open route, a ProjectM visualizer. ProjectM is very similar to Milkdrop -- and is in fact made by the same guy (Ryan Geiss) -- that utilizes the PulseAudio sound server for people on systems using PulseAudio (e.g.Ubuntu) as an audio manager.
If you're really, truly intent on coding an Lua/Love visualization, then the code has to get the sound data from SOMEWHERE and interpret it. I would say target ALSA, OSS or Jack first (if sound data can be extracted from them, might be easier aiming for PulseAudio) and go for what Windows and Mac uses later once you have a working prototype on one of the more open sound solutions. So instead of letting Lua do all the heavy work, other components more specialized handle it and all your little app will do is interpret that output.
Milkdrop 2.x, with free testing available from foobar2000's Spheck plugin (Windows)
Or if you take the more open route, a ProjectM visualizer. ProjectM is very similar to Milkdrop -- and is in fact made by the same guy (Ryan Geiss) -- that utilizes the PulseAudio sound server for people on systems using PulseAudio (e.g.Ubuntu) as an audio manager.
If you're really, truly intent on coding an Lua/Love visualization, then the code has to get the sound data from SOMEWHERE and interpret it. I would say target ALSA, OSS or Jack first (if sound data can be extracted from them, might be easier aiming for PulseAudio) and go for what Windows and Mac uses later once you have a working prototype on one of the more open sound solutions. So instead of letting Lua do all the heavy work, other components more specialized handle it and all your little app will do is interpret that output.
Re: A music equalizer visualization?
well I was able to make something:
though it only works efficiently on smaller sound files, bigger files just show random spazzing lines that don't go with the music at all. at times I have to multiply dt by 2 for the music and visuals to sync, I'm not sure how to fix this.-
- Prole
- Posts: 1
- Joined: Sun Apr 22, 2012 12:25 pm
Re: A music equalizer visualization?
I think I've fixed both the equalizer getting out of sync and needing to sometimes multiply dt by 2.Kingdaro wrote:though it only works efficiently on smaller sound files, bigger files just show random spazzing lines that don't go with the music at all. at times I have to multiply dt by 2 for the music and visuals to sync, I'm not sure how to fix this.
Rather than trying to keep track time to determine what sample the music is up to, you can just do:
Code: Select all
local curSample = music:tell('samples')
Code: Select all
for i=curSample, (curSample+(size-1) / 2) do
local sample = (sound:getSample(i * 2) + sound:getSample(i * 2 + 1)) * 0.5
table.insert(wave,complex.new(sample,0))
end
- Attachments
-
- equalizer.love
- (14.29 KiB) Downloaded 573 times
Who is online
Users browsing this forum: Bing [Bot] and 7 guests