Online Sequencer Forums

Full Version: ELEMENTARY CELLULAR AUTOMATON?! RULE 60?!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Code:
var cellsList = [
   [1]
];
var noteTotal = '60:0 ' + piano[36] + ' 1 13;'
var rule = 60;
while (cellsList.length < 64) {
   var time = cellsList.length;
   cellsList.push([]);
   var currentCells = cellsList[time];
   var pastCells = [0, 0].concat(cellsList.slice(-2, -1)[0], [0, 0]);
   for (var i = 0; i < time * 2 + 1; i++) {
       if (2 ** parseInt(pastCells.slice(i, i + 3).join(''), 2) & rule) {
           currentCells.push(1);
           noteTotal += time + ' ' + piano[36 + i - time] + ' 1 13;'
       } else currentCells.push(0)
   }
}
loadData(noteTotal)
Rule 34 for all the "Lucent"s out there.
Rule 30?
(08-05-2018, 09:14 PM)korwynkim Wrote: [ -> ]Rule 30?