From Space to Space: Unterschied zwischen den Versionen

Aus hyperdramatik
Wechseln zu: Navigation, Suche
(TEXTILE SENSORS)
(antons)
Zeile 152: Zeile 152:
 
  import controlP5.*;
 
  import controlP5.*;
 
  import processing.serial.*;
 
  import processing.serial.*;
 
+
 
  Serial myPort;
 
  Serial myPort;
 
+
 
  MQTTClient client;
 
  MQTTClient client;
 
  ControlP5 cp5;
 
  ControlP5 cp5;
 
+
 
  String inputPlayerName = "noplayerinput";
 
  String inputPlayerName = "noplayerinput";
 
  String otherplayername;
 
  String otherplayername;
Zeile 166: Zeile 166:
 
  float myBreath = 0;
 
  float myBreath = 0;
 
  float boxSize = 30;
 
  float boxSize = 30;
 
+
 
  void setup() {
 
  void setup() {
 
   size(700, 700, P3D);
 
   size(700, 700, P3D);
Zeile 172: Zeile 172:
 
   client = new MQTTClient(this);
 
   client = new MQTTClient(this);
 
   client.connect("mqtt://anton_self86:58bd19b910910593@broker.shiftr.io", "Anton");
 
   client.connect("mqtt://anton_self86:58bd19b910910593@broker.shiftr.io", "Anton");
 
+
 
   //GUI_Stuff///////////
 
   //GUI_Stuff///////////
 
   cp5 = new ControlP5(this);
 
   cp5 = new ControlP5(this);
Zeile 183: Zeile 183:
 
   myPort.bufferUntil('\n');
 
   myPort.bufferUntil('\n');
 
  }
 
  }
 
+
 
  void draw() {
 
  void draw() {
 
   background(0);
 
   background(0);
Zeile 199: Zeile 199:
 
   delay(100);
 
   delay(100);
 
  }
 
  }
 
+
 
+
 
  /////this is happens of you press the Button ///////
 
  /////this is happens of you press the Button ///////
 
  void Send_Name() {
 
  void Send_Name() {
Zeile 208: Zeile 208:
 
   initPlayer(inputPlayerName);
 
   initPlayer(inputPlayerName);
 
  }
 
  }
 
+
 
  /////MQTT Connect and subscribe////////
 
  /////MQTT Connect and subscribe////////
 
+
 
  void clientConnected() {
 
  void clientConnected() {
 
   println("client connected");
 
   println("client connected");
Zeile 217: Zeile 217:
 
   client.subscribe("/control/");
 
   client.subscribe("/control/");
 
  }
 
  }
 
+
 
  void messageReceived(String topic, byte[] payload) {
 
  void messageReceived(String topic, byte[] payload) {
 
   println("new message: " + topic + " - " + new String(payload));
 
   println("new message: " + topic + " - " + new String(payload));
Zeile 247: Zeile 247:
 
   }
 
   }
 
  }
 
  }
 
+
 
  void connectionLost() {
 
  void connectionLost() {
 
   println("connection lost");
 
   println("connection lost");
 
  }
 
  }
 
+
 
  void serialEvent (Serial myPort) {
 
  void serialEvent (Serial myPort) {
 
   // get the ASCII string:
 
   // get the ASCII string:
 
   String inString = myPort.readStringUntil('\n');
 
   String inString = myPort.readStringUntil('\n');
 
+
 
   if (inString != null) {
 
   if (inString != null) {
 
     // trim off any whitespace:
 
     // trim off any whitespace:
Zeile 265: Zeile 265:
 
   }
 
   }
 
  }
 
  }
 
+
 
  void initPlayer(String name) {
 
  void initPlayer(String name) {
  
Zeile 274: Zeile 274:
 
     }
 
     }
 
   }
 
   }
 
