Help with my project

https://gist.github.com/malikouda/99573424c9e037bfb14df7e6f104356f

I have a project to do for my class. Basically, this project's focus is on sound. But after blowing my eardrums and my speakers out more than a few times, I need help.

Basically, I want to make it so that whenever I click the mouse a laser is fired and a sound plays, and when it hits a UFO the laser disappears and a different sound plays. How do I do this?

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

Can anyone help with multi-window in python? Also is python processing really that bad?

Hello, I am doing some last minute coursework in processing. I have given myself the task of creating a program for generating various fractals in processing with a very basic UI. That's besides the point, I am trying to use python because it's the scripting language I'm most familiar with. I tried to set up a way for the fractal to display in one window while you manipulate the settings from another window. I have found a few ways of creating multiple windows using java processing, however when I try to translate the code to python, I get unusual bugs and it generally doesn't work.

The (mostly) functional Java version looks like this:

void setup() { size(400, 400); } void draw() { background(0); ellipse(50, 50, 10, 10); } void mousePressed() { println("Creating second sketch..."); String[] args = {"TwoFrameTest"}; SecondApplet sa = new SecondApplet(); PApplet.runSketch(args, sa); println("Done."); } public class SecondApplet extends PApplet { public void settings() { size(200, 200, P3D); } public void draw() { background(255); translate(width/2, height/2); sphere(50); } } 

Using this makes a new window pop up whenever I click the main window, however the main window seems to ignore the line size(400,400)

My python code which doesn't work is this:

def setup(): size(800,800) def draw(): background(50) def mousePressed(): args = ["pepsitest"] sa = SecondApplet() PApplet.runSketch(args, sa) class SecondApplet(PApplet): def settings(): size(400,400) def draw(): background(255) 

And it tells me that I am passing a parameter into settings() when it requires 0 parameters. I have tried swapping it out for setup() and it says the same thing, and I've also tried setup(self) which generates another window but it isn't named correctly and isn't 400x400px meaning that the setup isn't actually affecting the new window.

Can anyone suggest a fix? Should I forget using python and try to convert all my code to Java even if it means a few all-nighters strengthening my Java skills as my deadline approaches?

Thank you to anyone who can help.

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

[Student Help] Wireless video streaming and processing

Hi!

For a project I am working on I want to achieve the following. A webcam that follows you by facetracking. I have got the facetracking and the movement already working. Now I want it to be compact.

At this moment I have a lot of cables to get this to work. Arduino power and Serial, webcam cable. All of this is connected to a laptop.

I already tried to use a Raspberry Pi, it is to weak and doesn't run OpenCV because it is not 64bit.

My idea is to make it all wireless. I can make the arduino wireless by using UDP and a MKR1000, only need a powerbank.

Is it possible to use an android phone to stream video over wifi (no internet, just an offline closed network) and send it to another PC to do the processing and send the data to the MKR1000 which controls the servo's.

Thanks in advance!

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

Breeding a Planetary Community Chicken


Koen Vanmechelen, Planetary Community Chicken project (Incubators with the fertilised eggs from the parent chickens.) Photo courtesy of Goele Schoofs


Koen Vanmechelen, Planetary Community Chicken project, Socle du Monde Biennale 2017. Photo: Ole Jørgensen

Artist Koen Vanmechelen believes that we like to inject our own culture into other living beings. And in particular chickens.

Take the French chicken Poulet de Bresse, for example. It is white, with a red comb and blue feet: the colours of the flag of France! The Chinese raise a kind of fluffy chicken that is covered in silky plumage. As for the Americans, they obviously prefer their chicken to be as massive as possible.

Since 1999, the Belgian artist has been patiently interbreeding national varieties of the domesticated bird for his Cosmopolitan Chicken Project. His first hybrid, the Mechelse Bresse, was a cross between the Belgian Mechelse Koekoek and the French Poulet de Bresse. Each successive generation of the Cosmopolitan Chicken is crossbred with a chicken breed from another country. And each of them is a work of art, a feathery advocate for diversity and an ongoing research project: Vanmechelen hopes to eventually create a Cosmopolitan Chicken, a bird that would carry the genes of all the chicken breeds on this planet.


Koen Vanmechelen, Cosmopolitan Chicken Project (Parent animals in the courtyard: Mechelse Dansk x Bovan Browns)


Koen Vanmechelen, Planetary Community Chicken project, Socle du Monde Biennale 2017. Photo: Ole Jørgensen

The Cosmopolitan Chicken Project has recently reached its 21st generation. This new hybrid is the Mechelse Danish, a crossing between the Mechelse Wyandotte and the Danish hen. You can discover it at Socle du Monde, the oldest Danish biennale focusing on contemporary art which opened a few days ago in Herning.

This Cosmopolitan Chicken is only one part of the installation. The art biennale also showcases the Planetary Community Chicken, this time a cross between Cosmopolitan roosters and commercial hens. In this case, a local breed called the Danish Bovan Brown.

