//green curve variables int x; //time float y; //value float [] yArray; //storage of y values boolean outGrid; //is the point outside the grid? float noiseVariation; //variation of the noise //background curve variables float freq; //frequency of the wave float amp; //amplitude of the wave boolean backgroundCurve; //on or off //font variables PFont font; int fontConstant; //graph diminenisions int graphHeight; //the height of the grid int gridSize; //GUI NUMBER_INPUT noiseInput; void setup(){ size(1000,450); //graph dimenisions graphHeight = 400; gridSize = 10; //green curve variables x=1; yArray = new float [width+1]; yArray[0]=0; outGrid=false; //background curve variables backgroundCurve=true; freq=2; amp=10; //1 amp is one grid square amp*=gridSize; //font setup font = loadFont("CourierNewPSMT-37.vlw"); textFont(font,37); fontConstant=30; //GUI noiseInput = new NUMBER_INPUT(150, 405, 60, 100, "%", 2, color (50), color (122), color (0,255,0)); noiseVariation =(graphHeight*noiseInput.return_value())/200; } void draw(){ background(0); stroke(122); //draw x lines int yGrid=0; for (int i=0; i<((graphHeight)/gridSize)+1; i++){ line (0,yGrid,width,yGrid); yGrid+=gridSize; } //draw y lines int xGrid=0; for (int i=0; i<(width/gridSize); i++){ line (xGrid,0,xGrid,graphHeight); xGrid+=gridSize; } //draw background wave if (backgroundCurve==true){ float y1; //previous y value float y2; //current y value pushMatrix(); translate(0,graphHeight/2); stroke(112); for (int i=1; i