How to upload a sound file to a running program?

I have an app that analyzes audio.

The thing is that it doesn't correctly works on Mac (I'm writing it on Windows).

I'm using

selectInput()

which works okai. Then, if the audio is larger or something than x variable, I use:

javax.swing.JOptionPane.showMessageDialog(null, "Selecciona un archivo entre "+durMin+" y "+durMax+" segundos. El tuyo dura "+duracion+".");

On Windows works as intended, though sometimes it doesn't (I need to check that), but on Mac it doesn't works. It runs, but it closes immediately. On my research, someone told me it may be something with how I handle the sound file upload, but I don't know how I could solve this correctly.

submitted by /u/ambiatica
[link] [comments]

Questions about what is possible with processing related to animations.

Can you make d3.js style animations as shown here? Could it be recreated?

Can I make a scatterplot and then have all of the points recompose themselves into histograms? Can I do this in reverse?

Can I overlay animations?

Where can I look at animation examples along with their source code?

Would you use processing or something else for data visualization?

Can other animations be uploaded and appended or overlaid onto a different animation made in processing?

submitted by /u/AlittleMisleading
[link] [comments]

Art as Social Action. An Introduction to the Principles and Practices of Teaching Social Practice Art

Art as Social Action. An Introduction to the Principles and Practices of Teaching Social Practice Art, edited by Gregory Sholette, Chloë Bass and Social Practice Queens.

On amazon UK and USA. Table of contents.

Publisher Allworth Press writes: Art as Social Action is both a general introduction to and an illustrated, practical textbook for the field of social practice, an art medium that has been gaining popularity in the public sphere. With content arranged thematically around such topics as direct action, alternative organizing, urban imaginaries, anti-bias work, and collective learning, among others, Art as Social Action is a comprehensive manual for teachers about how to teach art as social practice.

Along with a series of introductions by leading social practice artists in the field, valuable lesson plans offer examples of pedagogical projects for instructors at both college and high school levels with contributions written by prominent social practice artists, teachers, and thinkers.


Public Lab, Balloon mapping, a DIY tool for gathering visual information about a site that is difficult to access physically, whether the site be toxic, watery, fenced, or patrolled. Photo

Art as Social Action is not your typical book about socially engaged art. I seem to review books about that very topic every month and this one is different. It is a collection of texts by teachers who, together with their art students, look for creative ways to enter in a discussion with society outside the classroom about topics as different as labour conditions, immigrant rights or mining on sacred Native American sites. Texts by teachers who want to make works with rather than about local communities. And, hopefully, make this world a slightly fairer and kinder one.

Art as Social Action is not a manual with solutions and failproof recipes but a source of inspiration with tactics, social models and bibliographies which lessons can be experimented by other teachers and other (art or not) students into the streets. Some of the texts are concise and lively. Others feel like dry reports.

I found the interviews and essays much more enjoyable to read. Each of them is witty, engaging and though-provoking. So much so that i’m going to quote from a couple of them:

From the interview of Pablo Helguera:

“What I think is missing in social practice programs is supporting the possibility to conduct research work that is fundable. Consider a project like Marisa Jahn’s Nanny Van, which supports and defends the rights of caretakers. She gets money and support from arts organizations, but she can also go to other agencies that support her social justice agenda. So the advantage social practice has is that we don’t necessarily need to fund our projects exclusively through the art world; we can actually go to city councils and social service organizations that protect and advocate for the types of social justice issues we are interested in.”

From the interview with Steve Duncombe and Steve Lambert from the Center for Artistic Activism:

Steve Duncombe: “I am very cynical about the university as a site for radical struggle. It has amazing recuperative powers—the university can take almost anything radical: feminism, class analysis, critical race theory, and just turn it into a seminar.”

From Gregory Sholette‘s concluding essay:

“Ultimately, therefore, what most differentiates SEAE from other modes of artistic learning, and most other forms of pedagogy, is the degree to which normative boundaries separating the type of learning that takes place in a school, and that which happens outside, in the real world, are not merely blurred, but aggressively, even gleefully, deconstructed.”


