Alec Gear PC

From BenningtonWiki
Jump to: navigation, search

Fine Art of Physical Computing, Spring 2014

Class Wiki

Class Website

Alec Gear PC Final


Ongoing Work

Ideas

What if an arduino device could identify say five formants? From here it could produce a sonic and visual representation of these formants using Max and Jitter. This could lead to a physical way of experiencing the physics of timbre.

What if an arduino controller with floor mic inputs decided on average formants within footstep sounds or sounds of the floor resonance of martha hill or margot tenney, (mics placed in basement). Each footstep attack or the decay and resonance of the floor could trigger sounds that come from a plastic cell that I will construct, (possibly lights as well). What if the viewer could have a hand in triggering the vibrations of the cell? There could be a delay, or a single footstep could trigger five or one hundred sonic and visual responses.

Inspiring/Inspired Arduino Projects

An Arduino powered instrument http://www.youtube.com/watch?v=ivcmzzfL1es#t=134 Noisy Arduino Toys http://www.youtube.com/watch?v=q_O23y3vkMQ Sound Tapestry http://vimeo.com/79820006 Tree Rings http://vimeo.com/30501143 Spandex Instruments http://vimeo.com/54882144

"Five Variations of Phonic Circumstances and a Pause" http://prix2013.aec.at/prixwinner/10759/ Tania Candiana's project uses voice recognition technology to translate viewer generated content into sound.


Readings

The Art of Interactive Design

Capitalism capitalizes on art movements and social movements. Always. Corporations follow the people and what influences the people. This distorts the initial ideas into a sticky diluted mess. This mess is woven into a web of buzzwords meant to lure consumers in.

The interactive exchange takes place when one experiences paintings, sculpture, music, theatre, etc. An idea or group of ideas is presented by the artist in some form; this idea is processed by the viewer; the viewer then disengages himself from the work and goes out into the world, manifesting, in a small or large way, some of what he just experienced. This, to me, looks a lot like one interactive cycle. The difference between this and a higher form of interactivity is that the artist who painted the painting can't respond to how the viewer manifested her ideas. It's like receiving a letter that weathered a blizzard to get to you, writing a response, and then never mailing it. Computer interactivity puts the viewer both inside and outside of the painting and gives him the opportunity to converse with the artist.

So, I think the difference between the two is the thing he brings up toward the end of the reading--time-sensitivity in interaction. While I'm totally happy to accept that interaction can be over a long, sustained period of time like the one you describe with the visual and performance art above, it does seem to be significantly different than the computer work in terms of time, as well as in terms of continuing the response (as you mention). KiriS-G 19:18, 25 February 2014 (UTC)

I see developments in visual art before the personal computer as precursors to interactivity. Abstraction and conceptualism gives its viewers a richer range of opportunities for interaction. The processing is more extensive because there is more to interpret in a Pollock painting than in a Medieval era portrait. Is something more interactive if the processing aspect is more complex?

Interactivity allows for a nuanced, personally tailored, art experience. Because the viewer is often in some way engaged. Minuscule individual movements and breaths are much more variable and complex than the ideas of one person.

Objects or environments must be intelligent enough to fully participate with their viewers. This is essentially artificial intelligence. These environments are ghosts of the artist's minds. It's almost as if the first and most intelligent robots (in terms of communication) are artists.

Its important to point out that each of Crawford's steps of interactivity are the responsibility of the artist. What does the viewer bring? A human body. This is much like birth. When you are born the only thing that you have is a human body; the rest is an entirely new interactive world. Experiencing interactive art can be close to being born again. There is the potential for an upheaval of the sensory norms. Those who make interactive art play at being the universe's brain.

I think that Crawford wrongly limits interactivity to two people. If someone writes a book and then someone reads it, the author speaks to the reader, the reader processes what the author has said, and then the reader converses with society as a whole through their newly influenced actions and values. If this person writes a book, or blog post, or has a conversation, then this person continues the chain of interactivity. It is thus that an interactive chain can be started: a conversation with society as a whole.

The Psychopathology of Everyday Things

