Please help to turn the flow of my visual. at the moment it's right to left, I need it left to right, i struggle for a week already and can't find the way to do it. I'm pretty new in Processing so will appreciate any help.
Processing Forum is always very helpful. Thank you guys.
Processing Forum is always very helpful. Thank you guys.
- import ddf.minim.*;
import processing.opengl.*;
AudioPlayer track;
Minim minim;
void setup()
{
size(600, 700);
background(0);
stroke(255);
smooth();
minim = new Minim(this);
track = minim.loadFile("info.mp3", 2048);
track.loop();
}
float bpm = 50.2;
float mspb = 60000/bpm;
float x = 0;
float y = 0;
float vertical_scaling = 160;
float column_width = 7;
int time = 0;
void draw()
{
int lapse = millis() - time;
for(int i = 0; i < track.left.size()-1; i++)
{
float column_norm = column_width/2*(1+1.5*x);
float x1 = track.left.get(i)*column_width/2 + (column_norm);
float x2 = track.left.get(i+1)*column_width/2 + (column_norm);
float y1 = height - y/vertical_scaling;
float y2 = height - (y+1)/vertical_scaling;
line(y1, x1, y2, x2);
y++;
}
if (lapse > mspb)
{
time = millis();
x++;
y = 0;
if ((x+1)*column_width > width)
{
x = 0;
background(0);
}
}
}
void stop()
{
// always close Minim audio classes when you are done with them
track.close();
minim.stop();
super.stop();
}
1