Categories
final project interaction lab

make, present & report

as i mentioned before, i was trying to create a space for people to create their own artwork depending on how loud they scream + the frequency. however, i quickly learned that if i want to something inside the space, it shouldn’t be a computer. hence, i started working on the “box” that would have restart/start button and three colors with which you can control what is displayed.

i started with the processing part and had an idea that processing would send the corresponding values regarding color to the Arduino. which vertical stripe was active right now, was dependent on the time. however, that didn’t work really well as then the color choice was awkward + the communication between two was too slow.

however, still, i had some “Arduino-independent” processing code:

import processing.sound.*;
import processing.serial.*;
import osteele.processing.SerialRecord.*;

Serial serialPort;
SerialRecord sender;
SerialRecord receiver;

int rows = 7;
int columns = 8;
int sizeOfPixel = 80;


int startT = 0;
boolean timeRecorded = false;

int [][] arrayOfColors = new int[columns][rows];

AudioIn mic;
Amplitude loudness;
float t = 0;
float currentPosition = 0;
int currentX = 0;
int currentY = 0;

//color stuff
String colorFreqPalette = "white";
boolean colorChosen = false;

//frequency analysis essentials
FFT freqAnalysis;
int frequencies = 1024;
// Define the frequencies wanted for our visualization.  Above that treshold frequencies are rarely atteigned and stay flat.
int freqWanted =  height;
// declare an array to store the frequency anlysis results in
float[] spectrum = new float[freqWanted];
// Declare a drawing variable for calculating the width of the
float circleWidth;

int sizeX = columns*sizeOfPixel;
int sizeY = rows*sizeOfPixel;

//serial communication setup
boolean startButton = false;

void setup() {
  size(640, 640);

  background(255);

  //String serialPortName = SerialUtils.findArduinoPort();
  //serialPort = new Serial(this, serialPortName, 9600);
  ////sender = new SerialRecord(this, serialPort, 8);
  //receiver = new SerialRecord(this, serialPort, 1);

  //input setup
  mic = new AudioIn(this, 0);
  mic.start();

  //loudness
  loudness = new Amplitude(this);
  loudness.input(mic);

  // use the microphone as the input for the analysis
  freqAnalysis = new FFT(this, frequencies);
  freqAnalysis.input(mic);
  startT = millis();
}


void draw() {
  if (colorChosen == true) {
    //if (receiver == 1){
    //  startButton = true;
    //}
    if (startButton == true) {
      t = millis();
      currentPosition = map(t - startT, 0, 10000, 0, width);
      println(t - startT);
      stroke(50);
      //line(currentPosition, 0, currentPosition, height);
      //println(currentX);

      // Adjust the volume of the audio input based on mouse position
      float inputLevel = map(mouseY, 0, height, 1.0, 0.0);
      mic.amp(inputLevel);

      float volume = loudness.analyze();
      int maxCurrentY = int(map(volume, 0, 0.7, 0, 8));

      //fft analyzze
      freqAnalysis.analyze(spectrum);



      float actualColor = 0;

      if (currentX > columns-1) {
        colorChosen = false;
        currentX = 0;
      }
      if (currentY > maxCurrentY-1) {
        currentY = 0;
      }

      actualColor = int(map(spectrum[spectrum.length-1]*8, 0, 0.05, 0, 255));
      arrayOfColors[currentX][currentY] = int(actualColor);
      //println(actualColor);
      matrixDisplay();

      currentY++;
      currentX = int(currentPosition/80);
    }
    else {
    background(255);
    textSize(50);
    fill(0);
    text("Press 's' to start",0, height/2);
    textSize(70);
    fill(255, 0,0);
    text("And scream!",0, height/2+100);
    }
  } else {
    background(255);
    textSize(50);
    fill(0);
    text("Choose the color", 0, height/2 - 50);
    fill(255, 0, 0);
    text("Press 'r' for red", 0, height/2);
    fill(0, 255, 0);
    text("Press 'g' for green",0, height/2 + 50);
    fill(0, 0, 255);
    text("Press 'b' for blue", 0, height/2 + 100);
    currentX = 0;
    currentY = 0;
  }
}


