/** ** Click each box to trigger the beat. */ import ddf.minim.*; import ddf.minim.analysis.*; int play; int numSongs = 5; Minim minim; AudioPlayer[] song = new AudioPlayer[numSongs]; BeatDetect[] beat = new BeatDetect[numSongs]; BeatListener[] bl = new BeatListener[numSongs]; String[] songNames = { "hiphop05.mp3", "exotic05.mp3", "deephouse06.mp3", "effected04.mp3", "ambient01.mp3"}; color[] beatColors = {#ec008c, #f26522, #00aeef, #95e12f, #f6ff0b}; void setup() { size(800, 600); background(0); frameRate(30); noStroke(); smooth(); minim = new Minim(this); play = 50; textFont(createFont("Helvetica", 12)); textAlign(CENTER); ellipseMode(CENTER); for (int i=0; i width-50) { play = 50; } } void mousePressed() { for (int i=0; i50+i*150 && mouseX < 100+i*150 && mouseY > 400 && mouseY < 450) { fill(beatColors[i]); rect(50+i*150,400,50,50); song[i].rewind(); song[i].play(); } } } void stop() { // always close Minim audio classes when you are finished with them for (int i=0; i