Marisa Morán Jahn, The Nanny Van (a mobile design lab and sound studio that promotes domestic workers’ labor rights across the USA)

Last few comments:

– this is one of those (still too) rare books in which the majority of contributors are not white male artists and thinkers from ‘western’ countries;
– I wish there had been more texts dealing with online tools and tactics for socially-engaged art;
– I’s recommend this book to practitioners of socially engaged art. Anyone else (no matter how interested you think you are in socially-engaged artistic practices) might find it less rewarding.

Need help with moving a players car.

//traffic list ArrayList <Car> Cars; ArrayList <Button> buttons; Car playerCar; String gamestate; int numbuttons =18;

void setup () { size(1280, 720); rectMode(CORNER); gamestate = "MainMenu"; // x y w h x/yspeed bodycolour window playerCar = new Car (10, 120, 100, 150, 0, 0, color (255, 255, 255), color (0, 0, 100));

buttons = new ArrayList <Button>(); //BUTTONS FOR CUSTOMIZATION MENU //red Button r = new Button (160, 200, 70, 70, color (255, 0, 0)); buttons.add(r); //orange Button o = new Button(260, 200, 70, 70, color (255, 80, 0) ); buttons.add(o); //yellow Button y = new Button(360, 200, 70, 70, color (255, 255, 0)); buttons.add(y); //green Button g = new Button (160, 300, 70, 70, color (0, 255, 0)); buttons.add(g); //blue Button bb = new Button(260, 300, 70, 70, color (0, 0, 255)); buttons.add(bb); //purple Button p = new Button(360, 300, 70, 70, color (128, 0, 128)); buttons.add(p); //pink Button pp = new Button(160, 400, 70, 70, color (255, 192, 203)); buttons.add(pp); //black Button bl = new Button(260, 400, 70, 70, color (0, 0, 0)); buttons.add(bl); //white Button w = new Button(360, 400, 70, 70, color (255, 255, 255)); buttons.add(w); //------------------------------- //window tint colours //red Button r2 = new Button(960, 200, 70, 70, color (255, 0, 0)); buttons.add(r2); //orange Button o2 = new Button(1060, 200, 70, 70, color (255, 80, 0)); buttons.add(o2); //yellow Button y2 = new Button(1160, 200, 70, 70, color (255, 255, 0)); buttons.add(y2); //green Button g2 = new Button(960, 300, 70, 70, color (0, 255, 0)); buttons.add(g2); //blue Button b2 = new Button(1060, 300, 70, 70, color (0, 0, 255)); buttons.add(b2); //purple Button p2 = new Button(1160, 300, 70, 70, color (128, 0, 128)); buttons.add(p2); //pink Button pp2 = new Button(960, 400, 70, 70, color (255, 192, 203)); buttons.add(pp2); //black Button bl2 = new Button(1060, 400, 70, 70, color (0, 0, 0)); buttons.add(bl2); //white Button w2 = new Button(1160, 400, 70, 70, color (255, 255, 255)); buttons.add(w2); //------------------------------------------- 

} //------------------------------------------------

//mainMenu void MainMenu() {
background (255, 255, 255); //green background fill(2, 89, 70); rect(29, 29, 1222, 662); //------------------- //logo fill(255, 255, 255); stroke(255, 255, 255); textSize (90);
text ("401", 580, 250);
//------------------- //start game button rect(550, 350, 180, 70); fill(0, 0, 0); textSize (50); text ("Start", 575, 405); //------------------- //controls button fill(255, 255, 255); rect(550, 430, 180, 70); fill(0, 0, 0); textSize (45); text ("Controls", 548, 485); } void PreGame() {

