From 3832e2ec380f1b29a1f44b7208d050b463f0becf Mon Sep 17 00:00:00 2001 From: Stefan Karner Date: Mon, 11 Feb 2019 15:05:05 +0100 Subject: [PATCH] Change formatting --- intoOurSun_Code/intoOurSun_Code.pde | 267 +++++++++++++--------------- 1 file changed, 123 insertions(+), 144 deletions(-) diff --git a/intoOurSun_Code/intoOurSun_Code.pde b/intoOurSun_Code/intoOurSun_Code.pde index 2d909df..4ed9e08 100644 --- a/intoOurSun_Code/intoOurSun_Code.pde +++ b/intoOurSun_Code/intoOurSun_Code.pde @@ -1,28 +1,27 @@ /* Into Our Sun -In cooperation with ÖNB Labs (https://labs.onb.ac.at/) a +In cooperation with ÖNB Labs (https://labs.onb.ac.at/) a feedback system was developed to translate a set of metadata -from scans of historic newspapers with over 1 million IDs -into the audiovisual domain. (Almost) only the parameters -‘width‘ and ‘height‘ of the scans were used, while all -other metadata were omitted. The sequenced stream of +from scans of historic newspapers with over 1 million IDs +into the audiovisual domain. (Almost) only the parameters +‘width‘ and ‘height‘ of the scans were used, while all +other metadata were omitted. The sequenced stream of the items’ quality/exactness of representation (number of pixels), while abandoning the represented, could be understood as a reflection on how one perceives, thus interprets and creates, history. Copyleft Thomas Wagensommerer 2018 -Please note: This patch can be used as sequencer of any kind. -So it doesn't make any sound yet. +Please note: This patch can be used as sequencer of any kind. +So it doesn't make any sound yet. Just hook it up to whatever audio- or video- or whatever-generator, that eats OSC. -By default the patch sends OSC data (messages named "/height" + "/width") -back to your own machine (127.0.0.1 @ Port 12000). - +By default the patch sends OSC data (messages named "/height" + "/width") +back to your own machine (127.0.0.1 @ Port 12000). +*/ -*/ float grid = 7; int speed = 1000; Table table; @@ -44,183 +43,163 @@ float step = 1; import oscP5.*; import netP5.*; int value; - + + OscP5 oscP5; NetAddress myRemoteLocation; -void setup() { - size(1024,768, P3D); - +void setup() { + size(1024, 768, P3D); background(0); - - oscP5 = new OscP5(this,12000); - myRemoteLocation = new NetAddress("127.0.0.1",12000); // change IP and port here if needed - - frameRate(60); - rate = abs(int(sthmap+stwmap+2)); - - + oscP5 = new OscP5(this, 12000); + myRemoteLocation = new NetAddress("127.0.0.1", 12000); // change IP and port here if needed - table = loadTable("anno_labs_pages_dropped_width_height_year.csv", "header"); - + frameRate(60); + rate = abs(int(sthmap+stwmap+2)); + table = loadTable("anno_labs_pages_dropped_width_height_year.csv", "header"); } + void draw() { step =abs(sin(frameCount*0.0001))*9; counter=counter+int(step); println(int(step)); if (counter >= 1000000) { - counter = 0; + counter = 0; } - background(0); - - -wmap = map(table.getInt(counter,0),1000, 5000, 0, 255 ); -hmap = map(table.getInt(counter,1),1700, 4000, 0, 255 ); -ymap = map(table.getInt(counter,2),1700, 1877, 0, 255 ); - - -stwmap = map(table.getInt(counter,0),1000, 5000, 5, 1 ); -sthmap = map(table.getInt(counter,1),1700, 4000, 5, 1 ); - -sphW = map(table.getInt(counter,0),1000, 5000, 1, 10 ); -sphH = map(table.getInt(counter,1),1700, 4000, 1, 10 ); - - for (int y=0; y < height-200; y +=0){ - for ( int x=0; x < width; x += 0){ - fill( int(random(wmap,255)), int(random(0,hmap)), int(random(wmap, hmap))); - - fill( int(random(0,wmap)), int(random(0,hmap)), int(random(wmap, hmap))); - noStroke(); - rect(x, y, 20, 20); - x+=20; + background(0); + + wmap = map(table.getInt(counter, 0), 1000, 5000, 0, 255 ); + hmap = map(table.getInt(counter, 1), 1700, 4000, 0, 255 ); + ymap = map(table.getInt(counter, 2), 1700, 1877, 0, 255 ); + + stwmap = map(table.getInt(counter, 0), 1000, 5000, 5, 1 ); + sthmap = map(table.getInt(counter, 1), 1700, 4000, 5, 1 ); + + sphW = map(table.getInt(counter, 0), 1000, 5000, 1, 10 ); + sphH = map(table.getInt(counter, 1), 1700, 4000, 1, 10 ); + + for (int y=0; y < height-200; y +=0) { + for ( int x=0; x < width; x += 0) { + fill( int(random(wmap, 255)), int(random(0, hmap)), int(random(wmap, hmap))); + fill( int(random(0, wmap)), int(random(0, hmap)), int(random(wmap, hmap))); + noStroke(); + rect(x, y, 20, 20); + x+=20; } y+=20; -} - - pushMatrix(); - lines(); - popMatrix(); - - pushMatrix(); - lines2(); - popMatrix(); - - - pushMatrix(); - flick1(); - flick2(); - popMatrix(); - - pushMatrix(); - sun(); - popMatrix(); - - pushMatrix(); + } + + pushMatrix(); + lines(); popMatrix(); - - OscMessage myMessage = new OscMessage("/width"); - OscMessage myMessage2 = new OscMessage("/height"); - noStroke(); -fill(0); - rect(width/2,height-100,width,200); - - - fill(255); - textAlign(CENTER, CENTER); - textSize(50); - W = str(table.getInt(counter,0)); - H = str(table.getInt(counter,1)); - y = str(table.getInt(counter,2)); - i = str(counter); - - translate(0,300); - - text(W, width/2-100, height/2); - text(H, width/2+100, height/2); - text(i, width/2-300, height/2); - text(y, width/2+300, height/2); - - textSize(25); - text("WIDTH:", width/2-100, height/2-50); - text("HEIGHT:", width/2+100, height/2-50); - - text("ID:", width/2-300, height/2-50); - text("YEAR:", width/2+300, height/2-50); - - val = (table.getInt(counter,0) *table.getInt(counter,1))/10000; - - noFill(); - stroke(255); + pushMatrix(); + lines2(); + popMatrix(); - myMessage.add(table.getInt(counter,0)); - myMessage2.add(table.getInt(counter,1)); - oscP5.send(myMessage, myRemoteLocation); - oscP5.send(myMessage2, myRemoteLocation); -} + pushMatrix(); + flick1(); + flick2(); + popMatrix(); + pushMatrix(); + sun(); + popMatrix(); -void sun() { - fill(random(255),random(255),random(255)); - - stroke(random(255),random(255),random(255)); - strokeWeight(ymap/5); - ellipse(width/2, 284, (wmap+hmap)*0.9,(wmap+hmap)*0.9); + pushMatrix(); + popMatrix(); + OscMessage myMessage = new OscMessage("/width"); + OscMessage myMessage2 = new OscMessage("/height"); + noStroke(); + fill(0); + rect(width/2, height-100, width, 200); -} + fill(255); + textAlign(CENTER, CENTER); + textSize(50); + W = str(table.getInt(counter, 0)); + H = str(table.getInt(counter, 1)); + y = str(table.getInt(counter, 2)); + i = str(counter); + translate(0, 300); -void flick1() { - -noStroke(); + text(W, width/2-100, height/2); + text(H, width/2+100, height/2); + text(i, width/2-300, height/2); + text(y, width/2+300, height/2); -if (frameCount % rate == 0){ + textSize(25); + text("WIDTH:", width/2-100, height/2-50); + text("HEIGHT:", width/2+100, height/2-50); -fill(255); -} else { + text("ID:", width/2-300, height/2-50); + text("YEAR:", width/2+300, height/2-50); + + val = (table.getInt(counter, 0) *table.getInt(counter, 1))/10000; noFill(); -} - //println(rate); - rectMode(CENTER); - rect(width/2,426,width,284); + stroke(255); + + myMessage.add(table.getInt(counter, 0)); + myMessage2.add(table.getInt(counter, 1)); + oscP5.send(myMessage, myRemoteLocation); + oscP5.send(myMessage2, myRemoteLocation); } -void flick2() { -noStroke(); -if (frameCount % rate == 0){ -fill(255); -} else { +void sun() { + fill(random(255), random(255), random(255)); - noFill(); + stroke(random(255), random(255), random(255)); + strokeWeight(ymap/5); + ellipse(width/2, 284, (wmap+hmap)*0.9, (wmap+hmap)*0.9); +} + + +void flick1() { + noStroke(); + if (frameCount % rate == 0) { + fill(255); + } else { + noFill(); + } + //println(rate); + rectMode(CENTER); + rect(width/2, 426, width, 284); } + +void flick2() { + noStroke(); + if (frameCount % rate == 0) { + fill(255); + } else { + noFill(); + } rectMode(CENTER); - rect(width/2,142,width,284); + rect(width/2, 142, width, 284); } + void lines() { - stroke(0); + stroke(0); strokeWeight(grid); -for (int i = 0; i