<commit_before>#include "playsong.h"
//#include "mary.mid.h"

//byte dir = HIGH;
  
void playSong(const uint32_t *const *song)
{
  WaitTime wt[4] = { };

  uint32_t indx[4] = { 0 };

  uint32_t freq[] = {
    song[0] ? getElement(song[0], 0) : DONE,
    song[1] ? getElement(song[1], 0) : DONE,
    song[2] ? getElement(song[2], 0) : DONE,
    song[3] ? getElement(song[3], 0) : DONE,
  };
  
  uint32_t len[] = {
    song[0] ? getElement(song[0], 1) : DONE,
    song[1] ? getElement(song[1], 1) : DONE,
    song[2] ? getElement(song[2], 1) : DONE,
    song[3] ? getElement(song[3], 1) : DONE,
  };

  uint64_t currentTime = 0;
  
  while (!(isDone(freq[0], len[0]) && isDone(freq[1], len[1]) &&
           isDone(freq[2], len[2]) && isDone(freq[3], len[3]))) {
    for (uint8_t d = 0; d < 4; ++d) {
      currentTime = (uint64_t)micros();
      
      if (!isDone(freq[d], len[d])) {
          if (wt[d].nextStep < currentTime) {
            /* Need braces here because pulse is just a macro */
            if (freq[d] != REST)  { pulse(d); }
            wt[d].nextStep = currentTime + (freq[d] = (uint64_t)(getElement(song[d], indx[d])));
          }
        
        if (!wt[d].stopTime) {
          wt[d].stopTime = currentTime + (len[d] = (uint64_t)(getElement(song[d], indx[d] + 1)));
        }

        if (wt[d].stopTime < currentTime) {
          indx[d] += 2;
          wt[d].nextStep = currentTime + (freq[d] = (uint64_t)(getElement(song[d], indx[d])));
          wt[d].stopTime = currentTime + (len[d]  = (uint64_t)(getElement(song[d], indx[d] + 1)));
        }
      }
    }
  }
}
<commit_msg>removed unnecessary comments<commit_after>#include "playsong.h"
  
void playSong(const uint32_t *const *song)
{
  WaitTime wt[4] = { };

  uint32_t indx[4] = { 0 };

  uint32_t freq[] = {
    song[0] ? getElement(song[0], 0) : DONE,
    song[1] ? getElement(song[1], 0) : DONE,
    song[2] ? getElement(song[2], 0) : DONE,
    song[3] ? getElement(song[3], 0) : DONE,
  };
  
  uint32_t len[] = {
    song[0] ? getElement(song[0], 1) : DONE,
    song[1] ? getElement(song[1], 1) : DONE,
    song[2] ? getElement(song[2], 1) : DONE,
    song[3] ? getElement(song[3], 1) : DONE,
  };

  uint64_t currentTime = 0;
  
  while (!(isDone(freq[0], len[0]) && isDone(freq[1], len[1]) &&
           isDone(freq[2], len[2]) && isDone(freq[3], len[3]))) {
    for (uint8_t d = 0; d < 4; ++d) {
      currentTime = (uint64_t)micros();

      if (!isDone(freq[d], len[d])) {
          if (wt[d].nextStep < currentTime) {
            /* Need braces here because pulse is just a macro */
            if (freq[d] != REST)  { pulse(d); }
            wt[d].nextStep = currentTime + (freq[d] = (uint64_t)(getElement(song[d], indx[d])));
          }

        if (!wt[d].stopTime) {
          wt[d].stopTime = currentTime + (len[d] = (uint64_t)(getElement(song[d], indx[d] + 1)));
        }

        if (wt[d].stopTime < currentTime) {
          indx[d] += 2;
          wt[d].nextStep = currentTime + (freq[d] = (uint64_t)(getElement(song[d], indx[d])));
          wt[d].stopTime = currentTime + (len[d]  = (uint64_t)(getElement(song[d], indx[d] + 1)));
        }
      }
    }
  }
}

{'fraction_non_alphanumeric': 0.2066898075102556, 'fraction_numerical': 0.03912906279583465, 'mean_word_length': 2.561797752808989, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4366235', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1271, 'n_words': 241}