The nature of our own evolution is changing. As our objects become more and more complex, and we exist in increasingly human made environments, we, instead of only adapting, (and ultimately evolving), within the more complex non human world, become preoccupied with adaptations to the worlds that we create. Designers are deciding what humans will adapt to. If the world was totally human created, we would be learning, and in turn evolving, to better use the systems that we have created and will continue to create to improve upon those systems. At this point, we would essentially be evolving to adapt to ourselves. To me, this would be tragic.

The Bandwidth of Consciousness

Music, animation, and any other time based art that allows the artist to mull over single instants during the making process enter into direct play with the amount that humans can understand in an instant. Karlheinz Stockhausen's experiments with pulse generators in the 1950's played with the phenomenon that when more than 16 pulses occur in one second, we hear the pulses as a single sound, with a timbre defined by the rhythm of the pulses. Stockhausen altered timbre by spacing pulses out into specific rhythms and danced at the limits of “our bandwidth” moving from rhythm to single sound and then back again. Similarly, there are animators who have played with this phenomenon by manipulating frame rate, and the amount of movement that occurs in each frame. I’m realizing now, that in most of what I do, I attempt to dance at the limits of “our bandwidth”.

I wonder how relevant the type of thinking in this paper is to the artist. This paper provided me with concrete scientific theories and evidence that established a dynamic definition of consciousness. This was inspiring. It gave me physiological realities to play with. The author’s compilation of studies that attempted to discern consciousness’s bandwidth in bits was less useful.


Weekly Coding Work

Week 2

Example int 01 : Blinking LED


const int LED = 13; //LED connected to digital pin 13 
                   
void setup () 
{ 
  pinMode(LED, OUTPUT);   //sets the digital pin as output 
  
}

void loop () 
{
  digitalWrite(LED, HIGH);  //turns the LED on 
  delay(1000);              //waits for a second 
  digitalWrite(LED, LOW);   //turns the LED off 
  delay(1000);              //waits for a second
}


Example 02: Turn on LED while the button is pressed

const int LED = 13;    //the pin for the LED 
const int BUTTON = 7;  //the input pin where the pushbutton is connected 

int val = 0;           //val will be used to store the state of the input pin 

void setup() {
  pinMode(LED, OUTPUT); //tell Arduino LED is an output 
  pinMode(BUTTON, INPUT); //and BUTTON is an input 
  
}

void loop(){
  val = digitalRead(BUTTON); //read input value and store it
                        
                        //check whether the input is HIGH (button pressed)
                        if (val == HIGH) {
                          digitalWrite(LED, HIGH); //turn LED on
                        }else {
                          digitalWrite(LED, LOW); 
                        }
} 


Example 03a: Turn on LED while the button is pressed

const int LED = 13;    //the pin for the LED 
const int BUTTON = 7;  //the input pin where the pushbutton is connected 

int val = 0;           //val will be used to store the state of the input pin 
int state = 0;         //0 = LED off while 1 = LED on

void setup() {
  pinMode(LED, OUTPUT); //tell Arduino LED is an output 
  pinMode(BUTTON, INPUT); //and BUTTON is an input 
  
}

void loop() {
  val = digitalRead(BUTTON); //read input value and store it
                        
                        //check whether the input is HIGH (button pressed) and change the state
                        if (val == HIGH) {
                          state = 1 - state;
                        }
                        
                        if (state == 1) {
                          digitalWrite(LED, HIGH); //turn LED on
                        } else {
                          digitalWrite(LED, LOW); 
                        }
} 


Example 03B: Turn on LED when the button is pressed and keep it on after it is released

const int LED = 13;   //the pin for the LED
const int BUTTON = 7; //the input pin where the
                      //pushbutton is connected
int val = 0;     //val will be used to store the state
                 //of the input pin
int old_val = 0; //this variable stores the previous
                 //value of "val"
