All posts by amr627

Painting with Computer Vision

photo 2

For my final project, I knew that I wanted to incorporate everything we had learned for both the Arduino and Processing. I knew that I waned it to be playful, tactile and interactive. After a few sketches and a few suggestions from my lovely peers, I came up with a glove that can be used to digitally draw on a computer screen or projection. The glove works by sending out an infrared signal from the tip of the pointer finger, which the camera on the computer reads and converts to a colorful pen. The size of the pen is regulated by a flex sensor that runs along the bottom of the same finger. The color of the pen is regulated using a potentiometer. The code lends itself to easy changes of the pen colors, but as I have set them now, they run through red, orange, yellow, green, blue and purple, in that order. Pressing any key will clear the drawing surface. Also, to give credit where credit is due, I have to thank Imogen Heap for her inspiring musical gloves (and Jeremiah for sharing the video) and Golan Levin’s brightness tracking code, which helped me to work out a bunch of kinks and led me to abandon the color tracking that I used in the earlier versions of this glove. The song I use is The Fifth Hand by Parra for Cuva.

photo 1

Here is a video of the glove in action, I apologize for the slight lag, the pen gets a little jumpy when quicktime is also recording:

Click Me!!!

And finally, here is my code:

and Arduino side:

 

Computational Media

Because of the opportunities it affords, computational is currently the most exciting field of media production. Because of it’s modularity and adaptability (universality), computational media allows creators to invent entirely new ways of producing and parsing information, as well as expanding upon the methods of traditional media by digitizing them.  Before this class, my primary academic exposure to computational media had all been theoretical or philosophic, rather than hands-on. Aside for digitally-processed traditional media, photo, video, writing, etc), this class has been my first foray into media which is born from and inextricably tied to computers.

Computational media is a very broad term, rapidly growing to encompass a vast majority of all media produced, as we rely more heavily on computers. The term encompasses all ‘new media’ that was created with the use of computers. Another staple of computational media is it’s interactivity. For the most part, users participate in the reading of new media, and provide feedback, which, in turn, alters their experience with the information. This stands in stark contrast to old media, which had a 1-directional flow, telling viewers, rather than asking them. Another feature of new media is accessibility, primarily because smartphones and other devices have become   so widespread, taking the form of an auxiliary limb. However, just because something is transmitted though a computational media channel, does not automatically make the information being communicated ‘new’ or ‘computational.’ Watching an old film on a computer does not make the original media object any different, unless menu items, online shopping, or other such features are integrated into the viewing experience.

The Arduino, which we have used extensively throughout the semester, is an excellent example of computational media, as well as a metaphor for its interactive elements. The Arduino, like any other computer, can produce different effects independently after being programmed, but what it does particularly well is reading signals and signs form the physical world, and translating them into information which can be easily processed by a computer. The code used on an Arduino is also modular and universal, making it easily transposed, much like movable type, and possible to read on any capable machine.

The breadth of computational media will only continue to grow in the future, as we increasingly rely on our devices to process and make sense of all of the data in our lives. It will likely be impossible to be successful in any field without at least the basic knowledge of how a computer works. The majority of users of technology see it as some sort of magic that floats around in a cloud and gets beamed down to them at the click of a button. Being ignorant of how this ‘magic’ works leaves those people at the mercy of the magicians. However, it is not likely that theft between users and adopters will continue to grow for much longer, as typing courses and basic programming begin to replace cursive and foreign language in schools.

The key to not becoming overwhelmed is to approach computational media and other technology as a tool to be taken advantage of, an extension of ourselves which enhances our lives. This is especially true as we move toward a world where nearly everything is electronic–an internet of things, where each of our possessions communicate amongst each other, collaborating to make our lives better or more convenient. Though the prospect of everything we do being turned into parable data can be somewhat daunting, even scary, it is just the nature of change. Instead of combating it, we should embrace the place that technology aims to take in our lives and take full advantage of its benefits. 

Holycrapbooks, Batman!

This week we had to use data. Most of my code is lifted from the example provided in class. I changed it around and tried to make it a bit creepier/more interesting.

    

