Any advice on how to repeat the song 6 times instead of infinitely?
Assuming, the program can stop after playing 6 times, put another for loop in the loop function:
void loop() 
{
   for (int nTimes = 0; nTimes &lt; 6; nTimes++)
   {
      // Existing loop code
   } 

   while(true) {};
}

A less crude way is to create a global variable:
int _timesPlayed = 0;

And change the for loop:
void loop() 
{
   if (_timesPlayed &lt; 6)
   {
      // Existing loop code

     _timesPlayed++;
   }
}