// stage ----------------------------------------------------------------------- class stage { int n = 6; // scala float off; // filter position // box ----------------------------------------------------------------------- void scala() { colorMode(RGB, 255); textFont(univers, 12); //textSpace(OBJECT_SPACE); textAlign(LEFT); rectMode(CORNER); if (showbgimage) {image(vimage.c, 0, 0);} for(int i = 0; i < n; i++) { pushMatrix(); translate(0, 0 ,i * 255/n * d); pushMatrix(); rotateX(-rxnum); fill(255, i * 100/(n-1) + 50); text(int(i*(max-min)/n) + min + " dB", imgwidth+10 , 18/2); popMatrix(); noFill(); stroke(255, i * 100/(n-1) + 50); rect(0, 0, imgwidth, imgheight); popMatrix(); } } // frequency box ----------------------------------------------------------------------- void freqscala() { colorMode (HSB, 360, 100, 100, 100); textFont(univers, 12); //textSpace(OBJECT_SPACE); textAlign(LEFT); rectMode(CORNER); if (showbgimage) {image(vimage.c, 0, 0);} for(int i = 0; i < img.length; i++) { pushMatrix(); translate(0, 0 ,i*o); pushMatrix(); rotateX(-rxnum); fill(convertHSB(i, img.length), 100, 100); text(mydisplay.frequencies[i] + " Hz", imgwidth+10 , 18/2); popMatrix(); if (i != count) { stroke(0, 0, i * 50/img.length + 10); } else { stroke(0, 0, 100); } noFill(); rect(0, 0, imgwidth, imgheight); popMatrix(); } } // dB layer ------------------------------------------------------------------ void layer() { if (abs(off-offnum) > 0.01) { off -= (off-offnum)/1.5; }; pushMatrix(); translate(0, 0, off * d); pushMatrix(); stroke(255); fill(0, 200); rect(0, 0, imgwidth, imgheight); popMatrix(); translate(imgwidth + 10, imgheight); pushMatrix(); fill(255); textFont(univers, 13); rotateX(-rxnum); text(int(off*(max-min)/255) + min + " dB",0 ,0 ); popMatrix(); popMatrix(); } }