Going through the learn processing book – not sure where my ‘applet’ is?

note - I'm using Ubuntu 14.

I've made the little alien zook thing and saved that as learnProcessing

So that's not in a directory, that's in the sketchbook directory in my home folder.

If I do tree | grep applet I get the following :

vco@geoHP:~/sketchbook$ tree | grep applet │ │ │ │ ├── applet 

But I have no idea where that actually is, other than it's 5 directories deep.

Wheres this thing meant to go?

Thanks.

submitted by y45y564
[link] [3 comments]

(Sorta) New to Processing (on windows). I’ve been doing Arduino Processing for years. A few questions:

I can still do totally C++ stuff in my code, like make new classes with deconstructors and all that, right?

Cause I had these dang little Atmega328s doing default constructors and operator overloading, and, frankly, it was awesome.

(Still totally new to Processing in Windows. I used it once to make a useful app, but that was like 90% cargo cult programming.)

submitted by rasfert
[link] [2 comments]

How to create fade in / out in the following code (from tutorial)

By fade in / out I mean get brighter / darker, I'm probably using the wrong words there.

However, I have code [1] from the tutorial on 2D arrays that I've chopped slightly and I'm trying to make it get gradually brighter then gradually dimmer.

Currently it get's gradually brighter then it stays there, rather than the if statements effecting the variable differently.

I'm sure there's a better way to write the statements as well, I'm all ears to everything!

Here's a link to the full code on pastebin

Here are the if statements specifically :

boolean my_switch = true; if (my_switch = true){ buzz += 1; } if (my_switch = false){ buzz -= 1; } if (buzz > 230){ my_switch = false; } if (buzz < 20){ my_switch = true; } 

So the value increases, but for some reason it's never 'flipping' to false, so it just remains true even though it must have reached values greater than 230

Hopefully the above is clear enough for you to tell what I mean,

thanks


Here's the full code :

// 2D array of objects Cell[][] grid; // Number of columns and rows in the grid int cols = 10; int rows = 10; void setup(){ size(1000, 1000); grid = new Cell[cols][rows]; for (int i = 0; i < cols; i++){ for(int j = 0; j < rows; j++){ //initialize each object grid[i][j] = new Cell(i* (height/10), j*(height/10), (height/10), (height/10), i+j); } } } void draw() { background(0); // The counter variables i and j are also the column and row numbers and // are used as arguments to the constructor for each object in the grid. for (int i = 0; i < cols; i++){ for(int j = 0; j < rows; j++){ //Oscillate and display each object grid[i][j].oscillate(); grid[i][j].display(); } } } // A cell object class Cell{ // A cell object knows about it's location in the grid as well as it's size with the variables x, y, w, h float x, y; // location float w, h; // width and height float angle; // angle for oscillating brightness float buzz = 0; boolean my_switch = true; // Cell constructor Cell(float tempX, float tempY, float tempW, float tempH, float tempAngle){ x = tempX; y = tempY; w = tempW; h = tempH; angle = tempAngle; } // Oscillation means increase angle void oscillate(){ angle += 0.02; buzz += 1; if (my_switch = true){ buzz += 1; } if (my_switch = false){ buzz -= 1; } if (buzz > 230){ my_switch = false; } if (buzz < 20){ my_switch = true; } } void display(){ stroke(255); // Color calculated using sine wave fill(127+127*sin(angle),buzz,buzz); rect(x,y,w,h); } } 
submitted by y45y564
[link] [8 comments]

Putting classes in subfolders?

Hey, I tried to organize my code and pulled out some classes into separate files, which was no problem, didn't even have to import anything. Great. But when I try to group them into a subfolder, I can't seem to get it working again. What do i need to do? Googling anything on processing and subfolders is really, really useless sadly.

Thanks!

submitted by sorryschrubb
[link] [4 comments]

I’m wondering about the ‘flow’ of a programme – example code from tutorial

Here's a link to the code on Pastebin [1]

Note - I've been learning Python - so I might draw on comparisons to that occasionally, I appreciate that they are different.

1 ) void draw()

This is essentially the 'main' section of the code? So code within this gets run sequentially. I've seen some people with multiple draw () functions in their code... hmm.

