{ pitch: 1, length: 4, isRest: false},
{ pitch: 2, length: 4, isRest: false},
{ pitch: 3, length: 4, isRest: false},
{ pitch: 4, length: 4, isRest: false},
{ pitch: 3, length: 4, isRest: false},
{ pitch: 2, length: 4, isRest: false},
{ pitch: 1, length: 4, isRest: false},
{ pitch: 0, length: 4, isRest: true},
{ pitch: 3, length: 4, isRest: false},
{ pitch: 4, length: 4, isRest: false},
{ pitch: 5, length: 4, isRest: false},
{ pitch: 6, length: 4, isRest: false},
{ pitch: 5, length: 4, isRest: false},
{ pitch: 4, length: 4, isRest: false},
{ pitch: 3, length: 4, isRest: false},
{ pitch: 0, length: 4, isRest: true},
{ pitch: 1, length: 4, isRest: false},
{ pitch: 0, length: 4, isRest: true},
{ pitch: 1, length: 4, isRest: false},
{ pitch: 0, length: 4, isRest: true},
{ pitch: 1, length: 4, isRest: false},
{ pitch: 0, length: 4, isRest: true},
{ pitch: 1, length: 4, isRest: false},
{ pitch: 0, length: 4, isRest: true},
{ pitch: 1, length: 4, isRest: false},
{ pitch: 2, length: 4, isRest: false},
{ pitch: 3, length: 4, isRest: false},
{ pitch: 4, length: 4, isRest: false},
{ pitch: 3, length: 4, isRest: false},
{ pitch: 2, length: 4, isRest: false},
{ pitch: 1, length: 4, isRest: false},
{ pitch: 0, length: 4, isRest: true},
colorMode(HSB, int(list.length / measure), 100, 100, 100);
const tileCount = list.length;
const unitX = width / tileCount;
const unitY = height / tileCount;
for (let gridY = 0; gridY < tileCount; gridY++) {
for (let gridX = 0; gridX < tileCount; gridX++) {
let posX = unitX * gridX;
let posY = unitY * gridY;
let groupYIndex = Math.floor(gridY / measure);
stroke(groupYIndex, 50, 80, 60);
let groupXIndex = Math.floor(gridX / measure);
noteIndex = (gridX + (groupYIndex * measure * 2)) % list.length;
let note = list[noteIndex];
strokeWeight(note.pitch * 3);
let patternType = int(random(0,2));
line(posX - overLine, posY - overLine, posX + unitX + overLine, posY + unitY + overLine);
line(posX - overLine, posY + unitY + overLine, posX + unitX + overLine, posY - overLine);
if (millis() - lapse > 400){
save("img_" + month() + '-' + day() + '_' + hour() + '-' + minute() + '-' + second() + ".jpg");