blog

Learning Python by building image-pooping Markov chains

Fri Dec 19 2008 23:41:05 GMT-0800 (Pacific Standard Time)

tags: python programming markov

In my ongoing attempt to learn yet another utilitarian programming language, I have decided to pick up some Python. I'm only still scratching the surface (for example I haven't even touched python regular expressions yet, nor object persistence/marshalling), but I've managed to make a few toys. I often learn best by just diving in and doing, and I've come to enjoy stumbling through toy projects when learning a new language.

So I thought it would be interesting to see what kind of images I could create with a self-modifying, mutative Markov chain. While the results below aren't yet self-modifying, they're somewhat entertaining eye-candy that's probably been done hundreds of times before.

image image image image image image image image image image image image image image image image image image image image image image

I'm using the Python Imaging Lirbary (PIL) to create/paint the images. Sure, it's pretty well documented and intuitive, but doesn't immediatly support drawing with alpha transparency, which is a real bummer. There is at least one other drawing toolkit that does alpha, and one that does that with opengl. It would be nice to render these in realtime, but the current incantation seems to take about a second to do about 54k 2d polygons, which isn't exactly fast. I'm also not yet sure how much of that time is spent in python versus actual Tk rendering.

I'm now mostly interested in switching drawing toolkits to support alpha, doing marshalling to save/restore interesting chains, and coming up with interesting strategies of self-modification. The current models are very linear, and it might be nice to have a little abstraction that allows nonlinear curving to happen more seamlessly.

I'll probably share the code after I continue to learn from my mistakes and make things more better.

benito + kolpxnty + barbie == <3

Mon Nov 10 2008 00:36:32 GMT-0800 (Pacific Standard Time)

tags: dorkbotpdx dorkbot benito kolpxnty atmel avr


kolpxnty camera phone teaser! from breedx on Vimeo.

I've mostly finished the next phase of the kolpxnty board -- driving the thing from midi over usb from apps like pd (pure-data). In the above clip, a braindead pd patch is sequencing the bowels of a Barbie telephone children's toy without any additional circuit bending bonus points. My video recorder died, so the video was recorded in near darkness on my phone ("Sorry folks!").

The next phase is to see how it can switch in circuit bent components (pitch down resistors/caps, for example) and to shrink the board size before having it fabbed.

Quickie perl hack to fix up image timestamps with Exif data

Tue Oct 21 2008 22:34:36 GMT-0700 (Pacific Daylight Time)

tags: perl hack exif image timestamp

canon

Ooops! I've been organizing image files recently from my camera and realized that I was losing timestamps when moving them to a remote Samba share. Fortunately, image formats and cameras these days are smart enough to embed the original timestamp inside the image itself (assuming you have a moderately recent camera and assuming you've gone thru the process of configuring the date/time).

I hacked up the almost trivial perl script below to touch each file with the data from the exif data.


#!/usr/bin/perl # Touch files with Exim timestamps use strict; foreach my $f (@ARGV){    my $d = jhead $f | grep 'Date/Time';    chomp $d;    $d =~ s/^Date/Time.*: (d+):(d+):(d+) (d+):(d+):(d+)/$1$2$3$4$5.$6/;    touch -t "$d" "$f"; }

The script depends on the jhead tool to get the data from the image, but the rest is dead simple.

More cracklebox boards...

Sun Sep 28 2008 16:46:32 GMT-0700 (Pacific Daylight Time)

tags: phone dorkbotpdx dorkbot cracklebox steim

phone_20080928164631.jpg I etched 3 more cracklebox boards at todays open dorkbot workshop. Didn't get them populated yet but will very soon...

Underwater skateboard is awesome!

Mon Sep 01 2008 23:05:06 GMT-0700 (Pacific Daylight Time)

tags: phone

phone_20080901230505.jpg Where were these things when we were kids huh?? We had to use our old wooden decks, and they just were not designed for sweet underwater shredding action!!