2) Order

Is there any convention to the ordering of code? If draw () is the 'main' area then it seems like it should be on the bottom of the programme.

3) Advice on breaking this programme down?

I'm not sure sure how to approach breaking down this code in terms of reading it.

Should I read from top to bottom? Or start with the class, work that out and move to setup() or something?

How I read this code is ->

The first thing I see is Cell[][] grid;, so I not there's a multidimensional array somewhere. But why Cell[][] grid;? Grid is in setup() which is a different method.

Then I start to melt, if anyone has the time I'll write out more fully how I read the code that might help highlight things easier, otherwise this post is going to turn into a bit of a bloated essay.


Here's the code :

// 2D array of objects Cell[][] grid; // Number of columns and rows in the grid int cols = 10; int rows = 10; void setup(){ size(200, 200); grid = new Cell[cols][rows]; for (int i = 0; i < cols; i++){ for(int j = 0; j < rows; j++){ //initialize each object grid[i][j] = new Cell(i*20, j*20, 20, 20, i+j); } } } void draw() { background(0); // The counter variables i and j are also the column and row numbers and // are used as arguments to the constructor for each object in the grid. for (int i = 0; i < cols; i++){ for(int j = 0; j < rows; j++){ //Oscillate and display each object grid[i][j].oscillate(); grid[i][j].display(); } } } // A cell object class Cell{ // A cell object knows about it's location in the grid as well as it's size with the variables x, y, w, h float x, y; // location float w, h; // width and height float angle; // angle for oscillating brightness // Cell constructor Cell(float tempX, float tempY, float tempW, float tempH, float tempAngle){ x = tempX; y = tempY; w = tempW; h = tempH; angle = tempAngle; } // Oscillation means increase angle void oscillate(){ angle += 0.02; } void display(){ stroke(255); // Color calculated using sine wave fill(127+127*sin(angle)); rect(x,y,w,h); } } 


[1] - I'm not sure if there's anywhere better to paste code with processing specific syntax highlighting?

submitted by thonpy
[link] [5 comments]

Survival Kit Festival in Umeå

0monstre09502285n.jpg
Anthony Clair Wagner. Photo: Fanny Carinasdotter

0i1pantry80_n.jpg
Umeå Skafferi / Umeå Pantry at Pilgatan 16 (photo)

It's almost 2015 and i still have to write reviews of a couple of festivals i've visited over the Autumn. The first one that was languishing in my draft is the very smart, very socially-engaged and exciting Survival Kit festival in Umeå, Sweden. The event explored the theme of local and global survival through the lenses of visual art, music, food, discussions and lectures.

How can we look at issues such as ecology, economy and human survival at large? And on a more personal level: how can I navigate as an individual in this new and complex world?

Wherever we look, there is a feeling how being disconnected, of living in the midst of uncertainties regarding our economic and political systems, social structures, and ecological future. The Survival Kit Festival looked at what can be done to regain some control. The artists and activists selected don't stop at denouncing what is wrong with society and the world at large, they also document or implement small, practical solutions that might ensure our survival. These experiments go from building a biodome with an aquaponic system for fish and vegetable cultivation to converting a parking lot into a collective garden. From proposing a new currencies for culture to inviting the public to a cup of chaga mushroom tea.

I had never been to Umea. It's a small city and it was pissing rain all along. Yet, i found that place amazing: strong leftie values, free wifi on public buses, a culture of veganism and cheerful cut-out figures greeting you at the entrance of supermarkets:

1umea_fb55c7acbf_b.jpg

Also i slept inside a prison cell. So what was not to love?

Here's a small selection of the works i discovered at the festival:

0-joost-conijn-wood-car-2002-video-original-length-31-min-874.jpg
Joost Conijn, Wood Car, 2002

0iconijn009.jpg
Joost Conijn, Wood Car, 2002

0aa016527conijn_j.jpg
Joost Conijn, Wood Car, 2002

JoostConijn.jpg
View of Joost Conijn video installation inside John Söderberg's caravan, at Verkligheten. Photo: Fanny Carinasdotter