I compared Isaac Asimov’s Foundation series and J.D. Salinger’s Catcher in the Rye. Both books are cited for inspiring violent behavior and murder in certain individuals (Timothy McVeigh and Mark David Chapman, respectively).  I wanted to compare the words both authors use most often to see if there are any similarities.

I had some trouble removing certain words, so  the way it is in the code is a little slap/dash, because I got overwhelmed with doing something more intricate. I’d like to remove some more of the small words, maybe by taking out every 3-letter word and below.

 

Screen Shot 2014-04-14 at 2.42.07 PM

 

Sex Bomb

IMG_2355

For this week, I used the camera to detect a light on my dogs head, and used processing to place a crown there, thus making him a pretty, pretty princess. It’s a pretty simple design, and I mostly used/modified Dan’s color pixel chase code. The LED is just an LED hooked up to two batteries with some tape. I found it works better when following a light. It would be cool to explore that with infrared as well, but I had a hard time getting my IR LED to work right.

IMG_2357

video!

http://youtu.be/zgxtE626SjI

code!

 

STAY SEXY GUYS!!!

Spider Crush

heaven

For the telecommunication between the Arduino and Processing I made a simple program about killing a spider, cause there happened to be one on the wall as I began this project.

bea arthur pizza
This has nothing to do with my project, but I found a huge gallery of Bea Arthur + pizza landscapes online last night…. many potential games guys

I used the photocell sensor to represent the spider, the more you crush it, the closer the spider gets to heaven. I guess I could have used a pressure sensor as well, but the photocell was already installed and we can just make a metaphorical leap to us draining the light out of the spider’s life before he gets to go to heaven.

SORRY about the music, but I honestly couldn’t help myself.

http://youtu.be/YTQ28v2wcF0

 

FIXED!! Pee Dodge – The R.Kelly Saga Completed

NEW VIDEO OF WORKING GAME:

http://youtu.be/cHm3-YetP2s

For this week, I worked on a game that I started at the end of last class. Unfortunately, over break my access to computers/internet was much more limited than I had anticipated, so I did not have as much time to work on this as I would have liked.

The basic premise is dodging drops of R.Kelly’s pee by controlling an avatar which follows your mouse. Every time a pee drop hits, text should pop up saying “GROSS!” but I had some issues with getting int and float to work together, and figuring out .intersect. Hopefully I will be able to make some progress, but if not, maybe you guys can help.

Screen Shot 2014-03-24 at 12.41.18 PM

I found the code for the moving eyes here, so all credit for that feature goes to that awesome programmer: http://bavc-dposs.blogspot.com/2012/02/eye-follower-processing-sketch.html

Here is the video:

http://youtu.be/_mVIGnv1cJc

And the code:

EYE

PEE

 

 

 

 

Trapped in the Ignition Remix

 

As you may remember from last week, I did the R Kelly bounce. For this version, I made the code for the edges more concise, separated my code into modular functions. Next I added in for loops, and R. Kelly is pretty much synonymous with Trapped in the Closet and peeing on people. Because I want to steer clear of animating the latter, I added in for loops of some of the key characters from the Big Man reveal scene, all chasing each-other at different speeds. All of this comes together to be a rather distracting background for my original rainbow ball bounce/speed change.

Trapped in the For Loop

Screen Shot 2014-03-10 at 3.45.30 AM

Also, I insulated my glue sniffing with push/pop matrices, like we did in class. I got some inspiration for how to do the rotation speeds from the star example in processing.

Yay code!

 

 

The Remix to Ignition

Screen Shot 2014-03-03 at 2.02.28 PM

For my bounce project, I decided to incorporate R. Kelly’s lovely jam: “Ignition (Remix)”

I tried to make the edges solid by having it bounce off of the diameter, rather than the center, but I encountered some difficulties with making it work on the 0 X and 0 Y axis. Maybe you guys could tell me why.

The ball is programmed to cycle through a random rainbow of colors while bouncing faster and faster (as it gets more and more excited by the smoothness of the tunes) until it is eventually moving too fast for us to see.

kellybounce

Here is a video of my program running, followed by the code. The screencap quality isn’t the best, so I apologize for the jumpiness.

