Outils pour utilisateurs

Outils du site


wiki:projets:motif-generatif:accueil

⟁ A FINIR ⟁

MOTIF VIVANT GÉNÉRATIF

Porteur du projet : GUYOMARCH Maxime
Date : Mai 2019
Contexte :Réalisation d'une oeuvre interactive

INTENTION :

Le motif est toujours vu comme fixe, une image variant peu et se répétant à l'infini. L'intention de ce projet est de créer un motif dynamique, changeant, répondant à d'autres variable que la seule intention de son auteur. Le motif réagit à des capteurs détectant les mouvements et la distance vis à vis de son spectateur, créant ainsi un motif dépendant de lui, un motif du vivant. Le fonctionnement de ce motif se fait en deux temps, tout d'abord un espace est investi destiné à la capture des mouvement humains, une caméra détecte la luminosité de ce qu'il capte et deux autres capteurs prennent en compte la distance qui les séparent d'un obstacle. Ces informations émettent des variables qui peuvent être traduites visuellement. Un vidéoprojecteur va projeter un visuel qui va changer selon ces variables il s'agit de deux rangées de fils se contournant selon la luminosité, faisant penser à des plantes ou des vaisseaux sanguins, la symétrie de ces fils permet l'harmonie du motif tout en rappelant la symétrie bilatérale de tous les mammifères et d'un grand nombre d'espèces vivantes. Un autre capteur émet un battement de cœur qui va plus ou moins s'accélérer, qui va créer un rythme comme un métronome. Le dernier capteur gère une ambiance musicale. Avoir une réponse immédiate de nos actions transformées en ce motif permet de rendre l'expérience plus ludique, on peut libérer son corps pour créer un motif propre à soi, répondant au rythme que l'on veut lui donner.

OUTILS MATÉRIEL :

vidéoprojecteur:

le vidéoprojecteur permet la projection de l'écran sur un mur.

carte arduino:

la carte arduino permet l'utilisation des capteurs infrarouges pour la distance.

support ordinateur:

permet l'utilisation d'une caméra et sert comme support pour utiliser processing.

RECHERCHES DE FORME :

premier motif:

Fini par être trop entremêlé pour être satisfaisant

deuxième motif:

Une pluie de boules tombent à une vitesse définie par ce que la caméra capte, soulignant ainsi les grandes lignes de ce que la caméra voit. Pas assez de fun ou de contrôle au niveau du spectateur pour s'exprimer.

troisième motif:

aucun contrôle de la part du spectateur pour influencer le motif, l'intérêt des capteurs seraient limités.

conclusion:

chaque programme a ses qualités qui lui sont propres, les compiler toutes ensemble en un seul programme est possible, mais peut peut ruiner les performances du programme rendant le tout frustrant à expérimenter tout en étant moins stable. J'ai décidé de n'en garder qu'un que j'ai plus approfondi.

RECHERCHES TECHNIQUES :

SCÉNOGRAPHIE :

recherche scénographie:

PROGRAMME FINAL

RÉFÉRENCES :

CODES

Arduino

#define IR_PROXIMITY_SENSOR A3 // Analog input pin that is attached to the sensor
#define IR_PROXIMITY_SENSOR A1 // Analog input pin that is attached to the sensor
#define ADC_REF 5//reference voltage of ADC is 5v.If the Vcc switch on the Seeeduino
int valeurCapteur;//the sensor voltage, you can calculate or find the distance
int valeurCapteur2;

int firstSensor = 0;    // first analog sensor
int secondSensor = 0;   // second analog sensor
int inByte = 0;         // incoming serial byte

void setup() {
  // start serial port at 9600 bps:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  pinMode(2, INPUT);   // digital sensor is on digital pin 2
  establishContact();  // send a byte to establish contact until receiver responds
}

void loop() {
  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {
    // get incoming byte:
    inByte = Serial.read();
    // read first analog input, divide by 4 to make the range 0-255:
    firstSensor = analogRead(A3) / 4;
    // delay 10ms to let the ADC recover:
    delay(10);
    // read second analog input, divide by 4 to make the range 0-255:
    secondSensor = analogRead(A1) / 4;
    // read switch, map it to 0 or 255L
    
    // send sensor values:
    Serial.write(firstSensor);
    Serial.write(secondSensor);
    
  }
}

void establishContact() {
  while (Serial.available() <= 0) {
    Serial.print('A');   // send a capital A
    delay(300);
  }
}

Processing

// Each pixel from the video source is drawn as
// a rectangle with size based on brightness.
import processing.serial.*;
import processing.sound.*;
Serial myPort;                       // The serial port
int[] serialInArray = new int[2];    // Where we'll put what we receive
int serialCount = 0;                 // A count of how many bytes we receive
////////
Oscillator oscs[] = new Oscillator[2];

