<commit_before>var patch;
var h = 640;
var gridSize = 15;
var w = h / gridSize;

var bg, colors, grid = [];

var cellsClicked;

var setup = function () {
  // start Pure Data
  $.get('patter-synth.pd', function(patchStr) {
    patch = Pd.loadPatch(patchStr);
    Pd.start();
  });

  bg = color(48, 76, 69);
  // start graphics
  colors = [color(242, 227, 148), color(242, 174, 114), color(217, 100, 89), color(140, 70, 70)];

  for (var i = 0; i < gridSize; i++) {
    grid[i] = [];
    for (var j = 0; j < gridSize; j++) {
      grid[i][j] = {clicked:false, color: color(88, 140, 126)};
    }
  }
  createCanvas(h, h);
  stroke(0);
  fill(150);
  smooth();
  cellsClicked = 0;
};

// Drawer function that continuously loops
var draw = function () {
  background(bg);

  stroke(bg);
  for (var i = 0; i < gridSize; i++) {
    for (var j = 0; j < gridSize; j++) {
      fill(grid[i][j].clicked ? grid[i][j].color : 255);
      rect(i*w, j*w, w-1, w-1);
    }
  }
};

var mousePressed = function () {
  grid[Math.floor(mouseX/w)][Math.floor(mouseY/w)].clicked = true;
  cellsClicked++;
  Pd.send('n',[cellsClicked]);
};

var checkGrid = function (grid) {
  console.log(grid);
  return;
};

/*
  |*|*|*|
  |*|*|*|
  |*|*|*|
*/
<commit_msg>trying to make sound work<commit_after>var patch;
var h = 640;
var gridSize = 15;
var w = h / gridSize;

var bg, colors, grid = [];

var cellsClicked;

var setup = function () {
  // start Pure Data
  $.get('patter-synth.pd', function(patchStr) {
    patch = Pd.loadPatch(patchStr);
    Pd.start();
  });

  bg = color(48, 76, 69);
  // start graphics
  colors = [color(242, 227, 148), color(242, 174, 114), color(217, 100, 89), color(140, 70, 70)];

  for (var i = 0; i < gridSize; i++) {
    grid[i] = [];
    for (var j = 0; j < gridSize; j++) {
      grid[i][j] = {clicked:false, color: color(88, 140, 126)};
    }
  }
  createCanvas(h, h);
  stroke(0);
  fill(150);
  smooth();
  cellsClicked = 0;
};

// Drawer function that continuously loops
var draw = function () {
  background(bg);

  stroke(bg);
  for (var i = 0; i < gridSize; i++) {
    for (var j = 0; j < gridSize; j++) {
      fill(grid[i][j].clicked ? grid[i][j].color : 255);
      rect(i*w, j*w, w-1, w-1);
    }
  }
};

var mousePressed = function () {
  grid[Math.floor(mouseX/w)][Math.floor(mouseY/w)].clicked = true;
  cellsClicked++;
  Pd.send('n',[cellsClicked]);
  console.log("clicked");
};

var checkGrid = function (grid) {
  console.log(grid);
  return;
};

/*
  |*|*|*|
  |*|*|*|
  |*|*|*|
*/

{'fraction_non_alphanumeric': 0.2125796178343949, 'fraction_numerical': 0.052547770700636945, 'mean_word_length': 3.0208, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1141430', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1012, 'n_words': 245}