Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to make a particle system that is activated by sound. Like emitting on the beat resizing on the beat and such things. I found some nice tutorials on how to make things like Windowsmediaplayer visualsynths but they dont really help me to convert it to a particle system.

Anysuggestions how i could do this ?

share|improve this question
    
What have you tried? –  Anko Feb 12 '13 at 15:19
    
@anko First of i tried to gain some knowlage about the sound visualisation system through 41post.com/4776/programming/… –  Dimitri mx Feb 12 '13 at 15:20
    
The example maps data extracted from sound to positions of some squares. What you want to do is map from sound to... well, whatever property of your particle system you'd like it to map to. I suggest trying to understand the example code and adapting it to your purposes. –  Anko Feb 12 '13 at 15:30

1 Answer 1

up vote 2 down vote accepted

You need to read the audio spectrum and get the desired frequencies for example a bass beat would be in the range of 40 - 100 hertz then you can start doing complex algorithms with it but's that's the basics.

You might need to create a optimized version or precomputed particle driver from the audio to do this in real time.

To get the spectrum you'll need to read about discrete Fourier transforms (http://www.fftw.org/, there's probably a C# wrapper around, if not wouldn't be that hard to make one)

share|improve this answer
    
So lets say, i want the particles to move at the speed of the music and resize to the beat(bass) i can filter out the hertz and asign this to the size the link i gave learned me that much but i cant manage to get the speed working. i have litteraly no clue how to read the speed of a song –  Dimitri mx Feb 12 '13 at 15:39
    
BPM of a song is entirely different than generating particles based on velocity/amplitude of any one sample. You've got two options: the first is to just generate a particle any time there is a significant sound (whatever that means to your art-direction/song), or pre-read the track and generate a beat-matching algorithm (how long is the song, how many "significant" beats are there, how easy is it to quantize into groups 3/4/6/8/12/16 evenly-spaced beats, filling in gaps where needed ie: beats-per-measure), then find your BPM. Now you have a rate to fire particles, to modify based on samples. –  Norguard Feb 12 '13 at 16:19
    
i think that i just foccused on the wrong part of the music as i see you explain, i will go and try around some more with the bpm and if i need additional information ill ask ^^ –  Dimitri mx Feb 12 '13 at 17:42
1  
if the song is known you can create a MIDI version out of it (or find it everywhere in the internet) so then you'll have the BPM and all the drums decoupled (to get an acurate particle driver), this is actually a better way to do it. EDIT then on runtime you'll run both songs wav and midi at the same time, the midi version would be the particle driver. –  Jeremy Rodriguez Feb 16 '13 at 10:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.