 
 // -----------------------------------------------------------------------------
 
-void handleGateChanged(bool inGateActive)
+inline void handleGateChanged(bool inGateActive)
 {
     digitalWrite(sGatePin, inGateActive ? HIGH : LOW);
 }
 
-void pulseGate()
+inline void pulseGate()
 {
     handleGateChanged(false);
     delay(1);


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

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

        if (midiNotes.getLast(currentNote))
        {
            tone(sAudioOutPin, sNotePitches[currentNote]);
            
            if (isFirstNote)
            {
                handleGateChanged(true);
            }
            else
            {
                pulseGate(); // Retrigger envelopes. Remove for legato effect.
            }
        }
    }
}