void keyPressed() {
  if (key == 'r') {
    colorFreqPalette = "red";
    colorChosen = true;
  } else if (key == 'g') {
    colorFreqPalette = "green";
    colorChosen = true;
  } else if (key == 'b') {
    colorFreqPalette = "blue";
    colorChosen = true;
  } else if (key == 'i') {
    colorFreqPalette = "ima";
    colorChosen = true;
  } else if (key == 's') {
    startButton = true;
  }
  background(0);
}

void matrixDisplay() {
  for (int i = currentX; i < columns; i++) {
    for (int j = 0; j < rows; j++) {
      if (colorFreqPalette == "red") {
        fill(arrayOfColors[currentX][currentY], 0, 0);
      } else if (colorFreqPalette == "green") {
        fill( 0, arrayOfColors[currentX][currentY], 0);
      } else if (colorFreqPalette == "blue") {
        fill(0, 0, arrayOfColors[currentX][currentY]);
      }
      rect(currentX*sizeOfPixel, currentY*sizeOfPixel, sizeOfPixel, sizeOfPixel);
    }
  }
}

there weren’t many colors available, but also, as i mentioned, the communication between two programs was flawed. so i decided to move on to the Arduino and make it somewhat independent as well.

when i started coding, i realized that my matrix was not really working properly, i had to bend it for it to actually work. i used toothpicks and hot glue to actually do that. so i was mostly “blindly” building my program for a couple of days. however, when i got my matrix to work, it seemed very good. then, i decided to reverse some of the functions: send the values about colorChoice, colorPalette, wether the program is finished or not and the currentStrip value from Arduino to the Processing. that worked well. spent quite a lot of time on some polishing details: to add the “indicator” white line in Arduino, figure out some stuff to save the artwork in a specific place and display it later without manipulating anything inside the computer:

I really liked that at that point my program was basically independent: i could press play in Processing and then people could just randomly enter the space, create the artwork, leave and then take a look at other people’s artwork using ’s’ (for slideshow) key on the computer, but also press ‘q’ (for quit) to continue drawing (and all of these past-created artworks would still be saved and displayed in the “slideshow mode”. 

all in all, the coding part was quite challenging, cause it is the first time I have been working with the matrix. plus, as i initially wanted to use sound (not buttons), i also wasted too much time on struggling with frequencies and things like that.

as for the fabrication part, i have created a box to put all the wiring in, which had laser-cut squares for buttons as well as the place for the matrix (that i ended up not using as the bend amount was too unpredictable). and some circles to get the sound int he loudness sensor.

i also created a massive frame using wood-cutter, fabric (that i sewed on it) and some other stuff that can be seen in the pictures below:

i spent quite a lot of time on that frame as well, and even though it turned out to be a bit confusing for people, i am very proud of it.

the fabric choice was inspired by the overall concept: stripes-drawing. they were vertically hanging (in different colors) just like the artworks created.

as for the stand, i did indeed create a certain part of it, however, most part was already done (I just borrowed it).

btw, why did i give up the sound? a lot of reasons.

  1. i did not find any alternatives to computer microphone in the ER or IT that would benefit my project. i rented the loudness sensor, however, it was not as sensitive as i wanted it to + when i put it in the box it was even worse as it was reading some of the button’s signals. i was trying to find some solutions to that, however there just wasn’t any, and as the deadline was approaching i decided to move on).
  2. frequency reading was too complicated and unpredictable to analyze (even with the computer audio). the amount of hours I spent on trying to solve this issue in the early stages of development is countless.
  3. i decided that even though some of the part of the interaction will be gone, i will still have some other powerful things: slideshow, the space, the buttons + the matrix. so i had both the touching element and visual representation two times.

anyway, as for my takeaways based on the performance:

if i had more time/done something differently i would:

  • put the projector somewhere inside/project not he outside of the space to create a bit less scattered-all-over-the-place piece
  • added more intuitive instructions
  • spent more time on figuring out how to draw each pixel instead of the stripe
  • added more buttons/colors? not sure
  • made slideshow independent of clicking “s”
  • added some saturation to the colors
  • added sound? this one – not sure