Some of the tiniest soldering I've ever done

Wed Aug 27 2008 23:25:13 GMT-0700 (Pacific Daylight Time)

tags: dorkbot dorkbotpdx benito avr atmel usb programmer soldering

In the last week or two I've been doing some of the smallest soldering I've ever attempted.

It all started with the KOLPXNTY board I've been designing and prototyping. I won't dive into detail here (maybe later!?), but the basic goal is to trigger a fairly large number of circuit bent devices from a networked computer.

kolpxnty

I'll put up a documentation page if/when it's more relevant.

Although this certainly not rocket science, it's certainly the most complex 2-sided surface mount board I've attempted to design. Briefly, there are a few buses, a lot of traces, and a shitton of vias (for my amateur hand anyway). I soldered down the teeny LEDs and 6 small SMT chips and the bypass caps and resistors and rested confident in knowing that even though the board was hand-ironed and soldered haphazardly, that it was good and efficient and tight.

Then I decided to finally build out the benito kits that I scored from Dorkbot Don a month or longer ago.

the little tuff one

Let's be clear -- this shit is pretty damn small. It's not exactly microscopic. It's still hand soldered, but wow, it's really tight. The TQFP part is really hard not to bridge, but the braid will save you. The LEDs are really light and challenging, but totally doable if careful. The remainder of the SMT parts (caps and resistors mostly) are surprisingly fun to mount and actually save you the trouble of cutting those long leads (like on thru-hole parts).

I built two of them and although I managed to ruin one of the LEDs on one of the boards, I have been able to confirm that they're both functional.

Don has really done some great and amazing work here!

Let's be absolutely clear: He's designed and built us a cheap and readily available platform that can act as a usb-to-and-from-serial bridge, an Atmel programmer, or even more generally, a really great cheap and open platform for USB+AVR hacking. Wanna control a servo? Sure, this can do it! Wanna read from an SPI sensor? Sure, this can do it too!

It's still probably in need of some general purpose cross-platform code and reusable modules, but what a great small, cheap, and efficient platform on which to build computer-enabled projects! It think it was nearly ten years ago that I read about the death of the serial port and the future of this newfangled USB thing.

It was a hobbyist nightmare. How were (are?) we going to deal with the insanity? Other than the overpriced FTDI chip (not to fully knock it -- that chip is great), the benito is the first real usb platform that does what we hobbyists kinda want. Granted the software has to be there to support it -- and it will follow soon. Pay attention. :)

KBOO dada surrealism radio festival is under way

Wed Aug 27 2008 22:33:29 GMT-0700 (Pacific Daylight Time)

tags: kboo dada surreal surrealism radio fm

kboo.dada It's really hard for me to type "dada". After years of brainwashing and typing and whoknowswhat, it always comes out "data". These are actually different concepts.

So there's a local, independent, community sponsored radio station that is doing a wonderfully brilliant 101 hours of dada and surrealism

I'm biased -- I have performed live on this community platform and I have helped out with a festival in the past...but this is really a great thing and I need to get the word out. Portlanders can listen on 90.7 on the fm dial, out of towners can also listen by streaming magic via the internet.

Once time time in time, in the spirit of dada, we proclaimed "stud pony midgets in bondage gear. $5" available at the student health center. It is altogether true and yet not real but quite false in its actuality and refuted in its continued insistence of existence. It is a failure baby and a falsehood meme of blind eye turning of steering quality of knowing. You will deny.

I've been following the gross artwork of Larry Carlson for a while...and to my surprise and joylation, he's got a segment slotted in the fest (see Thursday 6am -- yes, like 7 hours from now).

There's tons of great performances slated, including Argumentix and Celestville (both of which I'm a sucker for). Check out the full schedule for great victory.

The unicorn is late.

Tue Aug 05 2008 00:22:31 GMT-0700 (Pacific Daylight Time)

tags: phone

