Multiple Velocity Sensitive Piezos!

Oops... I forget to use the 'piezo' array for the pin numbers. It was reading A0, A1, A2, and A3. Try this version:

#include <MIDI.h>

const int InputCount = 4;
int piezo[InputCount] = {A9, A10, A11, A12};
int note[InputCount] = {50, 51, 52, 53};

const int threshold = 50; //anything over fifty means we've hit the piezo

void setup() {
  MIDI.begin(1);
}

void loop() {
  for(int i=0; i<InputCount; i++) {
    int sensorReading = analogRead(piezo[i]);
    if (sensorReading >= threshold) {
      int maxPiezoVal = getMaxVal(piezo[i], sensorReading);
      byte velocity = map(maxPiezoVal, 0, 1023, 0, 127);//velocity between 50 and 127 based on max val from piezo
      MIDI.sendNoteOn(note[i], velocity, 1);
      delay(10);
      MIDI.sendNoteOff(note[i], 0, 1);
      delay(100);
    }
  }
}

int getMaxVal(int pin, int lastVal) {
  int currentVal = analogRead(pin);
  while (currentVal>lastVal){
    lastVal = currentVal;
    currentVal = analogRead(pin);
  }
  return lastVal;
}