+
 
   if (nameCheck) {
 
   if (nameCheck) {
 
     client.subscribe("/" + name);
 
     client.subscribe("/" + name);
Zeile 290: Zeile 290:
  
 
  /////class for box player objects //////
 
  /////class for box player objects //////
 
+
 
  class PlayerBox {
 
  class PlayerBox {
 
   int rc, gc, bc, size;
 
   int rc, gc, bc, size;

Version vom 11. Mai 2020, 11:37 Uhr

Zeitraum: 5. - 7.05. und 12. - 14.05. jeweils 11:00 - 13:00 und 14:00 bis 16:00 Uhr

Inhalt: Wie können wir aus dem technisch vernetzten Raum in den öffentlichen physikalischen Raum handeln? Welche Verschränkungen ergeben sich, und was ist heute eigentlich noch öffentlicher Raum? Anhand von Verbindungen zwischen dem Privaten häuslichen Raum, dem virtuellen geteilten Raum und dem Ladenlokal in der Zinnowitzer Strasse 7 wollen wir verschiedene Möglichkeiten des Miteinander und für Andere Performens einerseits technisch abbilden, andererseits spielerisch ausprobieren.

Die im ersten Workshop implementierten Schnittstellen zu Arduino werden hier durch komplexere Aktuatoren und Sensoren erweitert und weitere Formen der Kommunikation zwischen den Dingen, unserer Wahrnehmung und unserem Körper werden ausprobiert.

Wir streben eine direkte Kontrolle unterschiedlichster Auswirkungen in das Ladenlokal hinein und aus dem Ladenlokal hinaus an.

Im Rahmen des Workshops wird es konzeptionelle und technische Aufgaben geben, die ausserhalb der Workshopzeit bearbeitet werden sollen.

see also: [VERNETZTE RÄUME]

49809367048_eccc936c8f_z.jpg


DAY_1: PLAYING TOGETHER

PROCESSING--><--MQTT--><--PROCESSING

Shiftr.io

https://docs.shiftr.io/interfaces/mqtt/ https://shiftr.io/


CHALLENGE: write a 2+ player processing sketch

NACHMITTAGS PLAN:

1) alle erstellen shiftr.io account und einen Namespace (think about a name for your namespace.....:-) ((( maybe something like: hannahSPACE, friedrichSPACE..... )))

2) challenge: work by yourself to write a sketch that involves 2 (or more?) players

3) playtest your sketch with others document on wiki (description/anleitung, screenshot, code)

4) go out and enjoy the sun

((( hannah bleibt bis 16:00 online um fragen zu beantworten und kann auch mit helfen spiele testen )))


OUR SKETCHES

DAY_2: GETTING PHYSICAL

((( translating: WORLD —> COMPUTER )))

  • arduino recap
  • reading analog sensors (voltage divider, ADC, internal pull-up)

—> challenge: make your own textile sensor(s) ((( send your sensor data to the network! )))

LUNCH

  • breathe together
  • discuss ideas

—> choose a challenge: make more sensors connect more sensors draw with sensor data

—> document what your sensors + code in a wiki post: http://hyperdramatik.net/mediawiki/index.php?title=From_Space_to_Space


  • = video call

—> = offline working (with chat for questions)


TEXTILE SENSORS

BREATHING BELT (knit stretch sensor) Very simple solution for capturing the movement of the chest or stomach breathing using a stretch sensor knit from a stainless-steel & polyester yarn “sensor yarn”. https://www.kobakant.at/DIY/?p=8171

NEOPRENE BEND SENSOR (also a pressure sensor) This bend sensor actually reacts (decreases in resistance) to pressure, not specifically to bend. But because it is sandwiched between two layers of neoprene (rather sturdy fabric), pressure is exerted while bending, thus allowing one to measure bend (angle) via pressure. https://www.kobakant.at/DIY/?p=20

PAPER MULTI-TOUCHPAD Build our own muti-touch pressure-sensitive touchpads from paper, copper tape and velostat – a carbon impregnated plastic film with piezoresistive properties.

pressure matrix code + circuit: https://www.kobakant.at/DIY/?p=7943

photos: https://www.flickr.com/photos/plusea/albums/72157708415692535


OUR SENSORS + CODE

hannahs

33984536188_30760c37e5_m.jpg

49781644002_ea097aef85_m.jpg

3468358570_e5faecd054_m.jpg


tomás

Tomas bend sensor.png


Tomas breathe sensor1.png


Tomas touchpad.png


leonis

bend_sensor


breathe_sensor


circuit with a sensor and an actuator connected


janne

Touch sensor janne.jpeg

janne

Datei:TouchSensor.jpg


antons

pics:

Processing Code:

import mqtt.*;
import controlP5.*;
import processing.serial.*;

Serial myPort;

MQTTClient client;
ControlP5 cp5;

String inputPlayerName = "noplayerinput";
String otherplayername;
ArrayList<PlayerBox> playerBoxes = new ArrayList<PlayerBox>();
int offSetX = 60;
int offSetY = 100;
boolean nameCheck = true;
float myBreath = 0;
float boxSize = 30;