background (122, 122, 122); textSize (45); fill(0, 0, 0); text ("Los Santos Customs", 400, 50); textSize(20); fill(255, 255, 255); textSize(20); //------------------------------------ //BODY COLOUR text ("Body Colour:", 20, 200); //---------------------------------------------- //WINDOW TINT text ("Window Tint:", 830, 200); //---------------------------------- //return to menu button fill(255, 255, 255); rect(30, 625, 180, 70); fill(0, 0, 0); textSize (50); text ("Menu", 65, 680); //---------------------------------------- // countinue to game fill(255, 255, 255); rect(1070, 625, 180, 70); fill(0, 0, 0); textSize (50); text ("Start", 1105, 680); for (int i = 0; i < buttons.size(); i++) { Button b = buttons.get(i); b.draw(); } //------------------------------------ //vehicle playerCar.draw(); //-------------------------- 

}

void Control() {

background (123, 255, 255); // textSize(20); stroke (1); fill(255, 255, 255); rect(28, 13, 1200, 100); fill (0, 0, 0); textSize(30); text ("In the game your your main goal is to avoid the traffic and see how long you can ", 30, 40); text ("survive in it without crashing into any other cars. Your score will be determined ", 30, 70); text ("based on how long you were able to survive.", 30, 100); //--------------------- //return to menu fill(255, 255, 255); rect(550, 350, 180, 70); fill(0, 0, 0); textSize (50); text ("Menu", 575, 405); //------------------------ //controls //----------------------- //W fill(255, 255, 255); rect(237, 257, 70, 70); fill(0, 0, 0); text ("W", 250, 315); //-------------------------- //S fill(255, 255, 255); rect(237, 350, 70, 70); fill(0, 0, 0); text ("S", 250, 408); //-------------------------- //A fill(255, 255, 255); rect(140, 350, 70, 70); fill(0, 0, 0); text ("A", 157, 408); //-------------------------- //S fill(255, 255, 255); rect(337, 350, 70, 70); fill(0, 0, 0); text ("D", 350, 408); //-------------------------- //controls description fill(255, 255, 255); rect(28, 440, 450, 140); fill(0, 0, 0); textSize(25); text ("Contorls:", 30, 435); text ("To control your vehicle you simple", 30, 470); text ("use the WASD keys located ", 30, 500); text ("on your keyboard to manuever ", 30, 530); text ("your vehicle in any direction.", 30, 560); //---------------------------- //vehicle playerCar.draw(); //----------------- 

}

//------------------------------------------------ //Game void Game() { background (0, 128, 0);

noStroke(); //road fill(53, 53, 53); rect(100, 0, 1080, 720); //--------------------------------- //leftguard rail fill(181, 181, 181); rect(80, 0, 20, 720); //----------------------------- //right guard rail fill(181, 181, 181); rect(1180, 0, 20, 720); //----------------------------------- //------------------------------------ //vehicle playerCar.draw(); playerCar.x = playerCar.x + playerCar.speedX; playerCar.y = playerCar.y + playerCar.speedY; //-------------------------- 

} //--------------------------------------------------- //draw void draw() { if (gamestate == "PreGame") { PreGame(); } else if (gamestate == "MainMenu") { MainMenu(); } else if (gamestate == "Control") { Control(); } else if (gamestate == "Game") { Game(); } } void keyPressed()

{ if (gamestate == "Game") {
if (keyCode == 'W') playerCar.y =playerCar.y - playerCar.speedY; else if (keyCode == 'S') playerCar.y =playerCar.y + playerCar.speedY; else if (keyCode == 'A') playerCar.x = playerCar.x - playerCar.speedX; else if (keyCode == 'D') playerCar.x = playerCar.x + playerCar.speedX; } }

