 
 // -----------------------------------------------------------------------------
 
-void handleNotesChanged()
+void handleNotesChanged(bool isFirstNote = false)
 {
     if (midiNotes.empty())
     {


void handleNoteOn(byte inChannel, byte inNote, byte inVelocity)
{
    midiNotes.add(MidiNote(inNote, inVelocity));
    handleNotesChanged();
}

void handleNoteOff(byte inChannel, byte inNote, byte inVelocity)


// -----------------------------------------------------------------------------

inline void handleGateChanged(bool inGateActive)
{
    digitalWrite(sGatePin, inGateActive ? HIGH : LOW);
}

inline void pulseGate()
{
    handleGateChanged(false);
    delay(1);
