Actionscript particles – Fountain equalizer

actionscript 3, equalizer, Particles

Here’s a new experiment.
It uses the computeSpectrum method together with a simple particles class i wrote.

I think the effect is graphically very satisfing and personally cannot stop to look at it.
The song is “Aria regina della notte” from Mozart’s “Flauto Magico”.

Tomorrow I’ll post code and sources of this.

Hope you’ll be hypnothized from this as I am.

The picture is not well explaining, you must see this in action.


Ok, sorry for the late but here we are with the source code:

Download the SimpleParticleGenerator and SimpleParticle class zipped togheter, then just use this code to build the equalizer.
I release the code just now because I wanted to wrap the main code in a class too, and maybe add some methods to scale it like a component, but I realized it’s totally unuseful for few lines of code, and I don’t wanna loose the fun part in the experiment.

I promise that from now I will be faster to release the source code :)

// Author: Pierluigi Pesenti
// Web:

import flash.utils.ByteArray;
import flash.display.Sprite;
import flash.filters.GlowFilter;
import com.oaxoa.fx.SimpleParticleGenerator;
import com.oaxoa.components.FrameRater;

var req:URLRequest=new URLRequest("mozart.mp3");
var sound:Sound=new Sound(req);
var ba:ByteArray=new ByteArray();
var samples:uint=32;
var offset:uint=256/samples;

// create a sprite and add 1*samples istances of the SimpleParticleGenerator class
var _holder:Sprite=new Sprite();
for(var i:uint=0; i

Expect more equalizing fun.



  1. Russ  •  Dec 28, 2007 @5:52 pm

    very nice, even though I am not a big opera fan, I watched it all the way through…

  2. Pierluigi Pesenti  •  Dec 28, 2007 @6:07 pm

    Thanks, I am not an opera fan too (only opera Browser :) ) but I was searching for a song to better render the effect.

  3. Ryan  •  Dec 30, 2007 @8:04 pm

    This is so amazing, very hypnotizing indeed… I wonder how long it took you to think of and create this? It’s just so very stunning…

  4. Pierluigi  •  Jan 21, 2008 @8:41 pm

    Do you still plan to post the source code of your effect? I want it! Thanks ;-)

  5. Pierluigi Pesenti  •  Jan 21, 2008 @9:01 pm

    Hey! We have the same name ;)
    Sure I want to release the code, I’ll post it (hope) tomorrow.

  6. Romain  •  Jan 22, 2008 @7:11 pm

    Wrong copy/paste ;-)
    Thanks for the source!

  7. Lamer  •  Jan 25, 2008 @8:52 am

    Where is the code?

  8. Mike Lowry  •  Feb 5, 2008 @5:35 am

    wow great effect… I’d like to learn how you did this.
    But I can’t find the code on your website?

  9. SCaSic  •  Feb 15, 2008 @2:51 pm

    Outstaning. Please share the code. Equalizer is needed.

  10. Thomas Joos  •  Feb 15, 2008 @3:38 pm

    hey dude really nice but I’m also waiting on the source code ;)

    could you please post it on your website please?

    grtz thomas

  11. Lawrence  •  Feb 16, 2008 @7:58 pm

    Very interesting! Stunning visual effect!
    I’d also love to have a look at the code. Please and thank you.

  12. Sprint-Debugger  •  Feb 23, 2008 @9:35 pm

    PLEASE, dude, man, post the coolest actionscript ever made! P L E A S E !!!

  13. zap  •  Mar 4, 2008 @4:51 pm


    where is it?

  14. Pierluigi Pesenti  •  Mar 4, 2008 @4:54 pm
  15. Olivier  •  Apr 1, 2008 @2:08 pm

    Very nice, I would have put a bit more of red into the particles so that it looks like fire but it is already amazing ;)

  16. davidgarcia  •  May 4, 2008 @2:18 am

    hi!!!…….. its an amazing job…. really love it…. i got a question i dont know how what and where to put the code..and which of the three use…… i know i have to change the mp3 name which is the music but besides that ….nothing…. could someone please please help me?????? its in the actions panel or where.. do i have to put someting in the fram or layer ……

  17. Pierluigi Pesenti  •  May 4, 2008 @9:24 am

    simply download the zipped classes and extract them in any folder.

    Then if you use flash CS3 just do these simple steps:
    - open a new fla
    - open “publish settings” panel and in the flash tab near to the “actionscript” combobox press settings.
    - push the crossair button and browse to the folder where u saved the classes.
    - paste the above code in the first frame actions of the newly created fla.
    - compile and enjoy.

    if you use flex builder I am almost sure you know the process, very similar.

  18. davidgarcia  •  May 5, 2008 @3:02 am

    Thank you very much…. i dont know whats goin on …. i did just what you say… and nothing.. i dont know if being a mac affects in somehow??…..

  19. locurnus  •  Sep 20, 2008 @5:19 pm


    did this, but nothing work… do you have another download with ready liked fla, please?

    at all very cool work….

  20. subblue  •  Oct 9, 2008 @8:22 pm

    That’s very nicely done!

  21. Aric  •  Dec 10, 2008 @7:41 am

    Thanks for this, I am working on an assignment for an AS3 class and this helping out a lot.

    One thing I notice is that in my copy only the first 4 bars are generating a particle. Any idea on what this might be. Would it be okay to send my source?

    Thanks again

  22. Pierluigi Pesenti  •  Dec 10, 2008 @7:57 am

    No problems Aric. Send it at: info (put an AT sign here) oaxoa dot com.

  23. viaria  •  Apr 19, 2009 @11:23 pm

    thanks man.. i will follow you..

  24. Pirsey  •  Apr 24, 2009 @12:07 pm

    Hey, cool tips. I’ll buy a glass of beer to that person from that chat who told me to go to your blog :)

  25. Pierluigi Pesenti  •  Apr 24, 2009 @1:25 pm

    Wouldn’t be simpler buy a beer directly to me? :-D

  26. Free MP3 @  •  Apr 29, 2009 @7:05 am

    Wow! what an idea ! What a concept ! Beautiful .. Amazing

  27. Josh  •  May 1, 2009 @6:23 pm

    Pretty good stuff. Nice to see you work in some 5th Element.

  28. Amir  •  Jun 7, 2009 @12:04 am

    good work man.

  29. Alex  •  Jul 6, 2009 @1:43 pm

    Hi, Pierluigi! Your effect is great!!

    I’m learning AS3 at the moment.
    Was trying to figure out how the code works.
    I wanted to make an EQ for both left and right channels, but there were some troubles. ..cant express myself in english well) so here’s the code:

    for (var i:uint=0; i<512; i+=offset) {


    But if I set panning to 1 (so, only right channel would sound), nothing would happen.
    So, after a while, I thought, maybe you read only some first bytes of the byteArray (~(4*samples) of 2048) and its position should be moved every iteration. Maybe like this:


    Thanks again!

    p.s. sorry for my english

  30. Morris  •  Oct 20, 2009 @1:21 pm

    You are fascinating.

  31. jous  •  May 22, 2010 @3:59 pm

    can publish the file. fla

  32. Ronnie Swietek  •  Jul 23, 2010 @6:59 pm

    that is badass

  33. roket  •  May 5, 2011 @2:40 pm

    radio does not work with url streamig
    cs3 works program within the Particles but not compiled into swf

  34. Amit  •  Sep 26, 2011 @10:59 am

    Wicked !!!

2 Trackbacks

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>