void mouseMoved() { if (gamestate == "PreGame") { for (int i = 0; i < 9; i++) { Button r = buttons.get(i); Button r2 = buttons.get(i); if (mouseX >= r.x && mouseX <= r.x + r.w && mouseY >= r.y && mouseY <= r.y + r.w) { playerCar.clrB = r.clr; } } }
//else if (gamestate == "PreGame") //{ // for (int i = 0; i < 9; i++) // { // Button r = buttons.get(i); // Button r2 = buttons.get(i); // if (mouseX >= r2.x && mouseX <= r2.x + r2.w && mouseY >= r2.y && mouseY <= r2.y + r2.w) // { // playerCar.clrB = r2.clr; // } // }
//
//} }

void mousePressed() { //preGame button if (gamestate == "MainMenu") { if (mouseX >=550 && mouseX <=730 && mouseY >=350 && mouseY <=420) { gamestate = "PreGame"; } } else if (gamestate == "PreGame") {

 PreGame(); if (mouseX >=30 && mouseX <=210 && mouseY >=625 && mouseY <=695) { gamestate = "MainMenu"; } if (mouseX >=1070 && mouseX <=1250 && mouseY >=625 && mouseY <=695) { gamestate = "Game"; } } //-------------- //controlsbuttom if (gamestate == "MainMenu") { if (mouseX >=550 && mouseX <=730 && mouseY >=430 && mouseY <=500) { gamestate = "Control"; } } if (gamestate == "Control") { if (mouseX >=550 && mouseX <=730 && mouseY >=350 && mouseY <=420) { gamestate = "MainMenu"; } } //-------------- 

}

class Car { float x, y, w, h, speedX, speedY; color clrB; color clrW; // CarBodyColour CarWindowColour Car (float Cx, float Cy, float Cw, float Ch, float CspeedX, float CspeedY, color CBcolour, color CWcolour) {

 x = Cx; y = Cy; w = Cw; h = Ch; speedX = CspeedX; speedY = CspeedY; clrB= CBcolour; clrW= CWcolour; } void draw() { fill(clrB); //car body rect (x, y, w, h); //car front windo fill(clrW); rect (x +5, y +40, w - 10, h/4); //car left window rect (x +5, y +80, w - 98, h/4); //car right window rect (x +5, y +80, w - 98, h/4); rect (x +93, y +80, w - 98, h/4); if (gamestate == "PreGame") { x = 590; y = 280; } if (gamestate == "Control") { x = 927; y = 320; } if (gamestate == "Game") { x = 590; y = 560; } } 

}

class Button { float x, y, w, h; color clr;

Button (float Bx, float By, float Bw, float Bh, color bclr) { w = Bw; h = Bh; x = Bx; y = By; clr = bclr; } void draw() { fill(clr); rect (x, y, w, h); } 

}

submitted by /u/pacotaco651
[link] [comments]

representing score with circles

