<commit_before>EFFECTS['test'] = {

  spawn: function(note) {

    //fake cursor position in 3d scene here to save cycles as accuracy isn't important

    var x = ((INPUT.e.clientX / window.innerWidth) - .5) * window.innerWidth;
    var y = ((INPUT.e.clientY / window.innerHeight) - .5) * -window.innerHeight;

    if(note.channel == 0) {
      var size = (note.velocity + note.note) * Math.random() * 2;
      var b = Math.floor(192 + (Math.random() * 64));
      var r = b - 64;
      var g = b - 64;
      var opacity = .70 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity});
      var geometry = new THREE.CircleGeometry(size, 72);
      geometry.translate(x, y, 0);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .0125;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }

    else if(note.channel == 1) {
      var size = (note.velocity + note.note) * Math.random() * 4;
      var r = Math.floor(128 + (Math.random() * 128));
      var g = r - 64;
      var b = r - 64;
      var opacity = .40 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity, wireframe: true});
      var geometry = new THREE.CircleGeometry(size, 24);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .003;
        mesh.rotation.z -= .03;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }

    else if(note.channel == 2){
      var size = (note.velocity + note.note) * Math.random() * 3;
      var g = Math.floor(128 + (Math.random() * 128));
      var r = g - 64;
      var b = g - 64;
      var opacity = .40 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity, wireframe: true});
      var geometry = new THREE.CircleGeometry(size, 36);
      geometry.translate(x, y, 0);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .003;
        mesh.rotation.z += .03;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }

    else {
      var size = (note.velocity + note.note) * Math.random();
      var g = Math.floor(128 + (Math.random() * 128));
      var r = g;
      var b = g - 64;
      var opacity = .80 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity});
      var geometry = new THREE.CircleGeometry(size, 36);
      geometry.translate(x, y, 0);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .002;
        mesh.scale.x += .01;
        mesh.scale.y += .01;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }
  },

  despawn: function(note) {

  },

  click: function() {
    
  },

  input: function() {

  },

  tick: function() {

  }

};
<commit_msg>Spawn effect throttling test<commit_after>EFFECTS['test'] = {

  vars: {
    last: [Date.now(), Date.now(), Date.now(), Date.now()]
  },

  spawn: function(note) {

    //fake cursor position in 3d scene here to save cycles as accuracy isn't important

    var x = ((INPUT.e.clientX / window.innerWidth) - .5) * window.innerWidth;
    var y = ((INPUT.e.clientY / window.innerHeight) - .5) * -window.innerHeight;



    if(note.channel == 0 && Date.now() - this.vars.last[0] > (SONG.bpm / 8)) {
      this.vars.last[0] = Date.now();
      var size = (note.velocity + note.note) * Math.random() * 2;
      var b = Math.floor(192 + (Math.random() * 64));
      var r = b - 64;
      var g = b - 64;
      var opacity = .70 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity});
      var geometry = new THREE.CircleGeometry(size, 72);
      geometry.translate(x, y, 0);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .0125;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }

    else if(note.channel == 1) {
      var size = (note.velocity + note.note) * Math.random() * 4;
      var r = Math.floor(128 + (Math.random() * 128));
      var g = r - 64;
      var b = r - 64;
      var opacity = .40 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity, wireframe: true});
      var geometry = new THREE.CircleGeometry(size, 24);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .003;
        mesh.rotation.z -= .03;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }

    else if(note.channel == 2){
      var size = (note.velocity + note.note) * Math.random() * 3;
      var g = Math.floor(128 + (Math.random() * 128));
      var r = g - 64;
      var b = g - 64;
      var opacity = .40 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity, wireframe: true});
      var geometry = new THREE.CircleGeometry(size, 36);
      geometry.translate(x, y, 0);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .003;
        mesh.rotation.z += .03;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }

    else if(note.channel == 3) {
      var size = (note.velocity + note.note) * Math.random();
      var g = Math.floor(128 + (Math.random() * 128));
      var r = g;
      var b = g - 64;
      var opacity = .80 + (Math.random() * .2);

      var material = new THREE.MeshBasicMaterial({color: "rgb(" + r + ", " + g + ", " + b + ")", transparent: true, opacity: opacity});
      var geometry = new THREE.CircleGeometry(size, 36);
      geometry.translate(x, y, 0);
      var mesh = new THREE.Mesh(geometry, material);

      SCENE.add(mesh);

      function drop(mesh) {
        mesh.material.opacity -= .002;
        mesh.scale.x += .01;
        mesh.scale.y += .01;
        if(mesh.material.opacity < 0) {
          SCENE.remove(mesh);
        } else {
          setTimeout(function(){
            drop(mesh);
          }, 16);
        }
      }

      drop(mesh);
    }
  },

  despawn: function(note) {

  },

  click: function() {

  },

  input: function() {

  },

  tick: function() {

  }

};

{'fraction_non_alphanumeric': 0.16753329105897274, 'fraction_numerical': 0.026379201014584654, 'mean_word_length': 1.8960705104663973, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 4, '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': '2596219', 'n_tokens_mistral': 2772, 'n_tokens_neox': 2510, 'n_words': 619}