int state = 0;   //0 = LED off and 1 = LED on
void setup() {
  pinMode(LED, OUTPUT);    //tell Arduino LED is an output
  pinMode(BUTTON, INPUT);  //and BUTTON is an input
}
void loop(){
  val = digitalRead(BUTTON); //read input value and store it
                           
  //check if there was a transition
  if ((val == HIGH) && (old_val == LOW)){
    state = 1 - state;
  }
  old_val = val;  //val is now old, let's store it
  if (state == 1) {
    digitalWrite(LED, HIGH); //turn LED ON
  } else {
    digitalWrite(LED, LOW);
} }


Example 03C: Turn on LED when the button is pressed and keep it on after it is released including simple de-bouncing


const int LED = 13;    //the pin for the LED
const int BUTTON = 7;  //the input pin where the
                       //pushbutton is connected
int val = 0;     //val will be used to store the state
                 //of the input pin
int old_val = 0; //this variable stores the previous
                 //value of "val"
int state = 0;   //0 = LED off and 1 = LED on
void setup() {
  pinMode(LED, OUTPUT);   //tell Arduino LED is an output
  pinMode(BUTTON, INPUT); //and BUTTON is an input
}
void loop(){
  val = digitalRead(BUTTON); //read input value and store it

  //check if there was a transition
  if ((val == HIGH) && (old_val == LOW)){
    state = 1 - state;
delay(10); }
  old_val = val; //val is now old, let's store it
  if (state == 1) {
    digitalWrite(LED, HIGH); //turn LED ON
  } else {
    digitalWrite(LED, LOW);
} }



Week 3

Example 04: Fade an LED in and out like on a sleeping Apple computer


const int LED = 9; //the pin for the LED
int i = 0;         //We’ll use this to count up and down
void setup() {
  pinMode(LED, OUTPUT); //tell Arduino LED is an output
}
void loop(){
  for (i = 0; i < 255; i++) { //loop from 0 to 254 (fade in)
    analogWrite(LED, i);      //set the LED brightness
    delay(10); //Wait 10ms because analogWrite
               //is instantaneous and we would
               //not see any change
  }
  for (i = 255; i > 0; i--) { //loop from 255 to 1 (fade out)
    analogWrite(LED, i); //set the LED brightness
    delay(10);           //Wait 10ms
  }
}


====Example 05: Turn on LED when the button is pressed and keep it on after it is released including simple de-bouncing. If the button is held, brightness changes.====

const int LED = 9;     //the pin for the LED
const int BUTTON = 7;  //input pin of the pushbutton
int val = 0;     //stores the state of the input pin
int old_val = 0; //stores the previous value of "val"
int state = 0;   //0 = LED off while 1 = LED on
int brightness = 128;        //Stores the brightness value
unsigned long startTime = 0; //when did we begin pressing?
void setup() {
  pinMode(LED, OUTPUT);   //tell Arduino LED is an output
  pinMode(BUTTON, INPUT); //and BUTTON is an input
}
void loop() {
  val = digitalRead(BUTTON); //read input value and store it

  //check if there was a transition
  if ((val == HIGH) && (old_val == LOW)) {
    state = 1 - state; //change the state from off to on
                       // or vice-versa
    startTime = millis(); // millis() is the Arduino clock
                          //it returns how many milliseconds
                          //have passed since the board has
                          //been reset.
    //(this line remembers when the button
    //was last pressed)
    delay(10); 
    
  }
  
  //check whether the button is being held down
  if ((val == HIGH) && (old_val == HIGH)) {
    //If the button is held for more than 500ms.
    if (state == 1 && (millis() - startTime) > 500) {
      brightness++; // increment brightness by 1
      delay(10);    // delay to avoid brightness going
                    //up too fast
      if (brightness > 255) { //255 is the max brightness
        brightness = 0; //if we go over 255
                        //let’s go back to 0
} }
}
  old_val = val; //val is now old, let’s store it
  if (state == 1) {
    analogWrite(LED, brightness); //turn LED ON at the current brightness level

  } else {
    analogWrite(LED, 0); //turn LED OFF
} }


Example 06A: Blink LED at a rate specified by the value of the analogue input

const int LED = 13; //the pin for the LED
int val = 0;   //variable used to store the value coming from the sensor

