<commit_before><!DOCTYPE html>
<html> 
<head> 
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
  <script type="text/javascript" src="js/howler.min.js"></script>
  <title></title> 
</head> 
<body>
  
  [-] Rest, [s] Snare, [x] Closed HH, [h] Open HH, [b] Bass, [c] Crash, [r] Ride, [t] High Tom, [m] Med Tom, [f] Floor Tom
  
  <script type="text/javascript">
    var sound = new Howl({
      urls: ['public/kit.ogg', 'public/kit.mp3'],
      sprite: {
        kick: [0, 420],
        snare: [453, 434],
        clap: [11383, 157],
        cowbell: [908, 115],
        hiTom: [1360, 602],
        midTom: [1997, 851],
        lowTom: [2894, 839],
        hatOpen: [3756, 955],
        hatClosed: [4734, 130],
        ride: [4911, 962],
        tamb: [5878, 277],
        crash: [6830, 1267],
        splash: [8127, 843],
        china: [9578, 855],
        hiAgogo: [10591, 433],
        lowAgogo: [11095, 273]
      }
    });

    var tempo = 120;
    var pattern = [1,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0];
    
    function playPattern(index) {
      setTimeout(function() {
        console.log(pattern[index]);
        sound.play('snare');
        index++;
        if (index < pattern.length)
          playPattern(index);
      }, 60000/tempo);
    }
    playPattern(0);
  </script>

</body>
</html><commit_msg>much improved, far from complete :)<commit_after><!DOCTYPE html>
<html> 
<head> 
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
  <script type="text/javascript" src="js/howler.min.js"></script>
  <title></title> 
</head> 
<body>
  
  [-] Rest, [s] Snare, [x] Closed HH, [h,o] Open HH, [k,b] Bass, [c] Crash, [r] Ride, [t] High Tom, [m] Med Tom, [f] Floor Tom<br>
  [p] Splash [l] Clap [z] Tamb [i] China [a] Hi Agogo [g] Low Agogo [w] Cowbell
  <p>
    Tempo: <input type="text" id="tempo" value="120" />
    Pattern: <input type="text" id="pattern" value="c--ks--sxskks-k-" />
  </p>
<p>
  Examples:<br>
    smells like teen spirit<br>
      [120] skxkskxkskxks-k-<br>
      [120] c--ks--sxskks-k-<br>
      [120] x-x-s-x-x-x-s-x-<br>
      [120] c-x-s-x-x-x-s-x-<br>
</p>

  <script type="text/javascript">
    var sound = new Howl({
      urls: ['public/kit.ogg'],
      sprite: {
        kick: [0, 420],
        snare: [453, 434],
        clap: [11383, 157],
        cowbell: [908, 115],
        hiTom: [1360, 602],
        midTom: [1997, 851],
        lowTom: [2894, 839],
        hatOpen: [3756, 955],
        hatClosed: [4734, 130],
        ride: [4911, 962],
        tamb: [5878, 277],
        crash: [6830, 1267],
        splash: [8127, 843],
        china: [9578, 855],
        hiAgogo: [10591, 433],
        lowAgogo: [11095, 273]
      }
    });

    note = {
      s: 'snare',
      k: 'kick', b: 'kick',
      x: 'hatClosed', o: 'hatClosed',
      h: 'hatOpen',
      c: 'crash',
      r: 'ride',
      t: 'hiTom',
      m: 'midTom',
      f: 'lowTom',
      
      p: 'splash',
      l: 'clap',
      z: 'tamb',
      i: 'china',
      a: 'hiAgogo',
      g: 'lowAgogo',
      w: 'cowbell',
    }

    function getPattern() {
      return document.getElementById("pattern").value;
    }

    function getTempo() {
      tempo = document.getElementById("tempo").value;
      return tempo*4;
    }

    function playPattern(index) {
      setTimeout(function() {
        pattern = getPattern();
        console.log(pattern[index]);
        sound.play(note[pattern[index]]);
        index++;
        if (index >= pattern.length)
          index = 0;
        playPattern(index);
      }, 60000/getTempo());
    }
    
    playPattern(0);
  </script>

</body>
</html>
{'fraction_non_alphanumeric': 0.19351291918636612, 'fraction_numerical': 0.07531610775151182, 'mean_word_length': 2.1343669250645996, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6216483', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1419, 'n_words': 325}