SD/WAV plays song intermittently.

I successfully created a clock the plays a light show at the top of every hour. I used that same code and swapped out the led controls with the SD card reader controls. Some of the code looks odd because of this. The SD card is formatted correctly and the song is in the correct format. It will play on some hours and fail to play on others. It is completely random as far as I can tell. The SD card reader is hooked up to an Arduino Uno and has its own RTC which is set correctly. Can anyone shed some light as to why it will sometimes play the song and sometimes fail?

SD reader is ARM, not a shield. RTC is a DS3231(uses same library as 1307)

#include <Wire.h>                      //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<For Time
#include <stdio.h>

#include <RTClib.h>                    //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<For Time
#include <SD.h>                        //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<For Music
#define SD_ChipSelectPin 10 
#include <TMRpcm.h> 
TMRpcm tmrpcm;                         // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<For Music
RTC_DS1307 RTC;                        //<<<<<<<<<<<<<<<<<<<<<<<<For Time
#define LED_Loop 60
int song_playing;
int mins;
int Q     =  (LED_Loop / 4);
int THREE =  (Q-1);
int SIX =    ((Q * 2)-1);
int NINE =   ((Q * 3)-1);
int TWELVE = ((Q * 4)-1);
int ONE = (LED_Loop/12);    //  Should be 5 if loop = 60
long THIS_LED;
int Led_Flag;
int argh;
int hour_led;
int minute_led;
int second_led;
int new_minute;

void setup() 
  // put your setup code here, to run once:
  delay(2000);          //  This is just to give you time to open the window and watch.
  Serial.println("Setting up");

  if (! RTC.isrunning()) 
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));

  Serial.println("Done setting up");
//  This is where you tell Arduino which pin will be sending your wav file signal to your speaker.
  tmrpcm.speakerPin = 9; //11 on Mega, 9 on Uno, Nano, etc

   if (!SD.begin(SD_ChipSelectPin)) {  // see if the card is present and can be initialized:
    Serial.println("SD fail");  
    return;   // don't do anything more if not
  }"blank.wav"); // Plays this file once during startup (will make terrible noise without this)

void loop() 
    tmrpcm.speakerPin = 9;
  //  Get time
   DateTime now =;
   int hr = now.hour();
   mins = now.minute();        
   second_led = now.second();


   hour_led = (((LED_Loop/12) * hr) + (mins / (LED_Loop/5)))%LED_Loop;  //Leave this or song won't play???<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

   minute_led = mins;

   if (new_minute == 1)


  if (minute_led == 0){
     if (second_led == 0){"04.wav");   //Same song for every hour placed here.

You have a (useless?) delay at the bottom of your code. It will pause your program for 1200 ms.

What happens if now.second() returned 59 when you call it, but less than 200ms later, your RTC updated it to 0, while your program was paused during more than one second? The next call to now.second() will now return 1, not 0. So your condition " if (second_led == 0) " will not be true in this case.