Working together with scientists to monitor the breeding process and the well-being of the animals, Vanmechelen soon realized that his highly genetically diverse Cosmopolitan Chickens had become more resilient, more adaptable, less susceptible to diseases than their purebred peers and, interestingly, they also exhibit less aggressive behaviour. With this new spin on his artistic investigation, Vanmechelen hopes to bring together the global of the ‘art chickens’ with the local of their commercial peers, and thus the diversity and robustness of the Cosmopolitan Chickens with the productivity of the industrial chicken.

The idea started in Detroit. Vanmechelen was preparing an exhibition at the Wasserman Projects gallery and realized it might be objectionable to raise chickens for purely artistic reasons in a city that is going through so much economic hardship. So, together with Gary Wasserman, he decided to find a way to ‘activate his art in the community’. Contrary to the ‘art’ chickens these planetary chickens are used for consumption, the eggs can indeed be eaten by the local communities. Currently pilot projects of the Planetary Chicken are developed also in Zimbabwe, Detroit and in Genk where Vanmechelen studios and foundation headquarters are based.

“I think of the Planetary Community Chicken as a gift to the different communities to make their own chicken that is suited to their particular environment,” the artist explained in a recent interview with Modern Farmer.


Koen Vanmechelen, Planetary Community Chicken project (Incubators with the fertilised eggs from the parent chickens), Socle du Monde Biennale 2017. Photo: Jens Wolter


Koen Vanmechelen, Planetary Community Chicken project (Coop for the Planetary Community Chickens when they grow up.) Photo courtesy of Goele Schoofs

The installation at the Socle du Monde biennale shows the entire breeding process: incubators with the fertilised eggs from the parent chickens, hanging cage for the Planetary Chicken newborns, wooden coop for the Planetary Community Chickens when they grow up, etc. Meanwhile, the parent birds (Mechelse Dansk and Bovan Browns) are roaming in the courtyard.


Books of Genomes. Photo courtesy of Goele Schoofs

The artists is also showing the Library of Collected Knowledge, a growing collection of books on topics related to his work. The space also displays the Books of Genomes which contains the DNA sequence of the chickens in the courtyard and demonstrates thus that the crossbred chickens are more diverse than the industrial one.

Vanmechelen usually breeds about a hundred of each generation. He keeps some of them on a huge farm in Belgium. The others find a home in various farms across the globe. After the exhibition in Herning, Copenhagen-based organization Beyond Coffee will take care of Vanmechelen’s new Planetary Community Chickens. They will play a role in a circular urban mushroom farm. Organic oyster mushrooms feed on collected coffee grounds. After harvest, the waste material constitutes a protein-rich substrate that is given to mealworms. The chickens will live on a diet of mealworms and other foraged organic waste.


Koen Vanmechelen, Planetary Community Chicken project (Hanging cage for the chicks), 2017


Koen Vanmechelen, Cosmopolitan Chicken project (portraits of the forefathers of the Cosmopolitan rooster), Socle du Monde Biennale 2017. Photo: Ole Jørgensen

There’s a few videos in which Koen Vanmechelen explains his work. This is a recent one:

Artist Talk: Koen Vanmechelen, “Cosmopolitan Chicken Project” at Museum of Contemporary Art Detroit – MOCAD

The Planetary Chicken and the Cosmopolitan Chicken are on view inside the Herning Højskole as part of biennale 2017 Socle du Monde Biennale – to challenge the Earth, the Moon, the Sun & the Stars. The event remains open until 27 August 2017.

[Coding Help] How to fix a bug using the append function

I am using the append function to allow me to add more objects to the window but when I have it in a class and put it in the draw function in the driver class it loops multiple objects rather than one at a time. How would I fix this but still have it in the class?

class Alien1 { // Global variables float x; // x location variable for the Alien float y; // y location variable for the Alien // RGB values for the Alien's main color float r; float g; float b; // Directional and speed values for movement float xspeed; float yspeed; float xdirection; float ydirection; /*----------------------------------------------------------------*/ // Constructor Alien1() { x=width/2; y=height/2; xspeed = random(2.2, 5); yspeed = random(2.2, 5); xdirection = 1; ydirection = 1; } /*----------------------------------------------------------------*/ // Functions go below here void display() { stroke(0, 0, 0); fill(0, 220, 90); ellipse(x+250, y+200, 200, 200); fill(160, 210, 230); rect(x+245, y+100, 10, 140); stroke(255, 255, 255); fill(0, 0, 255); ellipse(x+190, y+200, 30, 30); fill(255, 0, 255); ellipse(x+310, y+200, 30, 30); } // Manipulates the array to add more objects // BUG: When the mouse is clicked it adds more than one object at a time void addAlien1() { if (mousePressed) { Alien1 alien2 = new Alien1(); alien1 = ( Alien1[] ) append(alien1, alien2); } } void moveAlien1() { x = x + (xspeed * xdirection); y = y + (yspeed * ydirection); } void bounceAlien1() { if (x > width || x < 0) { xdirection *= -1; } if (y > height || y < 0) { ydirection *= -1; } } void colorChanger() { // TODO: Use the RGB float values to manipulate them in here for a cool color changing effect } } 
submitted by /u/kemar1997
[link] [comments]