// all the variables I need for two tools int hammerPos = 0; int hammerVel = 1; int hammerPending = 0; int bucketPos = 0; int bucketVel = 2; int bucketPending = 0; int mrPos; int jump = 60; boolean doorOpen = true; long timeAt; // the time at which the door was last opened or closed long waitTime; // the time to wait (in total) until the door opens next void setup() { size(512, 348); mrPos = width/8; frameRate(30); waitTime = int(random(3000, 8000)); } void draw() { if (millis() > timeAt + waitTime) { // calculation will tell me if current time (millis) has gone past the last time the door opened plus waitTime doorOpen = !doorOpen; timeAt = millis(); // reset last opening time to now waitTime = int(random(3000, 8000));// choose new waiting time } background(159, 172, 173); rectMode(CORNERS); ellipseMode(CORNERS); noStroke(); house(); mrg(); hazard(); score(); } void hazard() { fill(0); stroke(0); strokeWeight(6); line(128, hammerPos+10, 148, hammerPos-12); strokeWeight(4); line(125, hammerPos+13, 129, hammerPos+11); strokeWeight(8); line(115, hammerPos+5, 130, hammerPos+20); // draw bucket fill(0); noStroke(); triangle(167, bucketPos-5, 187, bucketPos-12, 188, bucketPos+12); triangle(167, bucketPos-5, 187, bucketPos+12, 169, bucketPos+14); noFill(); stroke(0); strokeWeight(4); ellipse(183, bucketPos-11, 195, bucketPos+10); if (bucketPos >height) { bucketPos=0; } if (hammerPos>height) { hammerPos=0; } if (hammerPos > 240 && hammerPos < 300 && mrPos == width/4) { mrPos = width/8; } if (bucketPos > 240 && bucketPos < 300 && mrPos == 3*width/8) { mrPos = width/8; } // animate all automatically moving objects.. first update pending then decide if there is a jump this frame hammerPending = hammerPending + hammerVel; bucketPending = bucketPending + bucketVel; if (hammerPending > jump) { hammerPos = hammerPos + hammerPending; hammerPending = 0; } if (bucketPending > jump) { bucketPos = bucketPos + bucketPending; bucketPending = 0; } } void score() { if (hammerPos>height) { ellipse(40, 40, 40, 40); } } //draw house void house() { strokeWeight(20); stroke(0); line(402, 206, 490, 169); line(490, 169, 512, 179); strokeWeight(2); noFill(); line(411, 213, 411, 305); rect(419, 210, 468, 295); if (doorOpen) { line(479, 206, 499, 199); line(499, 199, 499, 314); line(499, 314, 478, 302); fill(0); noStroke(); triangle(476, 225, 493, 219, 493, 243); triangle(476, 225, 493, 243, 476, 240); ellipse(487, 255, 493, 263); arc(499, 255, 507, 262, 3*HALF_PI, HALF_PI, CHORD); } else { fill(0); noStroke(); rect(432, 225, 453, 243, 2); ellipse(425, 255, 431, 263); } } // draw MrGW void mrg() { noStroke(); fill(0); ellipse(mrPos-13, 232, mrPos+17, 263); fill(159, 172, 173); ellipse(mrPos+3, 250, mrPos+17, 260); fill(0); triangle(mrPos+2, 258, mrPos-11, 278, mrPos+1, 285); } void keyPressed() { if (keyCode == RIGHT && (mrPos < 7*(width/8)) && doorOpen) { // mr gw is moving right and the door is open mrPos = mrPos + width/8; } else if (keyCode == RIGHT && (mrPos < 6*(width/8))) { // mr gw is moving right not including last slot mrPos = mrPos + width/8; } else if (keyCode == LEFT && (mrPos > width/8)) { // mr gw is moving left. mrPos = mrPos - width/8; } } 
submitted by /u/Dedpolman
[link] [comments]

Getting an error and not sure why?

 //Caesar cipher String decrypt(word) { letter,charCode,index = 0; while (index < word.length) { var char = word.charAt(index); if (char == "a") { letter = "x"; } else if (char == "b") { letter = "y"; } else if (char == "c") { letter = "z"; } else if (char == "d") { letter = "a"; } else if (char == "e") { letter = "b"; } else if (char == "f") { letter = "c"; } else if (char == "g") { letter = "d"; } else if (char == "h") { letter = "e"; } else if (char == "i") { letter = "f"; } else if (char == "j") { letter = "g"; } else if (char == "k") { letter = "h"; } else if (char == "l") { letter = "i"; } else if (char == "m") { letter = "j"; } else if (char == "n") { letter = "k"; } else if (char == "o") { letter = "l"; } else if (char == "p") { letter = "m"; } else if (char == "q") { letter = "n"; } else if (char == "r") { letter = "o"; } else if (char == "s") { letter = "p"; } else if (char == "t") { letter = "q"; } else if (char == "u") { letter = "r"; } else if (char == "v") { letter = "s"; } else if (char == "w") { letter = "t"; } else if (char == "x") { letter = "u"; } else if (char == "y") { letter = "v"; } else if (char == "z") { letter = "w"; } } return encrypt; } 

//When I hit run, I'm met with the error "Syntax error, maybe missing a semicolon?" while the program highlights the first line of code. This is in void setup and I really don't understand what's going wrong

submitted by /u/anime-m8
[link] [comments]