ICM & PCOM_Synthesis

/ 10. 07. 2016
In ICM & PCOM Synthesis workshop, learned about combining between ICM and PCOM. It was impressed and amazing program. Always, I have question about how to move the screen by people’s body or hand. Now, I can see how to make them. After learning this, started think about what kind of work I can make. Below is my work I did before. In order to practice, I used it.

_______________________________________________________________________

______________________________________________________________________

 

// OBJECT
var r = 100;
var g = 132;
var b = 165;
var bug1;
var bug2;
var bug3;
var bug4;

var posX = 0;

var serial; // variable to hold an instance of the serialport library
var sensorValue = 0; // ellipse position

function setup() {

createCanvas(400, 400);
//CREATE OBJECT
bug1 = new Jitter();
bug2 = new Jitter();
bug3 = new Jitter();
bug4 = new Jitter();
serial = new p5.SerialPort(); // make a new instance of serialport library
serial.on(‘list’, printList); // callback function for serialport list event
serial.on(‘data’, serialEvent);// callback for new data coming in
serial.list(); // list the serial ports
serial.open(“/dev/cu.usbmodem1421″); // open a port
}
function fish(fishX, fishY, size, fat, eye) {
//size 150
//FISH BODY1
fill(152,240,233);
noStroke();
ellipse (mouseX+fishX,fishY,size,size*fat/5);

//FISH EYE1
fill(0);
// noStroke();
ellipse (mouseX+fishX+size/5,fishY,eye,eye);

//FISH TAIL1
fill(152,240,233);
// noStroke();
ellipse (mouseX+fishX-size*9/15,fishY,size*2/15,size*2/15);
}
function draw() {

r = map(mouseX, 0, 1200, 0, 255, 80);
background(r,g,b,70);

bug1.move();
bug1.display();
bug2.move();
bug2.display();
bug3.move();
bug3.display();
bug4.move();
bug4.display();
fish(280, 350, 150, 2, 10);
fish(-80, 350, 60, 4, 5);
fish(-140, 50, 100, 1, 7);
fish(0, 100, 60, 3, 6);

backgroundfish2(100,20,70,40);
backgroundfish1(200, 100, 100, 40);
// backgroundfish(100, 60, 50, 40);
backgroundfish1(0, 240, 100, 40);
backgroundfish1(300,220,100,40);
// for(var i =0; i < 5; i++){
// backgroundfish(200, 200+(i*2), 100);
// }

//BUBBLE
var x = random(0, width);
var y = random(0, height);
fill(231,219,153,90);
ellipse(x,y,15,15);

//BUBBLE2
var x = random(0, width);
var y = random(0, height);
fill(180,17,182);
ellipse(x,y,10,10);

//BUBBLE3
var x = random(0, width);
var y = random(0, height);
fill(249,230,100,90);
ellipse(x,y,10,5);
function backgroundfish2(fishX,fishY,fat, height){
fill(255, 255, 255, 60);
noStroke();
ellipse(fishX, fishY,fat, height);

fill(0, 0, 0, 40);
noStroke();
ellipse(fishX-13, fishY, fat*1/14, height*3/8);
ellipse(fishX+42, fishY, fat*3/14, height*3/8);
}
function backgroundfish1(fishX, fishY, fat, height){
fill(255,255,255,60);
noStroke();
ellipse(fishX,fishY,fat,height); // body

fill(0,0,0,90);
noStroke();
ellipse(fishX-23,fishY,fat*1/14,height*1/4); // eye
ellipse(fishX+60,fishY,fat*3/14,height*3/8); // tail

}
}

function Jitter() {
this.x = random(width);
this.y = random(height);
this.diameter = random(10, 100);
this.fill = random (0,124);
this.speed = 2;
this.move = function() {
this.x += random(-this.speed, this.speed);
this.y += random(-this.speed, this.speed);
};

this.display = function() {
fill(255);
ellipse(this.x, this.y, this.diameter, this.diameter);
};
}

// get the list of ports:
function printList(portList) {
for (var i = 0; i < portList.length; i++) {
// Display the list the console:
println(i + ” ” + portList[i]);
}
}

function serialEvent() {
var inString = serial.readLine();
if (inString.length > 0) {
inString = inString.trim();
sensorValue = Number(inString/4);
// println(sensorValue);
}
}

blog

/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

This example code is in the public domain.
*/

// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}

Leave a Reply

Your email address will not be published. Required fields are marked *