Skip to content

Instantly share code, notes, and snippets.

View sfm1234's full-sized avatar

SamFM sfm1234

View GitHub Profile
@sfm1234
sfm1234 / arduino_firmware.cpp
Created September 13, 2022 15:28 — forked from atduskgreg/arduino_firmware.cpp
send multiple values over serial from Processing to Arduino
int currentValue = 0;
int values[] = {0,0};
void setup() {
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
function l_system (productions, depth, s) {
if (depth === 0) return s;
return $.map(s, function (v) {
return l_system(productions, depth - 1, productions(v) || [v]);
});
}
function run_turtle (turtle, operations, commands) {
$.each(commands, function (_, c) {
(operations[c] || $.noop)(turtle);
/*
An implementation of the Bjorklund algorithm in JavaScript
Inspired by the paper 'The Euclidean Algorithm Generates Traditional Musical Rhythms'
by Godfried Toussaint

This is a port of the original algorithm by E. Bjorklund which I
found in the paper 'The Theory of Rep-Rate Pattern Generation in the SNS Timing Systems' by
E. Bjorklund.