Here not it wat I wanted . I do not hear that sound is
otherwise , here just effects,
import ddf.minim.*;
import ddf.minim.effects.*;
Minim minim;
AudioPlayer groove;
ReverseEffect reffect;
void setup()
{
size(512, 200, P2D);
minim = new Minim(this);
// try changing the buffer size to see how it changes the effect
groove = minim.loadFile("gtoove.mp3", 2048);
groove.loop();
reffect = new ReverseEffect();
groove.addEffect(reffect);
}
void draw()
{
background(0);
stroke(255);
// we multiply the values returned by get by 50 so we can see the waveform
for ( int i = 0; i < groove.bufferSize() - 1; i++ )
{
float x1 = map(i, 0, groove.bufferSize(), 0, width);
float x2 = map(i+1, 0, groove.bufferSize(), 0, width);
line(x1, height/4 - groove.left.get(i)*50, x2, height/4 - groove.left.get(i+1)*50);
line(x1, 3*height/4 - groove.right.get(i)*50, x2, 3*height/4 - groove.right.get(i+1)*50);
}
}
void stop()
{
// always close Minim audio classes when you finish with them
groove.close();
// always stop Minim before exiting
minim.stop();
super.stop();
}
// this is a really straightforward effect that just reverses the order of the samples it receives
// it doesn't sound like how you think ;-)
class ReverseEffect implements AudioEffect
{
void process(float[] samp)
{
float[] reversed = new float[samp.length];
int i = samp.length - 1;
for (int j = 0; j < reversed.length; i--, j++)
{
reversed[j] = samp[i];
}
// we have to copy the values back into samp for this to work
arraycopy(reversed, samp);
}
void process(float[] left, float[] right)
{
process(left);
process(right);
}
}