On Android, the mouse position can be outside the sketch bounds because Processing detects touch events for the entire screen, not just the sketch. This causes ArrayIndexOutOfBoundsException for the spectrum examples (NoiseSpectrum and OscillatorSpectrum), so added an extra check to prevent out of bounds access.
On Android, the mouse position can be outside the sketch bounds because Processing detects touch events for the entire screen, not just the sketch. This causes ArrayIndexOutOfBoundsException for the spectrum examples (NoiseSpectrum and OscillatorSpectrum), so added an extra check to prevent out of bounds access.