Storing data into an array (processing.sound)

Seems like you’re filling up the float[] array w/ the same rms_scaled value.

So you don’t need a 2D container. Just a 1D is enough:

final FloatList ampHist = new FloatList();

void draw() {
  final float rmsScaled = rms.analyze() * 330 + 20;
  ampHist.append(rmsScaled);
  print(ampHist.size(), TAB);
}
1 Like