In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: forked from: MINIMAL

Get Adobe Flash player
by Robbie.Maglone 13 Oct 2015
    Embed
/**
 * Copyright Robbie.Maglone ( http://wonderfl.net/user/Robbie.Maglone )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/o6qL
 */

//////////////////////////////////////////////////////////////

 //                                                          //

 //  Music Visualizer                                        //

 //                                                          //

 //  a quick sketch to do WimAmp-style music visualization   //

 //  using Processing and the Minim Library ...              //

 //                                                          //

 //  (c) Martin Schneider 2009                               //

 //                                                          //

 //////////////////////////////////////////////////////////////

 

 

import ddf.minim.*;

 

Minim minim;

 


AudioRenderer radar, vortex, iso;

AudioRenderer[] visuals;

 

int select;

  

void setup()

{

  // setup graphics

  size(512, 512, P3D);

     

  // setup player

  minim = new Minim(this);

  groove = minim.loadFile("groove.mp3", 1024);

  groove.loop(); 

 

  // setup renderers

  vortex = new VortexRenderer(groove);

  radar = new RadarRenderer(groove);

  iso = new IsometricRenderer(groove);

   

  visuals = new AudioRenderer[] {radar, vortex,  iso};

   

  // activate first renderer in list

  select = 0;

  groove.addListener(visuals[select]);

  visuals[select].setup();

}

  

void draw()

{

  visuals[select].draw();

}

  

void keyPressed() {

   groove.removeListener(visuals[select]);

   select++;

   select %= visuals.length;

   groove.addListener(visuals[select]);

   visuals[select].setup();

}

 

void stop()

{

  groove.close();

  minim.stop();

  super.stop();

}