SoundFile file;

FFT fft;
int fftBands = 500;
int t;
////////
float a;
float b;

boolean firstContact = false;        // Whether we've heard from the microcontroller

LowPass lowPass;

import processing.video.*;
// Size of each cell in the grid
int videoScale = 4;
// Number of columns and rows in the system
int cols, rows;
// Variable for capture device
Capture video;

void setup() { 
  Sound s = new Sound(this);
  file = new SoundFile(this, "HB.wav");
  file.play();
  file.loop();
  lowPass = new LowPass(this);
  s.volume(100);
  // Set the starting position of the ball (middle of the stage)
  // Print a list of the serial ports, for debugging purposes:
  printArray(Serial.list());
  // I know that the first port in the serial list on my mac
  // is always my  FTDI adaptor, so I open Serial.list()[0].
  // On Windows machines, this generally opens COM1.
  // Open whatever port is the one you're using.
  fft = new FFT(this, 512);
  String portName = Serial.list()[2];
  myPort = new Serial(this, portName, 9600);
  size(1280, 960);  
  // Initialize columns and rows  
  cols = width / videoScale;  
  rows = height / videoScale;  
  // Construct the Capture object  
  video = new Capture(this, cols, rows);  
  video.start();
}

void captureEvent(Capture video) {  
  video.read();
}

void draw() {  

  lowPass.process(file);
  lowPass.freq(b);
  arduino();
  fill(0, 100);
  rect(0, 0, width*4, height*4);
  video.loadPixels();  
  // Begin loop for columns  
  for (int i = 0; i < cols; i+=4) {    
    // Begin loop for rows    
    PVector p = new PVector(i*videoScale, 0);
    for (int j = 0; j < rows; j+=2) {      
      // Where are you, pixel-wise?      
      // Reverse the column to mirro the image.
      int loc = (video.width - i - 1) + j * video.width;       
      color c = video.pixels[loc];
      // A rectangle's size is calculated as a function of the pixel’s brightness. 
      // A bright pixel is a large rectangle, and a dark pixel is a small one.
      float sz = (brightness(c)/255) * videoScale*2;       
      float oldX = p.x;
      float oldY = p.y;
      float vx = (cos(sz)*5);
      float vy = (sin(-sz)*5);
      p.x+=vx;
      p.y+=vy;
      strokeWeight(1);
      stroke(a, 0, 0);
      line(oldX, oldY, p.x, p.y);
    }
  }
  for (int i = 0; i < cols; i+=4) {    
    // Begin loop for rows    
    PVector p = new PVector(i*videoScale, height);
    for (int j = 0; j < rows; j+=2) {      
      // Where are you, pixel-wise?      
      // Reverse the column to mirro the image.
      int loc = (video.width - i - 1) + j * video.width;       
      color c = video.pixels[loc];
      // A rectangle's size is calculated as a function of the pixel’s brightness. 
      // A bright pixel is a large rectangle, and a dark pixel is a small one.
      float sz = (brightness(c)/255) * videoScale*2;       
      float oldX = p.x;
      float oldY = p.y;
      float vx = (cos(sz)*5);
      float vy = (sin(sz)*5);
      p.x+=vx;
      p.y+=vy;
      strokeWeight(1);
      stroke(a, 0, 0);
      line(oldX, oldY, p.x, p.y);
    }
  }
}
void arduino() {
  file.rate(a/400);

  timer();
}
void timer() {
  t+=25;
  if (t>100) {
    t=0;
  }
}

void serialEvent(Serial myPort) {
  // read a byte from the serial port:
  int inByte = myPort.read();
  // if this is the first byte received, and it's an A,
  // clear the serial buffer and note that you've
  // had first contact from the microcontroller. 
  // Otherwise, add the incoming byte to the array:
  if (firstContact == false) {
    if (inByte == 'A') { 
      myPort.clear();          // clear the serial port buffer
      firstContact = true;     // you've had first contact from the microcontroller
      myPort.write('A');       // ask for more
    }
  } else {
    // Add the latest byte from the serial port to array:
    serialInArray[serialCount] = inByte;
    serialCount++;

    // If we have 3 bytes:
    if (serialCount > 1 ) {
      a = serialInArray[0]*4;
      b = serialInArray[1]*4;


      // Send a capital A to request new sensor readings:
      myPort.write('A');
      // Reset serialCount:
      serialCount = 0;
    }
  }
}
wiki/projets/motif-generatif/accueil.txt · Dernière modification: 2019/05/20 13:00 (modification externe)