In 2001 Joost Conijn spent the Summer riding a car he had built himself through Eastern European countries. The car is made out of wood, it runs on wood and because the world economically runs on oil, the artist wasn't going from petrol station to petrol station (like we normally would) but from rural area to rural area with no specific destination nor itinerary.

His objective was to use the plywood-clad vehicle as a ploy to generate unexpected situations and meetings across the road. The film of his expedition shows people in small villages guiding him to local saw-mills, offering him spare wood and inviting him to a picnic.

0soderberg64766203465751_o.jpg
John Söderberg at Verkligheten. Photo: Fanny Carinasdotter

Conijn's film is screened inside John Ola Söderberg's caravan. I really REALLY like that one, it is simply a caravan made out of a caravan.

0-Mon-Amour_2012_4.jpg
Siri Hermansen, Chernobyl Mon Amour, 2012 (video still)

0Hermansen_Chernobyl-Mon-Amour_2012_1.jpg
Siri Hermansen, Chernobyl Mon Amour, 2012 (video still)


Chernobyl Mon Amour, 2012 (Extracts)

Siri Hermansen's films shows what might emerge from complete despair and devastation. The festival was screening two videos that document the survival strategies developed by local communities and individuals who have chosen to live in Chernobyl and Detroit.

In Chernobyl Mon Amour, the artist follows two state-employed guides who take catastrophe tourists, journalists and scientists to the exclusion zone of Pripyat, a city built for the families of power plant workers and evacuated at the time of the disaster in 1986.

In the interview, they talk about their fondness of the area. One of them even describes how he believes that his body is now accustomed to the radioactivity and how, after five years in the zone, his body actually gets ill when he enters the normal world. They both stay longer and longer periods in Chernobyl, ignoring the breaks their doctors advise.

They add that if you look around, it appears as if the whole nature is thriving in this radioactive environment. More and more animals are moving into it and vegetation grows unrestrained.

To them the zone offers a unique situation of hope, freedom and possibility within the hardships of Ukrainian society, and they describe Chernobyl as their "paradise".

0-of-Freedom_2012_3.jpg
Siri Hermansen, Land of Freedom, 2012

0i1siri70964001_o.jpg
Siri Hermansen at Verkligheten. Photo: Fanny Carinasdotter

In the other film shown in the gallery, Land of Freedom, Hermansen follows the members of The Yes Farm, an artistic/activist community that moved from San Francisco to Detroit where they repaired and settled in one of the city's many abandoned buildings. The members of the collective see Detroit as an opportunity to explore new ways to live a more sustainable and socially-conscious life, through farming, gardening and a return to skills that the Fordist economy made obsolete.

0gunila9902_n.jpg
Gunilla Bandolin, Bi installation at Verkligheten. Photo: Fanny Carinasdotter

0i1gunilllla257_o.jpg
Gunilla Bandolin, Bi installation at Verkligheten. Photo: Fanny Carinasdotter

0gunilla5363643355162_o.jpg
Gunilla Bandolin, Bi installation at Verkligheten. Photo: Fanny Carinasdotter

If the earth was destroyed, Gunilla Bandolin would start building up the whole survival process with a bee-hive. Bee hives provide you with honey and pollen, the bees would pollinate the few plants that subsisted and new crops would grow. A beehive also produces surplus warmth, and thus cheap, retrievable energy.

It is a prototype like this, or the beginning of it, that I have tried to create in this exhibition. I want the bee-hives to be made in a transparent material and preferable place them in a shopping centre to remind people of the conditions of our existence. It is calculated that about 70% of what we have on our daily plates is dependent on pollinating insects.

KasparsLielgalvis.jpg
Kaspars Lielgalvis, Non-convertible culture currencies

0graphMG_1830-770x400.jpg

0graphkaspars.jpg
Kaspars Lielgalvis, Non-convertible Culture Currencies in Trailer Gallery, at Umeå University. Photo: Fanny Carinasdotter

Artist and art manager Kaspars Lielgalvis proposes the use of a new culture currencies as a possible solution to the situation of funding culture which has suffered greatly from the ongoing financial crisis.