void setup() {
  pinMode(LED, OUTPUT); // LED is as an OUTPUT

}
void loop() {
  val = analogRead(2); // read the value from
                       // the sensor
  digitalWrite(LED, HIGH); // turn the LED on
  delay(val); // stop the program for some time
  digitalWrite(LED, LOW); // turn the LED off
  delay(val); // stop the program for some time
}

Example 06B: Set the brightness of LED to a brightness specified by the value of the analogue input

const int LED = 9;  //the pin for the LED
int val = 0;   //variable used to store the value coming from the sensor

void setup() {
  pinMode(LED, OUTPUT); // LED is as an OUTPUT

}
void loop() {
  val = analogRead(2); //read the value from the sensor
  analogWrite(LED, val/4); //turn the LED on at the brightness set by the sensor
  
delay(10); // stop the program for some time
}

Example 07: Send to the computer the values read from analogue input 0, (serial monitor)

const int SENSOR = 0;  //select the input pin for the
                       //sensor resistor
int val = 0; //variable to store the value coming from the sensor
void setup() {
 Serial.begin(9600); //open the serial port to send data back to the computer at
//9600 bits per second
}
void loop() {
  val = analogRead(SENSOR); //read the value from
                            //the sensor
  Serial.println(val); // print the value to the serial port
  delay(100); //wait 100ms between each send
}

Week 4

Servo Motor Control with an Arduino


#include <Servo.h>      //include the servo library

Servo servoMotor;       //creates an instance of the servo object to control a servo
int servoPin = 2;       //Control pin for servo motor


void setup() { 
  Serial.begin(9600);       //initialize serial communications
  servoMotor.attach(servoPin);  //attaches the servo on pin 2 to the servo object
} 

void loop() 
{ 
  int analogValue = analogRead(A0); //read the analog input 
  Serial.println(analogValue);      //print it

  
  // modifies map function if sensors range is less than 0 to 1023
  int servoAngle = map(analogValue, 0, 1023, 0, 179);

  //move the servo using the angle from the sensor:
  servoMotor.write(servoAngle);                  
}

Servo Sweep


//Sweep
//by BARRAGAN <http://barraganstudio.com> 
//This example code is in the public domain.

#include <Servo.h> 
 
Servo myservo;  //create servo object to control a servo 
                //a maximum of eight servo objects can be created 
 
int pos = 0;    //variable to store the servo position 
 
void setup() 
{ 
  myservo.attach(9);  //attaches the servo on pin 9 to the servo object 
} 
 
 
void loop() 
{ 
  for(pos = 0; pos < 180; pos += 1)  //goes from 0 degrees to 180 degrees 
  {                                  //in steps of 1 degree 
    myservo.write(pos);              //tell servo to go to position in variable 'pos' 
    delay(15);                       //waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=1; pos-=1)     //goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              //tell servo to go to position in variable 'pos' 
    delay(15);                       //waits 15ms for the servo to reach the position 
  } 
}

Week 6

Serial Out using an Arduino

Arduino Code

void setup() {
    Serial.begin(9600);
}
void loop() {
    int analogValue = analogRead(A0) /4;     
    Serial.write(analogValue);        
}

Serial.write results in serial monitor (ASCII)

Serial.write results in CoolTerm (ASCII)

Serial.write results in CoolTerm (Hex)

Processing Code from ITP site

Resulted in the error message: expecting EOF, found 'myPort'

import processing.serial.*;
Serial myPort;        // The serial port
void setup () {
  size(800, 600);        // window size

  // List all the available serial ports
  println(Serial.list());
}
String portName = Serial.list()[4];

