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 ?

  • \$\begingroup\$ @anko First of i tried to gain some knowlage about the sound visualisation system through 41post.com/4776/programming/… \$\endgroup\$ – Dimitri mx Feb 12 '13 at 15:20
  • \$\begingroup\$ 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. \$\endgroup\$ – Anko Feb 12 '13 at 15:30

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)

  • \$\begingroup\$ 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 \$\endgroup\$ – Dimitri mx Feb 12 '13 at 15:39
  • \$\begingroup\$ 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. \$\endgroup\$ – Norguard Feb 12 '13 at 16:19
  • \$\begingroup\$ 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 ^^ \$\endgroup\$ – Dimitri mx Feb 12 '13 at 17:42
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Jeremy Rodriguez Feb 16 '13 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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