adding servo code to existing midi sketch

Hello, my project involves using a servo to position a solenoid to play various objects. I have a piece of Mike’s midi code that I have adapted so that 8 chosen midi notes will work the solenoid. The difficulty is knowing how to incorporate the servo code that I have. In the sketch I have an array for the servo’s positions and I would like to know the best way to correspond them with the midi notes. Thanks…

// MIDI Light Show - Mike Cook

#include <MIDI.h>
#include <Servo.h>

MIDI_CREATE_DEFAULT_INSTANCE();
byte servoPos[] = {131, 133, 135, 137, 139, 141, 143, 145};
byte sol[] = {9}; // solenoid on pin 9
byte minPitch = 60, maxPitch = 67; // pitch range to respond to

Servo servo1;


void setup()
{
  servo1.attach(7);
  MIDI.begin(1);
  for (int i = 0; i < 8; i++) {
    pinMode(sol[i], OUTPUT);
    //servo1.write(servoPos[i]);
  }

  // Connect the HandleNoteOn function to the library, so it is called upon reception of a NoteOn.
  MIDI.setHandleNoteOn(HandleNoteOn);
  MIDI.setHandleNoteOff(HandleNoteOff);
  servo1.attach(7);
}


void loop() {
  MIDI.read();
}

void HandleNoteOn(byte channel, byte pitch, byte velocity)

{
  if (pitch >= minPitch && pitch <= maxPitch ) {
    if (velocity == 0) digitalWrite(sol[pitch - minPitch], LOW);
    else digitalWrite(sol[pitch - minPitch], HIGH);
  }
}

void HandleNoteOff(byte channel, byte pitch, byte velocity) {
  if (pitch >= minPitch && pitch <= maxPitch) {
    digitalWrite(sol[pitch - minPitch], LOW);
  }
}

Made an important discovery and tried this in the first IF statement... servo1.write(servoPos[pitch - minPitch]); and I have it now!