With Caleb’s help, I fixed the aforementioned bugs, making my edges solid. Not as concise, I could combine the X and the Y into || statements, but I may want to insert a random change depending on the wall that the ball hits,  so I will leave it as is. I also added a random speed change when the mouse is pressed and took out the auto acceleration. Here is my new code and a video:

bounce 2

 

 

‘Murica!

murica

I  was inspired to do this drawing because of the flag hanging above my bed. When trying to think of a geometric drawing, I realized that the American flag has a bunch of shapes and lines, so it would be the perfect candidate. However, I decided not to go for all 50 stars, to spare you the code eyesore and me the confusion of dealing with 50 different star shapes. What came out is my personal take on the flag, with 8 wonky stars and a black background to make it pop more.

photo (8)

 

my code:

 

 

Frère Jacques

 

For my stupid pet trick I decided to make an alarm. Lately I’ve been making an effort to wake up earlier every day so it’s easier to do on days I have to, circadian rhythm, all that jazz. Since spring finally seems to me coming (sort of) and the days are getting longer, this alarm will be triggered by the sunrise.

It’s a pretty basic setup: 2 LEDs, a piezo buzzer and a photo cell. When light hits the photocell (assuming daylight, though in this case I used the brightness on my computer), first a yellow LED is triggered, as a warning that it’s time to wake up. Once more light hits, the red LED is activated. When it is finally bright, and time to get up, the piezo plays the tune of Frère Jaques, a song about waking up, which also happens to feature just a few simple notes.

Here is the code, it’s a little long-winded because of the song, but easy to follow. In it, I use two ways of initializing the variable and a few if/else statements.

http://youtu.be/UyBiVwfu2ZY

RGBlink

 

Ok, so after messing around with the RGB LED for a good two hours, I’ll report my results:

“If you are using a common ANODE LED instead of common CATHODE, connect the long pin to +5 instead of ground”

so.. connecting it to ground as we do with the others won’t work, also, if I write LOW to a pin will turn the LED on and if I write HIGH, that will turn it off. Oh yeah, and all 3 inputs use the same ground (which is actually 5V). Hopefully at some point in class we can delve deeper into why I can’t get it to listen to me, no matter what I do. 

So, here is something I managed to get to work much earlier in the night:

the RGBlink!

http://www.youtube.com/watch?v=dhUMZsbcsf0&feature=youtu.be

The red wires connect the red switch and LED, the green to the green, the blue to the blue. Pressing the switch makes the LED blink, pressing both switches makes both blink, etc. If all 3 are pressed, the LEDs will blink in order starting from whichever was pressed first. I used the two tiny button switches and one that I soldered earlier this week. Here is the code:

 

 

UPDATE::::: after learning a bit more about cathodes and anodes, I figured out that we have a common anode LED, so the long leg from the LED should always lead to 5v, and passing a value of 0 through the LED turns it on (while passing 255 will turn it off) so it is a little counter-intuitive. And on a frustrating, though less important note, the leg order is: R(Anode)BG, not RGB like I thought.

I borrowed this RGB blink code from an instuctable and added an switch+if statement:

http://www.youtube.com/watch?v=nvrFK9KNcvk

 

it still didn’t work 100% as I expected, but I figured you guys might like the blinky LED

 

Kiss Switch

Though my switch isn’t the most practical, and admittedly a little cheesy, hopefully you guys will like it. Because our discussion of first kisses last Monday, and because it’s February so Valentine’s day decorations are inescapable, I decided to run with the theme. As per the assignment, the switch isn’t activated by using fingers, but rather a kiss.

Photo on 2-2-14 at 10.57 PM

In order for the LED to be activated, the two lips must touch. I could show it to you in action on my cat or something, but that would just be awkward, so I will just hold the two ends instead.

Movie on 2-2-14 at 11.07 PM

(the videos don’t seem to be working right now, maybe it’s just me?)

Since it is not physical lips touching, I envision this as something that could be developed for digital kisses, maybe sending one via bits and bytes to a loved one who is far away, where the LED is a way of signaling that, though it is not direct, you have made contact with someone across the world.

Photo on 2-2-14 at 11.19 PM Photo on 2-2-14 at 11.24 PM