even though it did not appear very interesting/engaging to other people (as it seemed in class) I am really proud of the work I’ve done throughout these couple of weeks. i would never have imagined i would be able to do so much work in such a short time! i had a lot of fun fabrication the frame and coding!

examples of the artworks:

noStroke():

the instructions:

code from Processing:

import processing.sound.*;
import processing.serial.*;
import osteele.processing.SerialRecord.*;

int count = 0;
int count1 = 0;
String directory = "/Users/anyazhukova/Desktop/finalProject/finalProject3/data/";

boolean slideShowIsOn = false;

String gallery = "gallery";
String png = ".png";
String fullFileName = "";

Serial serialPort;
SerialRecord serialRecord;

int pixelsVert = 7;
int numberOfStrips = 8;

int sizeOfRect = 150;

int[] receiver = new int[4];

int currentStrip = 0;
int paintingFinishedArduino = 0;
int colorNumber = 0;
int colorPalette = 0;

boolean paintingNeedsToBeSaved = false;

int strip0start = 0;
int strip1start = sizeOfRect;
int strip2start = sizeOfRect*2;
int strip3start = sizeOfRect*3;
int strip4start = sizeOfRect*4;
int strip5start = sizeOfRect*5;
int strip6start = sizeOfRect*6;
int strip7start = sizeOfRect*7;

boolean newFillChosen = false;

//colorPalette: 1 - white, 2 - blue&green, 3 - blue&red, 4 - red&green, 5 - red, 6 - green, 7 - blue
void fillChoose() {
  noStroke();
  if (colorPalette == 1) {
    fill(colorNumber, colorNumber, colorNumber);
  }
  if (colorPalette == 2) {
    fill(0, colorNumber, colorNumber);
  }
  if (colorPalette == 3) {
    fill(colorNumber, 0, colorNumber);
  }
  if (colorPalette == 4) {
    fill(colorNumber, colorNumber, 0);
  }
  if (colorPalette == 5) {
    fill(colorNumber, 0, 0);
  }
  if (colorPalette == 6) {
    fill(0, colorNumber, 0);
  }
  if (colorPalette == 7) {
    fill(0, 0, colorNumber);
  }
  if (colorPalette == 0) {
    fill(0);
  }
}

void strip0display() {
  clear();
  for (int i = 0; i < sizeOfRect*7; i+=sizeOfRect) {
    fillChoose();
    rect(strip0start, i, sizeOfRect, sizeOfRect);
    fill(0);
  }
}

void strip1display() {
  for (int i = sizeOfRect*6; i >= 0; i-=sizeOfRect) {
    fillChoose();
    rect(strip1start, i, sizeOfRect, sizeOfRect);
    fill(0);
  }
}

void strip2display() {
  for (int i = 0; i < sizeOfRect*7; i+=sizeOfRect) {
    fillChoose();
    rect(strip2start, i, sizeOfRect, sizeOfRect);
    fill(0);
  }
}
void strip3display() {
  for (int i = sizeOfRect*6; i >= 0; i-=sizeOfRect) {
    fillChoose();
    rect(strip3start, i, sizeOfRect, sizeOfRect);
    fill(0);
  }
}

void strip4display() {
  for (int i = 0; i < sizeOfRect*7; i+=sizeOfRect) {
    fillChoose();
    rect(strip4start, i, sizeOfRect, sizeOfRect);
  }
}

void strip5display() {
  for (int i = sizeOfRect*6; i >= 0; i-=sizeOfRect) {
    fillChoose();
    rect(strip5start, i, sizeOfRect, sizeOfRect);
  }
}

void strip6display() {
  for (int i = 0; i < sizeOfRect*7; i+=sizeOfRect) {
    fillChoose();
    rect(strip6start, i, sizeOfRect, sizeOfRect);
  }
}

void strip7display() {
  for (int i = sizeOfRect*6; i >= 0; i-=sizeOfRect) {
    if (newFillChosen == true) {
      fillChoose();
    }
    rect(strip7start, i, sizeOfRect, sizeOfRect);
  }
  paintingNeedsToBeSaved = true;
  currentStrip = -1;
}