myPort = new Serial(this, portName, 9600);
 background(#081640);

void draw () { // nothing happens in draw.  It all happens in SerialEvent()
}
void serialEvent (Serial myPort) {
  // get the byte:
  int inByte = myPort.read(); 
  // print it:
  println(inByte);
}

// at the top of the program:
float xPos = 0;             // horizontal position of the graph
float yPos = height - inByte; // draw the line in a pretty color:

stroke(#A8D9A7);
line(xPos, height, xPos, height - inByte); // at the edge of the screen, go back to the beginning:
  
  if (xPos >= width) {
    xPos = 0; 
    // clear the screen by resetting the background:
    background(#081640); 
  } 
  else {
    // increment the horizontal position for the next reading:
    xPos++;
  }
Processing Code informed by past classes and the Arduino graph tutorial on the Arduino site

import processing.serial.*;

Serial myPort; 
float x = 0;

void setup () {
  size(800, 600);        
  println(Serial.list());
  
  String portName = Serial.list()[4];
  myPort = new Serial(this, portName, 9600);
  
  background(#939390);
}

void draw () {
  
}

void serialEvent (Serial myPort) {
  int inByte = myPort.read(); 
  println(inByte);
  
  float yPos = height - inByte;

stroke(#121212);
line(x, height, x, height - inByte);

if (x >= width) {
    x = 0;
    background(#939390); 
  } 
  else {
    x++;
  }
}

Resulting error message

Attempted using "Tools, Fix the Serial Library" but the operation needs administrator authorization

I went into Terminal.app and attempted the sudo mkdir -p /var/lock operation. Once this is typed, I am told that the sudo command could be harmful to the computer. At this point, the cursor in Terminal.app becomes frozen and I cannot type the rest of what the error message asks me to.

It seems that I need authorization to continue. The next step would be to try it on my computer if my hard drive wasn't fried.

Graph working once I logged out of student and into IT, and once Chris authorized the sudo command in terminal.app

Week 7

Using a transistor to control high current loads with an Arduino

Loop Code
const int transistorPin = 9;    // connected to the base of the transistor

 void setup() {
   // set  the transistor pin as output:
   pinMode(transistorPin, OUTPUT);
 }

 void loop() {
   digitalWrite(transistorPin, HIGH);
   delay(1000);
   digitalWrite(transistorPin, LOW);
   delay(1000);
 }
Variable Speed Code
const int transistorPin = 9;    // connected to the base of the transistor

 void setup() {
   // set  the transistor pin as output:
   pinMode(transistorPin, OUTPUT);
 }

 void loop() {
  // read the potentiometer:
   int sensorValue = analogRead(A0);
   // map the sensor value to a range from 0 - 255:
   int outputValue = map(sensorValue, 0, 1023, 0, 255);
   // use that to control the transistor:
   analogWrite(transistorPin, outputValue);
 }

Initially, Kiri and I had the transistor attached to digital pin8. We couldn't control the motor with the potentiometer and thought that it might be because we were using the map function incorrectly. We did some research (www.jetmore.org/john/blog/2011/09/arduinos-map-function-and-numeric-distribution/). Eventually, we remembered that we needed to use an analogWrite pin. We switched to pin9 and everything went swimmingly.

DC Motor Control Using an H-Bridge

  const int switchPin = 2;    // switch input
  const int motor1Pin = 3;    // H-bridge leg 1 (pin 2, 1A)
  const int motor2Pin = 4;    // H-bridge leg 2 (pin 7, 2A)
  const int enablePin = 9;    // H-bridge enable pin
   const int ledPin = 13;     //led pin 
    void setup() {
    // set the switch as an input:
    pinMode(switchPin, INPUT); 

    // set all the other pins you're using as outputs:
    pinMode(motor1Pin, OUTPUT); 
    pinMode(motor2Pin, OUTPUT); 
    pinMode(enablePin, OUTPUT);
    pinMode(ledPin, OUTPUT);

    // set enablePin high so that motor can turn on:
    digitalWrite(enablePin, HIGH); 
  }
  
   void loop() {
    // if the switch is high, motor will turn on one direction:
    if (digitalRead(switchPin) == HIGH) {
      digitalWrite(motor1Pin, LOW);   // set leg 1 of the H-bridge low
      digitalWrite(motor2Pin, HIGH);  // set leg 2 of the H-bridge high
    } 
    // if the switch is low, motor will turn in the other direction:
    else {
      digitalWrite(motor1Pin, HIGH);  // set leg 1 of the H-bridge high
      digitalWrite(motor2Pin, LOW);   // set leg 2 of the H-bridge low
    }
  }