Arduino Live Coding

Fredrik Olofson with his performance Arduino live coding is exploring the sound of serial transmission, by livecoding several arduino's with different programs that write to the serial port and just hooking up the TX pin of the arduino's to a mixer.

Fredrik Olofsson

"being fascinated since long by the sound of serial transmission, i got into trying to make music out of it in some way. by trial-and-error i figured out that if i connect a small speaker to the tx line of an arduino, i could upload programs that send serial data and listen to the sound of it. it is all very basic: if i make the arduino program send data with delays in between, it play click rhythms. and programs with faster streams of data play tones. more elaborate combinations of delays and patterns of data produce chords, melodies and a variety of noises. so it works like some sort of one-bit music system that is nice and challenging to play with."

    byte cnt= 0;
    void setup() {
      Serial.begin(9600);
    }
    void loop() {
      Serial.write(cnt);
      delay(5);
      cnt++;
    }

sound

byte cnt= 0;
void setup() {
  Serial.begin(9600);
}
void loop() {
  for(int i= 0; i<100; i++) {
    Serial.write(cnt++%5+10);
    delay(random(4));
  }
  for(int i= 0; i<200; i++) {
    Serial.write(cnt++%5+10);
    delay(2);
  }
  for(int i= 0; i<100; i++) {
    Serial.write(cnt++%5+10);
    delay(random(4));
  }
  for(int i= 0; i<100; i++) {
    Serial.write(cnt++%5+10);
    delay(3);
  }
  for(int i= 0; i<100; i++) {
    Serial.write(cnt++%5+10);
    delay(4);
  }
  if(random(2)==0) {
    Serial.begin(random(10000));
  }
}

sound

"i think the uploading sound changes subtly depending on program length and i also guess it will change with different arduino bootloaders and whatever baudrate they are using."

sound

"and you also have a bit of control over the timbre of the sounds. certain 8bit numbers are more square-wave like than others e.g. 170 (0b10101010), and 85 (0b01010101) sound more 'clean' and 15 (0b00001111) and 240 (0b11110000) also have a more distinct pitch. different baudrates have a huge effect on the sound - mainly working as frequency transposition."

video

Sources:

Photos, videos, sound excerpts and cited texts (c) by the artist

Creative Commons License
Digital Audio Out of the Box by Marije Baalman is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.