void displayAnalysis() {
  paintingFinishedArduino = receiver[1];
  if (paintingFinishedArduino != 2) {
    currentStrip = receiver[0];
    colorNumber = receiver[2]*120;
    colorPalette = receiver[3];
    newFillChosen = true;
  }
}


void setup() {
  size(1200, 1050);

  background(0);

  String serialPortName = SerialUtils.findArduinoPort();
  serialPort = new Serial(this, serialPortName, 9600);
  serialRecord = new SerialRecord(this, serialPort, 4);
}

void draw() {
  if (slideShowIsOn == false) {
    for (int i = 0; i < 4; i++) {
      serialRecord.read();
      receiver[i] = serialRecord.values[i];
    }
    displayAnalysis();
    if (currentStrip == 0) {
      fill(0);
      strip0display();
      fill(0);
    } else if (currentStrip == 1) {
      fill(0);
      strip1display();
      fill(0);
    } else if (currentStrip == 2) {
      fill(0);
      strip2display();
      fill(0);
    } else if (currentStrip == 3) {
      fill(0);
      strip3display();
      fill(0);
    } else if (currentStrip == 4) {
      fill(0);
      strip4display();
      fill(0);
    } else  if (currentStrip == 5) {
      fill(0);
      strip5display();
      fill(0);
    } else  if (currentStrip == 6) {
      fill(0);
      strip6display();
      fill(0);
    } else if (currentStrip == 7) {
      fill(0);
      strip7display();
      fill(0);
    }
    if (paintingFinishedArduino == 2 && paintingNeedsToBeSaved == true) {
      fullFileName = directory + gallery + str(count) + png;
      saveFrame(fullFileName);
      count++;
      clear();
      currentStrip = -1;
      paintingNeedsToBeSaved = false;
    }
  }
}

void slideShow() {
  String fileName = gallery + str(count1) + png;
  PImage img;
  img = loadImage(fileName);
  image(img, 0, 0);
}

void keyPressed() {
  if (count1 < count) {
    if (key == 's') {
      slideShowIsOn = true;
      slideShow();
      if (count1 < count-1) {
        count1++;
      }
    }
  }
  if (key == 'q') {
    slideShowIsOn = false;
    clear();
    count1 = 0;
  }
}

code Arduino:

#include <FastLED.h>

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>  // Required for 16 MHz Adafruit Trinket
#endif

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 12  // On Trinket or Gemma, suggest changing this to 1

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 64  // Popular NeoPixel ring size

// When setting up the NeoPixel library, we tell it how many pixels,
// and which pin to use to send signals. Note that for older NeoPixel
// strips you might need to change the third parameter -- see the
// strandtest example for more information on possible values.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define DELAYVAL 0  // Time (in milliseconds) to pause between pixels

#define strip0start 0
#define strip1start 9
#define strip2start 16
#define strip3start 25
#define strip4start 32
#define strip5start 41
#define strip6start 48
#define strip7start 57

int currentStrip = 0;

bool strip0filled = false;
bool strip1filled = false;
bool strip2filled = false;
bool strip3filled = false;
bool strip4filled = false;
bool strip5filled = false;
bool strip6filled = false;
bool strip7filled = false;

bool colorsAssigned = false;
bool paintingFinished = false;
int paintingFinishedForProcessing = 1;

int startButtonCount = 0;

bool buttonStartPressed = false;
int buttonStartPin = 4;

bool buttonRedPressed = false;
int buttonRedPin = 5;

bool buttonGreenPressed = false;
int buttonGreenPin = 6;

bool buttonBluePressed = false;
int buttonBluePin = 7;

#include "SerialRecord.h"

int colorNumber = 0;

SerialRecord writer(4);

int loudnessPin = A0;
int loudness = 0;

//colorPalette: 1 - white, 2 - blue&green, 3 - blue&red, 4 - red&green, 5 - red, 6 - green, 7 - blue
int colorPalette = 0;


void strip0display() {
  for (int i = strip0start; i < strip0start + 7; i++) {  // For each pixel...
    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
      colorPalette = 1;
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
            colorPalette = 2;
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
            colorPalette = 3;
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
      pixels.show();
      delay(200);
            colorPalette = 4;
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
      pixels.show();
      delay(200);
            colorPalette = 5;
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
      pixels.show();
      delay(200);
            colorPalette = 6;
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
      colorPalette = 7;
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
  }
}

