The original code does it's thing based on an audio file.
The adapted code (as posted above) does it's thing based on real-time input.
Both codes work as-is. Please clarify what you want.
Do you want to use an audio file (code 1) or play in real-time (code 2).
Ad 1
If all you wanted was to play an audio file, then place your audio file in the /data subdirectory of the sketch. And make sure the name of your file and the loaded file in the code are equal in the line:
Ad 2
Press Copy Code button, paste the code in Processing, press run.
The adapted code (as posted above) does it's thing based on real-time input.
Both codes work as-is. Please clarify what you want.
Do you want to use an audio file (code 1) or play in real-time (code 2).
Ad 1
If all you wanted was to play an audio file, then place your audio file in the /data subdirectory of the sketch. And make sure the name of your file and the loaded file in the code are equal in the line:
- song = minim.loadFile("nameOfYourFile.mp3", 512);
Ad 2
Press Copy Code button, paste the code in Processing, press run.