void setup() {
 size(700, 700, P3D);
 //MQTT_Stuff/////////////
 client = new MQTTClient(this);
 client.connect("mqtt://anton_self86:58bd19b910910593@broker.shiftr.io", "Anton");

 //GUI_Stuff///////////
 cp5 = new ControlP5(this);
 cp5.addTextfield("playername").setPosition(10, 10).setSize(100, 20).setAutoClear(false);
 cp5.addBang("Send_Name").setPosition(110, 10).setSize(80, 20);
 
 ///Arduino ////
 String portName = Serial.list()[0];
 myPort = new Serial(this,portName, 9600);
 myPort.bufferUntil('\n');
}

void draw() {
 background(0);
 boxSize = map(myBreath, 0, 1023, 0, 60);
 client.publish(inputPlayerName, str(int(boxSize)));
 
 
 for (int i = 0; i < playerBoxes.size(); i++) {
   PlayerBox pB = playerBoxes.get(i);
   if (pB.playername.equals(inputPlayerName)){
   pB.setSize(int(boxSize));
   }
   pB.update();
 }
 delay(100);
}


/////this is happens of you press the Button ///////
void Send_Name() {
 nameCheck = true;
 inputPlayerName = cp5.get(Textfield.class, "playername").getText();
 client.publish("/control/", "init");
 initPlayer(inputPlayerName);
}

/////MQTT Connect and subscribe////////

void clientConnected() {
 println("client connected");
 client.subscribe("/player/");
 client.subscribe("/control/");
}

void messageReceived(String topic, byte[] payload) {
 println("new message: " + topic + " - " + new String(payload));
 String pl = new String(payload); 
 
 ///when topic is /control do something/////
 if (topic.equals("/control")) {
   if (pl.equals("init")) {
     for (int i = 0; i < playerBoxes.size(); i++) {
       PlayerBox pB = playerBoxes.get(i);
       client.publish("/player/", pB.playername);
     }
   }
 }
  ///when topic is /player do something/////
 else if (topic.equals("/player")) {
   println("init non local");
   nameCheck = true;
   initPlayer(new String(payload));
 }else{
 
   for (int i = 0; i < playerBoxes.size(); i++) {
   PlayerBox pB = playerBoxes.get(i);
   if ((topic.equals("/" + pB.playername) == true) && topic.equals(pB.playername)== false){
     int bs = int(pl);
     pB.setSize(bs);
   }  
  }
 }
}

void connectionLost() {
 println("connection lost");
}

void serialEvent (Serial myPort) {
 // get the ASCII string:
 String inString = myPort.readStringUntil('\n');

 if (inString != null) {
   // trim off any whitespace:
   inString = trim(inString);
   //println("inString (raw): " + inString);
   myBreath = float(inString);
   //println("myBreath (raw): " + myBreath);
   
 }
}

void initPlayer(String name) {
 for (int i = 0; i < playerBoxes.size(); i++) {
   PlayerBox pB = playerBoxes.get(i);
   if (name.equals(pB.playername)) {
     nameCheck = false;
   }
 }

 if (nameCheck) {
   client.subscribe("/" + name);
   playerBoxes.add(new PlayerBox(20));
   PlayerBox pb = playerBoxes.get(playerBoxes.size() - 1); ///should be last element in List
   pb.setPlayerName(name);
   pb.setPosition(offSetX, offSetY);
   offSetX = offSetX + 120;
   if (offSetX > width - 110) {
     offSetX = 60;
     offSetY = offSetY + 150;
   }
 }
}
/////class for box player objects //////

class PlayerBox {
 int rc, gc, bc, size;
 float spin = 0;
 int xscreen, yscreen;
 String playername;
 PlayerBox(int s) {
   rc = int(random(255));
   gc = int(random(255));
   bc = int(random(255));
   size = s;
 }

 void setPlayerName(String playerN) {
   playername = playerN;
 }

 void setPosition(int x, int y) {
   xscreen = x;
   yscreen = y;
 }
 void setSize(int newSize){
   size = newSize;
 }

 void update() {
   push();
   translate(xscreen, yscreen);
   textSize(30);
   textAlign(CENTER);
   fill(255, 255, 255); 
   text(playername, 0, 80, 0); 
   rotateX(0.3);
   rotateY(spin);
   fill(rc, gc, bc);
   box(size);
   pop();
   spin = spin - 0.05;
  }
}