class MaxFinder extends UGen { float max = 0, min = 0; String id = ""; MaxFinder(AudioContext con, String id) { super(con, 1, 1); this.id = id; } void reset() { max = 0; } public void calculateBuffer() { float[] bi = bufIn[0]; float[] bo = bufOut[0]; Boolean trigprint = false; for(int i = 0; i < bufferSize; i++) { if((bo[i] = bi[i]) > max) { max = bo[i]; trigprint = true; } if(bo[i] < min) { min = bo[i]; trigprint = true; } } if(trigprint) println(id + min + ", " + max); } }