How do i get stored Midi to Play back without the notes sounding sustained? How can i get my stored midi notes to play back without sounding sustained like in this video : https://youtu.be/zc1zbwheyE0?t=2m30s. Here is some of my code:

// Callback function to for recording note played is called upon reception of a NoteOn.
void MyHandleNoteOn(byte channel, byte pitch, byte velocity) { 

if ((currentState != STATE_R) || (noteIndex &gt;= MAX_NOTE))
      return;

  // Record the note
  noteList[noteIndex].channel = channel;
  noteList[noteIndex].pitch = pitch;
  noteList[noteIndex].velocity = velocity;
  noteList[noteIndex].deltaT = millis() - lastNoteTime;

  lastNoteTime = millis();
  noteIndex++;

 } 

 void StateMachine(void)
{
  static uint16_t  nextNote;

MIDI.read();   // keep this going as fast as possible and empty buffer all the time

  switch (currentState)
  {
    case STATE_I2P:    // Set up for playback

      nextNote = 0;
      lastNoteTime = millis();
      SwitchState(STATE_P);
      break;

    case STATE_P:      // Play the notes back
   lcd.clear();
 lcd.setCursor(5,0); 
  lcd.print("Playing Recorded Song");
  if (nextNote &gt;= noteIndex) SwitchState(STATE_P2I);  // we are done

       if ((millis() - lastNoteTime) &gt;= noteList[nextNote].deltaT)
       {
         MIDI.sendNoteOn(noteList[nextNote].pitch, noteList[nextNote].velocity, 1); //noteList[nextNote].channel);  // Send the note
        noteOn(0x90,noteList[nextNote].pitch,100);
         nextNote++;
         lastNoteTime = millis();
       }
      break;
   }
You need to store and send out the 'note off' messages in addition to the 'note on' messages.