Can you hear me?
In the first task for this mission, we will write a Processing sketch that plays an MP3 file and uses the Minim library to access the played samples. We will use this data to write an oscilloscope-like curve. We will then use the fft
class of Minim to calculate the frequency spectrum of the currently played sound and generate a bar graph to visualize it.
Engage Thrusters
Let's give Processing ears:
Create a new Processing sketch and add a
setup()
and adraw()
method.void setup() { } void draw() { }
Add the
import
statements for the Minim library by navigating to Sketch | Import Library ... | minim.Now we need to add an MP3 file to our sketch by navigating to Sketch | Add File ... or by simply dropping it onto the sketch window.
Add an
AudioPlayer
object to your sketch and initialize it in thesetup()
method.import ddf.minim.spi.*; import ddf.minim.signals.*; import ddf.minim.*; import ddf.minim.analysis.*; import ddf.minim.ugens.*; import ddf.minim.effects.*; Minim minim; AudioPlayer...