Problems with the width
in
Programming Questions
•
6 months ago
Hi, The idea is draw a sheet or score (pentagram) I have two forms, but don't works well, I have one between /*...*/ and the other, the problem is that I can modify the width, I use width-50 but nothing happen, also, the position 32 of the array in the first line don't do it only one time, also in the second line the position 32 to 42 of the array do it more than one time, can I explain me?
Thanks
float[] pitches = {69, 69, 76, 76, 78, 78, 76, 74, 74, 73, 73, 71, 71, 69,
76, 76, 74, 74, 73, 73, 71, 76, 76, 74, 74, 73, 73, 71,
69, 69, 76, 76, 78, 78, 76, 74, 74, 73, 73, 71, 71, 69};
int n = 0;
int b = 0;
float xLoc = 0;
float xLoc2 = 0;
float yLoc = 0; // if I put this don't works
float lineDistY = 100;
void setup(){
size(640,480);
if (n >= pitches.length-1){
n= 0;
}
/*for(int xLoc=0; xLoc<=400; xLoc++){
for(n = 0; n<32; n++){
ellipse(xLoc+70, height-3*pitches[n]-100, 8 , 8);
fill(0);
xLoc += 10.0;
println(pitches.length);
if(xLoc>=pitches[31]){
for(b = 32; b<pitches.length; b++){
ellipse(xLoc2+40, height-3*pitches[b], 8 , 8);
xLoc2 += 10.0;
}
println(pitches[31]);
}
}
} */
for(int xLoc=20; xLoc<pitches[31]; xLoc++){
for(n = 0; n<32; n++){
ellipse(xLoc, height-3*pitches[n], 8 , 8);
xLoc += 20.0;
println(pitches[n]);
}
}
for(int xLoc2=20; xLoc2<width-50; xLoc2++){
for(b = 32; b<pitches.length; b++){
ellipse(xLoc2, height-3*pitches[b]+100, 8 , 8);
xLoc2 += 20.0;
}
}
}
1