void strip1display() {
  for (int i = strip1start; i < strip1start + 7; i++) {  // For each pixel...
    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
      colorPalette = 1;
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
           colorPalette = 2;
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
           colorPalette = 3;
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
      pixels.show();
      delay(200);
           colorPalette = 4;
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
      pixels.show();
      delay(200);
           colorPalette = 5;
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
      pixels.show();
      delay(200);
           colorPalette = 6;
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
      colorPalette = 7;
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
  }
}

void strip2display() {
  for (int i = strip2start; i < strip2start + 7; i++) {  // For each pixel...
    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
        colorPalette = 1;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
        colorPalette = 2;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
        colorPalette = 3;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
        colorPalette = 4;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
        colorPalette = 5;
      pixels.show();
      delay(200);
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
        colorPalette = 6;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 7;
      pixels.show();
      delay(200);
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
  }
}

void strip3display() {
  for (int i = strip3start; i < strip3start + 7; i++) {  // For each pixel...
    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
      colorPalette = 1;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
      colorPalette = 2;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 3;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
      colorPalette = 4;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
      colorPalette = 5;
      pixels.show();
      delay(200);
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
      colorPalette = 6;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 7;
      pixels.show();
      delay(200);
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
  }
}

void strip4display() {

  for (int i = strip4start; i < strip4start + 7; i++) {  // For each pixel...
    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
      colorPalette = 1;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
      colorPalette = 2;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 3;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
      colorPalette = 4;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
      colorPalette = 5;
      pixels.show();
      delay(200);
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
      colorPalette = 6;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 7;
      pixels.show();
      delay(200);
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
  }
}

void strip5display() {

  for (int i = strip5start; i < strip5start + 7; i++) {  // For each pixel...

    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
            colorPalette = 3;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
            colorPalette = 4;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
      colorPalette = 5;
      pixels.show();
      delay(200);
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
            colorPalette = 6;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 7;
      pixels.show();
      delay(200);
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
  }
}

void strip6display() {
  for (int i = strip6start; i < strip6start + 7; i++) {  // For each pixel...
    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
      colorPalette = 1;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
          colorPalette = 2;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
          colorPalette = 3;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
          colorPalette = 4;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
          colorPalette = 5;
      pixels.show();
      delay(200);
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
          colorPalette = 6;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 7;
      pixels.show();
      delay(200);
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
  }
}

void strip7display() {

  for (int i = strip7start; i < strip7start + 7; i++) {
    loudness = analogRead(loudnessPin);
    colorNumber = int(map(loudness, 0, 500, 0, 64));
    if (buttonRedPressed == true && buttonGreenPressed == true && buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, colorNumber));
      colorsAssigned = true;
         colorPalette = 1;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, colorNumber));
      colorsAssigned = true;
         colorPalette = 2;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true && buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, colorNumber));
      colorsAssigned = true;
         colorPalette = 3;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true && buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, colorNumber, 0));
      colorsAssigned = true;
         colorPalette = 4;
      pixels.show();
      delay(200);
    } else if (buttonRedPressed == true) {
      pixels.setPixelColor(i, pixels.Color(colorNumber, 0, 0));
      colorsAssigned = true;
         colorPalette = 5;
      pixels.show();
      delay(200);
    } else if (buttonGreenPressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, colorNumber, 0));
      colorsAssigned = true;
         colorPalette = 6;
      pixels.show();
      delay(200);
    } else if (buttonBluePressed == true) {
      pixels.setPixelColor(i, pixels.Color(0, 0, colorNumber));
      colorsAssigned = true;
      colorPalette = 7;
      pixels.show();
      delay(200);
    }
    writer[0] = currentStrip;
    writer[1] = paintingFinishedForProcessing;
    writer[2] = colorNumber;
    writer[3] = colorPalette;
    writer.send();
    pixels.show();  // Send the updated pixel colors to the hardware.
  }
  if (colorsAssigned == true) {
    currentStrip++;
    colorsAssigned = false;
    paintingFinished = true;
    paintingFinishedForProcessing = 2;

  }
}

