Modifying Bare Conductive Proximity Code

Hello, brand new to this stuff and hoping someone has some ideas.

I am using a Bare Conductive touch board running the proximity code. Its working as its supposed to but I hope to modify it to better fit my needs.

As the code is written, moving a hand over the sensor starts the track, and moving it over the sensor a second time stops it. I wonder if/how I could modify the code to cue and hold the track only as long as my hand remains over the sensor, stopping playback when my hand moves away.

Is this something that could be accomplished with a change to the existing code? Does this question belong somewhere else?

Any suggesting or help would be great!

the code as-is:

// compiler error handling
#include "Compiler_Errors.h"

// touch includes
#include <MPR121.h>
#include <Wire.h>
#define MPR121_ADDR 0x5C
#define MPR121_INT 4

// mp3 includes
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h> 
#include <SFEMP3Shield.h>

// mp3 variables
SFEMP3Shield MP3player;
byte result;
int lastPlayed = 0;

// touch behaviour definitions
#define firstPin 0
#define lastPin 11

// sd card instantiation
SdFat sd;

// define LED_BUILTIN for older versions of Arduino
#define LED_BUILTIN 13

void setup(){  
 //while (!Serial) ; {} //uncomment when using the serial monitor 
 Serial.println("Bare Conductive Proximity MP3 player");

 if(!sd.begin(SD_SEL, SPI_HALF_SPEED)) sd.initErrorHalt();

 if(!MPR121.begin(MPR121_ADDR)) Serial.println("error setting up MPR121");
 // Changes from Touch MP3
 // this is the touch threshold - setting it low makes it more like a proximity trigger
 // default value is 40 for touch
 // this is the release threshold - must ALWAYS be smaller than the touch threshold
 // default value is 20 for touch

 result = MP3player.begin();

 if(result != 0) {
   Serial.print("Error code: ");
   Serial.println(" when trying to start MP3 player");

void loop(){

void readTouchInputs(){

   // only make an action if we have one or fewer pins touched
   // ignore multiple touches
     for (int i=0; i < 12; i++){  // Check which electrodes were pressed
           //pin i was just touched
           Serial.print("pin ");
           Serial.println(" was just touched");
           digitalWrite(LED_BUILTIN, HIGH);
           if(i<=lastPin && i>=firstPin){
                 // if we're already playing the requested track, stop it
                 Serial.print("stopping track ");
               } else {
                 // if we're already playing a different track, stop that 
                 // one and play the newly requested one
                 Serial.print("playing track ");
                 // don't forget to update lastPlayed - without it we don't
                 // have a history
                 lastPlayed = i;
             } else {
               // if we're playing nothing, play the requested track 
               // and update lastplayed
               Serial.print("playing track ");
               lastPlayed = i;
           Serial.print("pin ");
           Serial.println(" is no longer being touched");
           digitalWrite(LED_BUILTIN, LOW);

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.