class PitchLayer extends Layer { // La courbe Haut: Pitch PitchLayer(PApplet parent) { super(parent); } void setup() { // textFont(maFonte); smooth(); noStroke(); } void draw() { if (Tete > 0) { // println("IndexPitch = " + IndexPitch + " LignesPitch.length = " + LignesPitch.length); if (IndexPitch < LignesPitch.length) { LignePitch = float(split(LignesPitch[IndexPitch], " ")); if (Float.isNaN(LignePitch[0])) { IndexPitch = IndexPitch + 1; } // println("temps = " + temps + " LignePitch[0] = " + LignePitch[0]); if ((temps > LignePitch[0]) && ! Pause) { xApresPitch = FacteurX * (width) * LignePitch[0] / DureeFichier; // if (((xAvantPitch % width) > (xApresPitch % width)) && (IndexPitch < LignesPitch.length - 10) ) { if (((xAvantPitch % height) > (xApresPitch % height)) && (IndexPitch < LignesPitch.length - 10) ) { EffaceEcran(); // if (! FlagBlurPitch) background(0, 0, 0, 0); } if (Float.isNaN(LignePitch[1])) { PitchActuel = PitchMini; IndexPitch = IndexPitch + 1; Trace = false; xAvantPitch = xApresPitch; // println("NaN IndexPitch = " + IndexPitch); } else { PitchActuel = LignePitch[1]; yApresPitch = YPitch(PitchActuel) ; if (Trace && ((xAvantPitch % width) > 0) && FlagLigneHaut) { // stroke(255); // Ligne blanche // stroke(150); // Ligne // strokeWeight(EpaisseurCourbe); // strokeWeight(5); // line(xAvantPitch % width, yAvantPitch, xApresPitch % width, yApresPitch); // line(yAvantPitch + 400, height - (xAvantPitch % height), yApresPitch + 400, height - (xApresPitch % height)); // point(yAvantPitch + 400, height - (xAvantPitch % height)); smooth(); noStroke(); fill(255); ellipse(yAvantPitch + 400, height - (xAvantPitch % height), 3, 3); } xAvantPitch = xApresPitch; yAvantPitch = yApresPitch; Trace = true; IndexPitch = IndexPitch + 1; } } } else Fin = true; // if ((frameCount % AdjustBlurPitch == 0) & FlagBlurPitch) filter(BLUR, 0.572); // > 0.575 if ((temps > DureeFichier) || (Tete == 0)) { Fin =true; background(0, 0, 0, 0); } } else background(0, 0, 0, 0); } }