     digitalWrite(bpmLed, HIGH);
   }
 
+  if (realtimebyte == START) {
+    playing = true;
+    changeMode(SONG_MODE);
+  }
+
   if (realtimebyte == STOP) {
     digitalWrite(bpmLed, LOW);
-  }
-}
-
-
+    playing = false;
+  }
+}
+
+

const byte UNCONFIGURED = 0;
const byte NORMAL_MODE = 1;
const byte INIT_MODE = 2;
const byte modeCount = 3;
byte mode = UNCONFIGURED;

byte initBank = 0;

    case INIT_MODE:
      handleInitMode();
      break;
    case SONG_MODE:
      handleSongMode();
      break;
  }
}

void handleSongMode() {
  if (playing) {
    playButton.turnLedOn();
  } else {
    playButton.turnLedOff();
  }

  if (stopButton.isJustPressed()) {
    stopButton.turnLedOn();
  }

  if (stopButton.isJustReleased()) {
    midiNoteSendStart = 0;
    midiNoteToSend = STOP_MIDI_NOTE;
    stopButton.turnLedOff();
    changeMode(NORMAL_MODE);
  }

  sendMidiNote();
}

void changeMode(byte newMode) {
  mode = newMode;
  resetLeds();
  if (mode == NORMAL_MODE) {
    handleNormalMode(true);
  }
}