int rainbow() {
  while(digitalRead(buttonStartPin) == 1){
    for(long firstPixelHue = 0; firstPixelHue < 16384; firstPixelHue += 256) {
     pixels.setBrightness(20);
    pixels.rainbow(firstPixelHue);
    pixels.show(); 
    }
  }
  pixels.clear();
    currentStrip = 0;
    paintingFinished = false;
    paintingFinishedForProcessing = 1;

  
  return(20);
}
void setup() {
  Serial.begin(9600);
  pinMode(buttonRedPin, INPUT);
  pinMode(buttonGreenPin, INPUT);
  pinMode(buttonBluePin, INPUT);
  pinMode(buttonStartPin, INPUT);

#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif
  // END of Trinket-specific code.

  pixels.begin();  // INITIALIZE NeoPixel strip object (REQUIRED)
}

void loop() {
  if (digitalRead(buttonStartPin) == 0) {
    buttonStartPressed = true;
    pixels.clear();
    currentStrip = 0;
    paintingFinished = false;
    paintingFinishedForProcessing = 1;
  } else {
    buttonStartPressed = false;
  }
  if (digitalRead(buttonRedPin) == 0) {
    buttonRedPressed = true;
  } else {
    buttonRedPressed = false;
  }
  if (digitalRead(buttonGreenPin) == 0) {
    buttonGreenPressed = true;
  } else {
    buttonGreenPressed = false;
  }
  if (digitalRead(buttonBluePin) == 0) {
    buttonBluePressed = true;
  } else {
    buttonBluePressed = false;
  }
  loudness = analogRead(loudnessPin);
  Serial.println(loudness);
  if (currentStrip == 0) {
    pixels.setPixelColor(7, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip0display();
  }

  else if (currentStrip == 1) {
    pixels.setPixelColor(8, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip1display();
  }

  else if (currentStrip == 2) {
    pixels.setPixelColor(23, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip2display();
  }

  else if (currentStrip == 3) {
    pixels.setPixelColor(24, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip3display();
  }

  else if (currentStrip == 4) {
    pixels.setPixelColor(39, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip4display();
  }

  else if (currentStrip == 5) {
    pixels.setPixelColor(40, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip5display();
  }

  else if (currentStrip == 6) {
    pixels.setPixelColor(55, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip6display();
  }

  else if (currentStrip == 7) {
    pixels.setPixelColor(56, pixels.Color(10, 10, 10));
    pixels.show();
    delay(1000);
    strip7display();
    if (paintingFinished == true){
      writer[1] = paintingFinishedForProcessing;
      writer.send();
      delay(4000);
    //  int a = rainbow();
    }
  }
}
Categories
final project interaction lab

proposal essay

Given that my development process is a bit different and even for the “Three project proposals” blogpost I already had quite detailed description of what is needed for this one, I am just going to copy some stuff from there.

  1. “Screaming Gallery”
  2. A place where one can create an artwork using their voice. The purpose of the installation is to reimagine ways to create art and highlight the beauty of uniqueness each of us possesses. Wether it is a uniqueness of one’s voice or the way one could create art. 
  3. The installation going to include a relatively secluded space where the intimacy is reinforced and one can feel free to use (voice analysis) technology to create an artwork using their voice. Inside the space there are going to be some buttons that provide some additional control over what and when is being drawn. The room is going to be equipped with Neopixel matrix/strip that are going to guide a person through the experience and reflect what is being drawn. Outside there is going to be shown a projection of the artwork person is creating on the inside (when the drawing is in process) and when the drawing is done, their artwork is going to be added to the collage of all the artworks created and projected on the surface of the installation or just shown on the computer on the pedestal. 

I am thinking of including kaleidoscope element into my idea as well. At this point I have started working on the preliminary code, which I am going to share in the next blogpost on the final project. 

Categories
final project interaction lab

(three) project proposals

I already mentioned two of my ideas in my previous blogpost, however here i will expand on the strongest idea (as I have already discussed it with a professor) a bit more and provide some sketches. I will discuss three ways in which I am thinking of building this project. 

first, general description:

  1. “Screaming Gallery” 
  2. A place where one can create an artwork using their voice. The purpose of the installation is to reimagine ways to create art and highlight the beauty of uniqueness each of us possesses. Wether it is a uniqueness of one’s voice or the way one could create art. 

The installation going to include a relatively secluded space where the intimacy is reinforced and one can feel free to use (voice analysis) technology to create an artwork using their voice. Inside the space there are going to be some buttons that provide some additional control over what and when is being drawn. The room is going to be equipped with Neopixel matrix/strip that are going to guide a person through the experience and reflect what is being drawn. Outside there is going to be shown a projection of the artwork person is creating on the inside (when the drawing is in process) and when the drawing is done, their artwork is going to be added to the collage of all the artworks created and projected on the surface of the installation or just shown on the computer on the pedestal. 

the three options:

Here, there are three ways all of this could be done:

first way

1. Color  – frequency

2. Position – depends on the time (the running “progress” line going parallel to Y axis and perpendicular to X axis)

3. Shape – controlled with a button (chosen by a person)

4. Size – volume

second way

1. Color – volume

2. Position – chosen randomly (blinking LED indicates the current position)

3. Shape – randomly

4. Size – frequency

third way

1. Color palette – chosen

2. Position – “Progress line”/random

3. Shape – randomly

4. Size – frequency

All of these ways have their upsides and downsides. Throughout the next week I am going to start coding the Processing code and implementing voice analysis to figure out the best way to move forward. 

Some sketches:

Categories
final project interaction lab

preparatory research and analysis

I really liked this “Iamascope” project as it has this element of anticipation: what kind of pattern will it produce when i stand there?? this is very interesting as even though a person does have a certain control over the displayed pattern, there are still some computer-generated details that seem unpredictable hence exciting! Moreover, the music as well adds on to that unpredictability and excitement that comes with interacting with the object. 

Also I realized that my midterm project was similar to Jigsaw in a sense that it was the third type (dynamic – interactive). I mean, of course, we could have done a bit more in terms of various responses, however the intention was there 🙂

Anyway, I digress. 

Some ideas that I have generated while reading:

  • games for people: not sure if i will move forward with any kind of game (in terms of a game that requires 2+ people), however i have an idea of using LEDs and sounds (as well as some sensors maybe to record what people do (I was thinking about giving people the area to completely cover by stepping on it and then who does it faster – wins). So like the shade would be like a drawing force on the floor/wall at which the light is directed. (maybe not shade, maybe it could be some thing that resembles a pen or like a VR thing)
    • attraction: bright LEDs on the floor, cool installation
    • sustaining: competition element
    • relation: want to win again/try again – winning should be quite rewarding
  • “screaming gallery”: build a cardboard box that would have led all over it. Invite a person inside and then maybe it could be a screaming-drawing machine! and then on the outside of the box there would be a projectory of the artwork that a person is “screaming” inside. (some ideas not to forget: add a time limit/stop button, buttons to switch the color of the thing, save all the artworks and display as a collage when no one is in there, can i use projector? maybe add an option to send out the artwork (the name could be put in)) should it be LEDS that the person is drawing on? or maybe the color is going to depend on the position where the person stands/the volume of their scream? (on idea is to divide spaces on the floor corresponding to the areas on the screen? and then each person just going to show the color)
    •  
    •  
    • attraction: cool room, LEDs, maybe some attractive sins
    • sustaining: a person creates its own artwork using unconventional way (they are curious how it works, what are they going to end up with
    • relating: people might want to create different types of artwork
        • so, for this project I am struggling with, of course, finalizing what mechanisms imma be using to draw (is the drawing going to be LED matrix? or should be the whiteboard? How a person going to position where to paint

these two ideas are utilizing “ambient” approach described by Edmond (16). 

both of them are “varying” and “influencing” artworks. 

Shaping Forms by Ernest Edmond is a big one, of course. It is mentioned in the book and, surely, my ideas have a certain similarity to it. 

also the idea that “engagement can grow with experience”. indeed, if the engagement is successfully sustained in the process of interaction, the initial attraction might not be as important. gon note that,