processing

genetic algorithms for webs

I had the first Skype session with Ollie Glass last night, where we discussed the first stages of exploring the use of genetic algorithms to evolve spiders’ webs. It was very useful, and I learned a lot.

The first reveleation was a different technique for checking to see whether a web had trapped a spider. I’d assumed that we would have to check each strand of each web for every fly, and suggested that we ran a first-pass check to see whether a fly was within the outer edges of a web, and only if it was would we then run a more detailed check against each strand.

Ollie, however, suggested a cunning alternative: check the colour of the pixel that a fly was on, and if it was web-coloured then it would be trapped. The downside is that this technique wouldn’t identify which web had trapped the fly, which would be important if we were going to rank webs according to how many flies they succeeded in catching. Or would it? Each web could be a very slightly different colour, so the colour of the pixel the fly was on would, in fact, identify the successful web!

We then had a fascinating discussion on whether the detection routine should be a method for the ‘fly’ class or the ‘spider’ class. In the end, we agreed that although it might be more realistic for the web to detect the presence of a fly, it was a neater programming solution for the fly to check, since we would only have to check one pixel per fly, rather than every pixel of ever web. The fly would then send a signal to the environment (in the shape of the overall programme), which would in turn signal other parts of the environment.

Discussion turned to how we might develop the webs. Ollie was keen to advance in small increments, though keeping a note of ideas for fture stages, which makes sense, and is well suited to the approach of object oriented programming.

Immediately after the session I tried to write the code for checking the colour of pixels. We’d run a small sketch during the session to test it, and the principle worked fine, but my first attempt for the web simulation slowed the code to a crawl. I’ll try again, reducing the number of flies, and see if I can code it more efficiently.

Tags: , ,

Tuesday, July 13th, 2010 coding No Comments

what a tangled web we weave

I’ve started work on my first genetic algorithm, to see if I can evolve spiders’ webs. Ollie Glass in Brighton will be helping me via Skype, and our first session is scheduled for tomorrow evening. So far I’ve built a simple test, creating objects for the flies and the webs, to refresh my memory of Processing. I’m keen to see what we can achieve.

Tags: , ,

Sunday, July 11th, 2010 coding No Comments

unforeseen side effects

My cold is preventing me from concentrating on anything, so I’m gathering things to do in the future when my capacity returns. I’ve ordered The Computational Beauty of Nature by G W Flake, which I found in the Nature of Code section of Daniel Shiffman‘s website.

This cold is costing me a lot of money.

Tags:

Thursday, May 13th, 2010 coding No Comments

sudden burst of activity

I’ve not done much creatively for several months, but just recently I’ve had a surge of interest. Playing Martian Fluxx encouraged me to start designing a version based on Star Wars, not just substituting one set of text and graphics with another but altering the mechanics in an appropriate way.

I’ve also resumed reading about genetic algorithms, and arranged for online tuition sessions with Ollie Glass to help me use them in Processing. The tutoring was due to start last night, but had to be postponed  for a couple of weeks. In the meantime, at Ollie’s suggestion, I’ve summarised my understanding of evolution in plain English then expressed it as a flowchart. I can glimpse the structure of a Processing sketch, but I’ve still to grasp some of the bigger hows and whys.

Thirdly, I’ve been exploring some elementary Arduino projects, and ordered parts for a touch screen controller, taken from Practical Arduino, which I might link initially to the virtual colour mixer example on the Arduino website. Yes, I know that touchscreens are no longer exotic, but I’m intrigued by the possibilities. I can imagine using the touch screen controller to adjust a genetic algorithm project, perhaps even intervening wirelessly as simple robots attempt to pass on their learning to future generations.

Alternatively, the touch screen could be a remote controller for a stop motion camera…

Tags: , ,

Saturday, May 8th, 2010 coding, creativity, games No Comments

ninety-nine red balloons floating in the summer sky – nena

