software

_________________________________________________________________________________

an open source processing scatch :::

_________________________________________________________________________________
 import ddf.minim.*;
import processing.serial.*;Serial myPort;String komentari = “pyrvi”;  // smeni “pyrvi”, ako ne iskash default komentar ostavi samo “”
String typedText = “”;
int i = 0;
int broiSimvoli;
int a = 0;
int b = 0;
int rejim = 0;
int predishenRejim = 0;
int rejimPokazvai = 0;// snimkiint numFrames = 4;  // broi snimki
int snimkaNomer = 0;
PImage[] images = new PImage[numFrames];// audio
int numTracks = 6;
int trackNomer = 0;
AudioPlayer[] player = new AudioPlayer[numTracks];
Minim minim;

void setup(){
size(1020, 760);
background(0);
PFont font;
font = loadFont(“CourierNewPSMT-14.vlw”);
textFont(font, 18);

// serial

String portName = Serial.list()[0];
myPort = new Serial(this, portName, 9600);

// snimki

frameRate(30);

images[0]  = loadImage(“30.jpg”);
images[1]  = loadImage(“Penguins.jpg”);
images[2]  = loadImage(“30.jpg”);
images[3]  = loadImage(“Penguins.jpg”);

// audio

minim = new Minim(this);
player[0] = minim.loadFile(“k1.mp3”);
player[1] = minim.loadFile(“k2.mp3”);
player[2] = minim.loadFile(“k6.mp3”);
player[3] = minim.loadFile(“voda stapki.mp3”);
player[4] = minim.loadFile(“drone.mp3”);
player[5] = minim.loadFile(“coridor1.mp3”);

}

void draw(){

//    println(rejim);
//    if (millis() < 10000){
//      rejim = 0;
//    }
//
//    if (millis() > 10001 && millis() < 12000){
//      rejim = 1;
//    }

// nyama nikoi pred klaviaturata
if (rejim == 0){
background(0);
text(“/interpretative generator /”, 100, 100);
if (predishenRejim != 0){
trackNomer = (trackNomer+1) % numTracks; // mini na sledvasht track
rejimPokazvai = 0;
}
//    image(images[0], 10, 90);
}
// nyakoi minava pred klaviaturata – privlechi vnimanie, pusni track i pokaji instrukcii
if (rejim == 1){

playTrack(); // pusni track

background(0);
image(images[snimkaNomer], 10, 90);
// text za instrukciite
text(“instructions” + “\n” + “\n” + “1.Put headphones on” + “\n” + “2.Type an interpretation-” + “\n” + ” word or sentence ”  + “\n” + “3.Finish with conjunction ”  + “\n” + ” or pretext”  + “\n” + “4.Hit Enter” + “\n” + “5.See what others wrote”, 740, 325);
text(typedText+(frameCount/10 % 2 == 0 ? “_” : “”), 750, 575);

}

// zritelyat e ostavil komentar i e natisnal Enter – skrii instrukcii i pokaji predishni komentari
if (rejimPokazvai == 1){

playTrack(); // pusni track

i–;
background(0);
image(images[snimkaNomer], 10, 90);
text(komentari, 750, i);
delay(2);  // skorost na skrolvane

if(i <= 0 – b){
i = 741;
}
}
//    komentari = “da”;

predishenRejim = rejim;

}

void keyReleased() {

if (rejim == 1){

if (key != CODED) {

switch(key) {

case BACKSPACE:

typedText = typedText.substring(0,max(0,typedText.length()-1));

break;

case TAB:

typedText += ”    “;

break;

case ENTER:

case RETURN:

// comment out the following two lines to disable line-breaks

//      typedText += “\n”;

if (typedText != “”){
komentari = komentari + “\n” + “\n” + typedText;
typedText = “”;
//  println(broiSimvoli); // samo za test
a = 0;
b += 40;
rejimPokazvai = 1;
i = 741;
}

break;

case ESC:

case DELETE:

break;

default:

typedText += key;

broiSimvoli = typedText.length();

// proveryava kolko e dylyg komentara
// ako na reda ima poveche ot 25 simvola minava na sledvasht

if(broiSimvoli – a > 25){
if(key != ‘ ‘){
typedText += ” – “;
}
typedText += “\n”;
a = broiSimvoli;
b += 40;
}

if(key == ‘a’){
snimkaNomer++;
if (snimkaNomer >= numFrames){
snimkaNomer = 0;
}
}

if(key == ‘e’){
snimkaNomer–;
if (snimkaNomer < 0){
snimkaNomer = numFrames-1;
}
}

//        println(snimkaNomer);

}

}
}
}

// audio – close

void stop()
{
// always close Minim audio classes when you are done with them
player[trackNomer].close();
minim.stop();

super.stop();
}

void playTrack(){
if(player[trackNomer].isPlaying()){
}
else{
player[0] = minim.loadFile(“k1.mp3”);
player[1] = minim.loadFile(“k2.mp3”);
player[2] = minim.loadFile(“k6.mp3”);
player[3] = minim.loadFile(“voda stapki.mp3”);
player[4] = minim.loadFile(“drone.mp3”);
player[5] = minim.loadFile(“coridor1.mp3”);

player[trackNomer].play();
}
}

void serialEvent(Serial myPort) {

String inString = myPort.readStringUntil(‘\n’);

if (inString != null) {

inString = trim(inString);

rejim = int (inString);
}
}

_______________________________________________________________________________________________________________________

_________________________________________________________________________________

OTHER PAGES OF THE PROJECT   >>> / INTERPRETATIVE GENERATOR :

# project concept

# tech drawings

# soundscapes

# visual material

# interpretations banks

# spaces

# AV results

# bla bla game catalog

# absurdistic experiment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s