phone_20080805002230.jpgOk, fine, sure. It is a full month late and cheesy and now irrelevant...but the unicorn marks the first phone to blog photo post for noisybox! Yay!

Blink, wow, 6 months has passed.

Tue Jun 10 2008 23:11:03 GMT-0700 (Pacific Daylight Time)

tags: misc

Wow. I look up and it's already June. Where the hell has all the time gone? The blog and website have been stagnating a bit...mostly because of time shortages. My lifestyle has changed in such a way that it's often quite difficult for me to get time to even write a quick blurb...and just frankly, I haven't been terribly motivated to share thoughts, rants, stuff, or to document my work or to, uh, whatever it is we do on these blogs. What have I been doing?

  1. Working. Working a lot. I started a new position back in November and it's just been crunch crunch crunch. The pace might be letting up a bit. I hope so, that previous mode just isn't sustainable.
  2. Playing an hour live show on KBOO FM community radio. Infiltration Lab did a noise set that filled an hour of Jennifer Robin's Night of the Living Tongue show.
  3. Creating short video works. I had my first dabble into making video/film (a submission to http://www.quadruplex.co.uk/) and created a two-piece DVD running about 13 minutes.
  4. Preparing to circuit bend up at the St. John's No.Fest

Now what should I be doing?

  1. Cleaning up the sound from the KBOO show and mixing down the live video that Jared was nice enough to film. It would be nice to release both the audio and video some time this year.
  2. Documenting my audiopint progress and releasing supporting software and/or disc images. I at least need to put up a documentation page -- it's well overdue. I'm pretty sure I owe David some pictures too.
  3. Preparing for the St. John's thing -- I need to inventory parts and toys and make sure I have what I need. It's going to be fun or silly or both.
  4. Improve my video toolchain. There is a lot of room for improvement, optimization, and flexibility there. I think there are some interesting ideas, but unfortunately it's far from releasable in its current state.
  5. Cleanup and personal organization. I've really let my workspaces and organization slip, and I think it's a real detriment to my project progress...time to give that some attention soon.

I'm a swarm of ideas, I'm a pit of passion, and I'm a slave to time.

Haywire circuit bending workshop went really well.

Wed Jan 30 2008 21:57:25 GMT-0800 (Pacific Standard Time)

tags: dorkbot dorkbotpdx circuitbending workshop

On Sunday, I hosted a circuit bending workshop called "Haywire" with Dorkdbot Portland at PNCA.

haywire

There is some more detailed information over here and I have posted some pictures over here and added them to the DorkbotPDX flickr pool.

Overall, things went really well! There was a sizable turnout (35 or 40ish benders) and most seemed to really be enjoying the workshop. We encountered a hitch at the start involving lack of power and fire marshals, but things got rolling and people got into it. Although I forgot to start the recorder for my 30 minute introduction talk, I did record a couple hours of silly and chaotic ambient audio from the event. I hope to convert it to mp3 sometime soon and make it available online.

This was my first time putting on a workshop, and I certainly stood to learn a few things. Like:

  1. Arrive earlier than you want to. I showed up about 15 minutes early, which was right around the time everybody else showed up. It was nice to have the help carrying equipment, but I would have been less overwhelmed with more time.
  2. Check power before the workshop starts.
  3. Set clear ground rules about taking toys to hack. That is -- if you take it from the bin, you take it out of the building. I ended up hauling away a seizable tote full of half hacked or otherwise busted items. Ug!
  4. Have dedicated helpers on-hand to answer questions and run errands. If 40 or so people want to pick your brain, you're going to have a hard time...helpers can, uh, help!
  5. Try not to span a mealtime or schedule a break or provide food. If people leave, it can break up the momentum and worse, they might not come back.

I also probably should have prepared a few simple diagrams/tutorials that showed some basics, such as adding a line-out. Hopefully there will be a next time, and hopefully lessons learned will lead to a smoother workshop! Thanks again to everybody who signed!