Following the recent Processing course in Brighton, I was inspired to create a simple filter, just as an experiment. It considers the pixels of a static image. If the red value is greater than the green and blue values by a certain amount, it leaves the pixel unchanged, otherwise it converts the pixel to a greyscale, based on the pixel’s brightness, and darkens it slightly to increase the contrast:

red_filter003

The next step would be to apply this to a live video feed. Why? I have no idea, but I’d like to try it.

Tags: ,

Wednesday, September 23rd, 2009 coding No Comments

sources of inspiration

I went on an introductory course on Processing at the weekend. I confess that for some of the time I was a bit grumpy, the result of two nights’ sleep disturbed by noises in the street and in the hotel, which meant I allowed one of delegates’ mannerisms to irritate me, but I perked up once I started talking to the guy sitting next to me.

Stuart is quiet-spoken but very interesting. Normally I pay little attention to the stories told to me by strangers on such occasions, but Stuart has worked with my hero, Brian Eno, so I was avid to hear as much as possible. Apparently, Brian has the skills, rare among the talented, of paying attention to others and of making them feel important. It’s not my place to pass on anything else that Stuart said (not that he broached any confidences), but his tales of working in a studio and on the road with some famous bands were fascinating.

Stuart mainly works with Max MSP, which I know only by name and reputation, and when asked, he showed me some of his creations, which appear mind-boggling complex to the uninitiated. In turn, I showed Stuart my rudimentary slitscan experiment in Processing, and felt smugly pleased with myself when he expressed interest, albeit probably only politely.

The combination of talking with Stuart and attending the course has rekindled my determination to experiment with Processing. I can’t justifiably develop Processing sketches during work time, but I can investigate it as part of our preparations for a digital art exhibition – have a look at our new blog.

Tags:

Tuesday, September 15th, 2009 coding No Comments

tiny sketches

There’s just over a week left for submissions in the competition to create Processing sketches using 200 characters or less. Even better, you can look at the other submissions, examine the code and see how the authors have achieved their results. I’m in awe.

Tags:

Saturday, September 5th, 2009 coding No Comments

anonymous confession

I’ve been busy doing other things recently, but this piece of interactive work appealed to me, because it combines two interests of mine – Processing and PostSecret – and somehow creates something considerably bigger than either of them. I think it’s because the large number of mandalas lose their detail and become a roiling mass of mist, representing all those turbulent secrets and emotions.

Tags:

Friday, August 14th, 2009 art No Comments

picking up where i left off

Things are starting to look up. I’ve arranged a few activities, including a trip to Edinburgh, and the theatre visit and painting course I booked a while ago are both imminent. I’ve also started thinking once more about my slitscan sketch in Processing.

I watched a brief explanation on DVD of how Doug Turnbull created the slitscan sequences in ‘2001 A Space Oddessey’. It turns out that he achieved the mottled effect not by filming the slit itself but by filming its reflection on a roughly textured mirrored cylinder. I realise that this is being pedantic, but since random noise was introduced into the sequence, it’s impossible for anyone, despite their claims, to decode the original images used in the slitscan sequences. These re-creations still have the noise in them.

It would be possible to introduce an equivalent noise to my Processing slitscan sketch, but I’m still keen to try my hand at an analogue version. That will have unavoidably irregular movement of the camera on the vertical axis anyway, which may be sufficient distortion.

Tags: ,

Tuesday, June 30th, 2009 photography 1 Comment

slitscan the can – s quatro

I’ve been developing my Processing slitscan filter to create a sequence of images from a single original source.

Although manipulating individual pixels led to some interesting effects, I couldn’t work out how to achieve what I was really after. I switched to using get() and set(), thus leaving the hard work of calculation to Processing, and we’re both happier as a result. The only drawback is that images drawn with set() can’t be tinted, so, to suggest distance, I added a narrow black rectangle over each row of pixels, filled with decreasing transparency towards the centre.

I’m still not there yet, but the following clip is much closer:

Here’s the source image:

leaves_small

Tags: ,

Saturday, May 30th, 2009 coding 1 Comment