class PitchLayer extends Layer { // La courbe de Pitch en curveVertex PitchLayer(PApplet parent) { super(parent); } boolean TraceVertex = false; void setup() { } 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; } else { // println("temps = " + temps + " LignePitch[0] = " + LignePitch[0]); if ((temps > LignePitch[0]) && ! Pause) { if (IVertex > 100) { if (TraceVertex) { // pour eviter le retour de la ligne de droite a gauche curveVertex(XVertex, YVertex); endShape(); TraceVertex = false; } IVertex = 0; } XVertex = width * IVertex; XVertex = XVertex / 100; // println("width = " + width); if (Float.isNaN(LignePitch[1])) { PitchActuel = PitchMini; if (TraceVertex) { curveVertex(XVertex, YVertex); endShape(); } TraceVertex = false; // println("NaN IndexPitch = " + IndexPitch); } else { PitchActuel = LignePitch[1]; // Utile pour autre layer // YVertex = YPitch(LignePitch[1]) - ((frameCount - TrameCompteZero)/6) + 180; YVertex = YPitch(LignePitch[1]) - (((frameCount - TrameCompteZero)/6) - 300) * height / 600; IVertex = IVertex + 1; if (TraceVertex) { curveVertex(XVertex, YVertex); } else { smooth(); stroke(255, 255); strokeWeight(1); noFill(); beginShape(); // start controlpoint curveVertex(XVertex, YVertex); curveVertex(XVertex, YVertex); } TraceVertex = true; } IndexPitch = IndexPitch + 1; } } } else Fin = true; if ((temps > DureeFichier) || (Tete == 0)) { Fin =true; background(0, 0, 0, 0); } } else background(0, 0, 0, 0); } }