This new medium of exchange, called Non-convertible Culture Currencies, would be used only in the cultural context. The first Culture currency - Dobžiks is already in use since March 2012 as a valid payment for entering events at the Totaldobže Art Center in Riga. There is a plan to create a worldwide network of those organizations that will accept Culture currencies and use Culture currencies as a payment for work which is done in cultural field and in most cases is paid too less.

Other works and images from the festival:

0anthonyclair74_o.jpg
Anthony Clair Wagner. Photo: Fanny Carinasdotter

0anthonyclair326352_n.jpg
Anthony Clair Wagner. Photo: Fanny Carinasdotter

Isabelle Fremeaux, John Jordan and Kypros Kyprianou, Paths Through Utopias (trailer)

Isabelle Fremeaux, John Jordan and Kypros Kyprianou spent seven months on the road visiting eleven Utopian communities across Europe, documenting a parallel universe where money is worthless and private property has been abolished.

0i1antti030415921593767904_o.jpg

0i1antttimush95_o.jpg
Antti Laitinen at Verkligheten. Photo: Fanny Carinasdotter

0i1lisabusby56489107780976842_n.jpg
Lisa Busby. Photo: Fanny Carinasdotter

0emmalina5108947_o.jpg
Emma-Lina Ericson, I Still Have an Other-Ache at Kungsgatan 92. Photo: Fanny Carinasdotter

0atsuko905994_o.jpg
Atsuko Otsuka's photo showing animals living in the "no-go zone" in Fukushima. Photo: Fanny Carinasdotter

ErikSjodin.jpg
Erik Sjodin, installation with aquaponics system

MikaelGudrunsson.jpg
Erik Mikael Gudrunsson's work

ChtoDelat.jpg
Chto Delat, The Tower

The festival, which ran in collaboration with Survival Kit 6 in Riga, was organised by Verkligheten, a non-commercial and artist-run gallery that explores various kinds of art expressions.

Processing n00b. How to Objects?

[SOLVED]

To put it very simply, I have this program which shows me a bike wheel (object) and it spins continuously given a certain velocity.

Every rotation is saved in the variable "rotations". I want to write a function for the class the object "bikeWheel" belongs to so that once "rotations" is equal to 50, the wheel stops moving.

So I wrote something like this within the class:

void stopIt(){

if(rotations==50){ a=0; // a corresponds to the velocity I have given to the wheel } 

But it doesn't work. The wheel just keeps on spinning continuously. What's going on here exactly and how can I fix it?

Thank you in advance.

submitted by Keadis
[link] [12 comments]

Crazy cp5 Textfield ArrayIndexOutOfBoundsException. [SOLVED!]

hey folks, I just had a discovery with cp5s Textfields. For months I have been using them, and simply typing certain strings in them while my program was running was enough to crash the whole program. It was the craziest thing, the string "1234567" would crash it, but not the string " 1234567", with a space before the it wouldn't. It drove me nuts, I couldn't figure out why I could type some stuff, but not other stuff, it wasn't length, because while "1234567" wasn't allowed, "123456aaaaaaaaaaaaaaaaaaaaaaaa" was allowed, no problem.

wtf? right? well here is the reason. "1234567" will work with most cp5 Textfields, however it doesn't work if the width of the Textfield is 59-61(it makes no sense to me, but then again, neither do the inner workings of the Processing library system). I had my width at 60, changed it to 62 and now it works fine. Now, that said, there are probably random strings that don't work with a width of 62, but for now none have presented themselves and it is working fine :)

good day folks!

submitted by youhavejustreadthis
[link] [comment]

Can’t get OpenCV to work with Processing

I use Processing 2.2.1 (on Elementary OS Freya) and I've installed the OpenCV library (I added the downloaded folder into the libraries folder in my sketchbook) and I've also downloaded a few Processing-OpenCV examples, but I am unable to run any of them. The error says -

A library used by this sketch is not installed properly.

In the console the error says -

~/code/processing/sketchbook/libraries/OpenCV/library/libOpenCV.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

A library relies on native code that's not available. Or only works properly when the sketch is run as a 32-bit application.

There is no option under the Preferences menu to run the sketch in 32 bit mode. What am I doing wrong?

submitted by R0mper_St0mper
[link] [2 comments]