void keyPressed() { switch(key){ case ' ': // toggle the drawing flag - to lift the pen from the surface, virtually drawing = !drawing; break; case 'b': case 'B': // toggle the background flag drawBackground = !drawBackground; break; case 'f': case 'F': // toggle the frequency index display displayFrequencyIndex = !displayFrequencyIndex; break; case 'm': case 'M': // toggle mouse control mouseControl = !mouseControl; break; case 'l': case 'L': // toggle long lines longLines = !longLines; break; case 'h': case 'H': // toggle the help screen //displayHelp = !displayHelp; break; case 'c': case 'C': // toggle color drawing drawColor = !drawColor; break; case 'a': case 'A': // toggle autorotate autoRotate = !autoRotate; break; case 'r': case 'R': //recenter camera camera1.jump(width/2,height/2,-50); camera1.aim(0, 0, 0); } } void mousePressed(){ if(displayHelp){ // if in the help mode, store a new value for the spectrum range int clickedBin = (int) map(mouseX,0,width,0,fftLog.avgSize()); spectrumClickRange[0] = clickedBin; } else { cameraControlPress(); } println("history index: " + historyIndex); } void mouseReleased() { if(displayHelp){ int clickedBin = (int) map(mouseX,0,width,0,fftLog.avgSize()); spectrumClickRange[1] = clickedBin; // reset the range variable // make sure to keep the min-max correct int minVal = (int)min(spectrumClickRange); int maxVal = (int)max(spectrumClickRange); // also within bounds of the spectrum array minVal = max(0,minVal); maxVal = min(maxVal,bins); range[0] = minVal; range[1] = maxVal; println("spectrum range (bins): " + range[0] + " - " + range[1]); } else { //cameraControlRelease(); } } void mouseDragged() { if(!displayHelp){ cameraControlDrag(); } }