Make: Online


Two Cells Enter! One Cell Leaves! Blood Wars!

White blood cells pitted against each other in ‘Blood Wars’ @ Wired UK

Blood Wars is an art-science installation that will pit white blood cells from two different people against each other in a “tournament” that aims to see which person has the strongest immune system.

The piece — by artist Kathy High — forms part of a new experimental exhibition between research laboratory SymbioticA and Dublin’s Science Gallery, called Visceral. Visceral explores the boundaries between art and living systems, bringing together more than a decade of work developed through SymbioticA’s art-science residency programme at The University of Western Australia. The aim is to show the tension between art and science and the cultural, economic and ethical implications of biosciences today.

 

Stardate: Clockwork Skies

I caught the wonderful Stardate program on AM radio this morning. Today’s program “Clockwork Skies” describes constellations that are named for tools or machinery.

The constellations are Sextans, Antlia, and Pyxis — the sextant, the air pump, and the magnetic compass. At around 9 o’clock, Sextans is low in the east, with Antlia and Pyxis climbing into view in the south and southeast.

Sextans was introduced by Johannes Hevelius, a 17th-century German astronomer who used the sextant to measure the positions of stars with unprecedented accuracy. And navigators were using it to help plot their position on the globe as they sailed into new waters.

French astronomer Nicolas Louis de la Caille created Antlia and Pyxis a few decades later.

La Caille didn’t stop there, though. He named other constellations for the telescope, the microscope, and the pendulum clock.

What do they look like in the sky? Not much like what the objects they are named for. You can make out anything in the night sky if you want to. Here are the star maps from Wikipedia:

Sextans, the Sextant

Sextans

Antlia, the Pump

Antlia, the pump

Pyxis, the Compass

Pyxis, the compass

 


Codebox: Make a Ken Burns-style Movie Using Flickr and Processing

MZ_Codebox.gif

This Codebox shows how to use the Flickr API to create a Ken Burns-style movie from your photos, like this one for Maker Faire:

You’ll need to supply your own melancholy period music.

Set up the sketch

The first thing you’ll need to do to is create an account (if you don’t have one already) and sign into Flickr. Once you’re logged in, the next step is to get an API key to uniquely identify your app. (Well, the key doesn’t so much identify the app as it identifies that you are running the app.) You’ll be prompted to give the app a name (I called it “Ken Burns App”) and a description.

Once you create the app record, you’ll get back two pieces of information: an “app key,” which uniquely identifies the app, and a “secret,” which is used cryptographically sign the URL. (We won’t be using signed URLs in this example, but I can post the code if you’re interested. Just leave a comment if you want to see it.) It should look something like this:

Once you’ve got the key, fire up Processing and paste ken_burns_flickr_final.pde into the sketch window. Here’s the codebox:

You’ll need to replace the variable apiKey and sharedSecret with the values you got from Flickr. While you’re at it, you can also mess around with some of the other variables. For example, if you’d like to search for another term than “faire,” you can change the “tags” variable. (Note that you need to URL encode any values you search for, which mostly means that you need to replace spaces with “+” sign.) Or, if you’d like more (or fewer) images in the movie, you can update the numPhotos variable.

Discussion

This is one of the more complex projects in this series, so I’ve broken the discussion into the following buckets:

  • Pulling data from Flickr
  • Panning and zooming the images
  • Creating a movie

We’ll be using the XMLElement and the ArrayList classes and a good bit. If you need a quick refresher, check out Amuse yourself with Google Autocomplete and Swat An (Arraylist) Of Targets. They should give you the background you’ll need to follow the examples if you’re feeling lost.

Pulling data from Flickr

The flickr api allows you to read (and write, but we won’t be doing that here) data about the images, groups, collections, and photographs on the site. Data is returned in XML, although other formats are available.

So, let’s dive right in and take a look at flickr.groups.pools.getPhotos. This call returns a list of pool photos for a given group. It can accept a variety of parameters, such as the api_key (this is required for almost all calls), the group_id (MAKE’s group id is 69453349@N00), the tags you want the image to match, and the number of results you want on each page (called per_page).

If you scroll to the bottom of the call’s documentation page, you’ll find a handy link called API Explorer : flickr.groups.pools.getPhotos. This links to an interactive form where you can try out the various parameters and get the results of the call; each call in the API has similar functionality. (Also, I found I had to use Firefox to see the XML output. YMMV.) Select “Do not sign call” in the radio button because (as discussed earlier) we’re not going to be uses authenticated API calls.

Here’s a figure that should help explain what’s going on:

The Explorer is the best way to quickly see the XML data returned by a call. In this case, the XML looks like this:

             ...              ...              

The photo data we’re after resides in the first child element off the root node. Our code will need to loop through all these child nodes, pull out the attributes we’re interested in, and store them in an ArrayList for later use.

Finally, you’ll find the URL required to generate this data just under the XML box. Here it is:

   http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos     &api_key=4bdfeb8048562c5d12d0c7cda3ae341e&group_id=69453349%40N00    &tags=faire    &per_page=5  

So, now that we know the URL we need and the XML we’re going to get, we can write some code to parse the data. Here it is:

  //Pulls out the first 100 phots in the makezin flickr pool void getPhotosByGroup(String _groupId, String _tags) {   // Set up the call to get the Token, as described here:   // http://www.flickr.com/services/api/auth.howto.desktop.html   String url = "http://api.flickr.com/services/rest/?api_key="+apiKey+"&group_id="+_groupId+"&tags="+_tags+"&method=flickr.groups.pools.getPhotos&per_page="+numPhotos;   String[] results = loadStrings(url); //Load the URL   XMLElement xml = new XMLElement(join(results,"\n")); //Collapse array elements into a string   String[] errCodes = getStatus(xml); //Pull error codes (if any) from the XML   if (errCodes[0].equals("ok")) {    XMLElement root = xml.getChild(0);    for (int i=0; i < root.getChildCount(); i++) {    String id = root.getChild(i).getStringAttribute("id");    String owner = root.getChild(i).getStringAttribute("owner");    String title = root.getChild(i).getStringAttribute("title");    photos.add( new Photo(id, title, owner));    }   } else {    println ("Error! Here are some codes:\n" + errCodes);   } }  

If you’ve been following the other columns in this series, nothing should look that unfamiliar. All we’re doing is creating a string that’s a template for the URL we need, pulling the contents of the page using loadString(), and then processing it with XMLElement.

Perhaps the only wrinkle is that we’re doing a bit of error checking using a procedure called getStatus() to see if something has gone wrong in the call. For example, if we passed in an invalid API key in the URL, we’d get an error code in the XML instead of useful information:

       

Once we’ve read in the meta data about the images, we need to use the flickr.photos.getSizes to find the URLs for various images associated with a particular photo ID. The call returns a structure with information about the various image sizes (thumbnails, square, small, large, etc.) Flickr stores for each photo. Here’s an example:

                                                    

This code is all handled in the getPhotoURL() method, which is almost identical in structure to getPhotosByGroup(). Once we have the URL, we can load the image using loadImage().

Panning and zooming

Once we’ve pulled in the image, we’re ready to start panning and zooming in the Ken Burns style. As demonstrated by this Pan a large image example from the Processing community, we can use buffering tocreate the panning effect. On each iteration of draw(), we’ll update the (x,y) coordinates of buffer so that it moves smoothly along a predetermined vector. This figure illustrates the key variables involved:

Zooming is even easier — we just increase a variable called zoom by a small percentage called zoomFactor, and then use Processing’s scale() function to do the appropriate transformation.

All the updates to the various variables are made in the draw() method.

Creating the movie

Creating the movie is slightly trickier. Well, I take that back — creating the movie file and adding frames to it is dead simple, thanks to the great MovieMaker contributed library. The library does all the messy, hard work. To use it, we reate a new MovieMaker object in setup(), add frames to it in draw(), and then call the finish() method when we’re done. The tricky part is controlling what those frames contain and how long they are displayed.

The content is fairly straightforward — it’s the copy buffer we just discussed in the pan and zoom section. Each iteration of draw() gives us a slightly different frame. Stringing the frames together creates a nice, animated image. All we need to do is write each frame in the animation into the movie file. Conveniently, MovieMaker’s addFrame() method does just that — it saves whatever is currently displayed in the sketch’s display window into the movie file. To make the movie a bit more authentic seeming — and just to show how it’s done — I added in a title bar with the picture’s title and creator. These are just done with standard Processing graphics commands.

Controlling how many frames to generate per image is the tricky part. The first thing to understand is that the frame rate of the sketch (the number of times draw() executes a second) is different than the frame rate of the movie. For example, suppose you set the movie’s frame rate to 60 frames per second (FPS). Regardless of how long it takes to generate an image on the screen, that image will be displayed in one sixtieth of a second in the movie. So, while you might have an effective frame rate of 6 frames per second in your sketch because it takes 10 seconds to render some complex image, the movie’s frame rate is constant. It will take 600 seconds of Processing time to generate the 1 second of movie time.

Managing this timing disconnect requires us to manually keep track of the number of frames we’ve added to the movie. In the Ken Burns example, this is done in the variable panFrameIdx, which increments on every pass through draw(). The sketch compares this value to a baseline that tells us how many frames we want to display per image. After experimenting a bit, I found that panning and zooming between 2 and 4 seconds gave the best results, like this:

    float MIN_PAN_SECS = 2;  // Min time to display photo    float MAX_PAN_SECS = 4;  // Max time to display photo    ...    framesToDisplay = (int) (FPS * random(MIN_PAN_SECS, MAX_PAN_SECS));    if (panFrameIdx > framesToDisplay) {       ... 

Once the sketch has generated the number of frames required for the image, it loads in the next image and repeats the process.

In the Maker Shed:

Makershedsmall

processingCover.jpg

Getting Started with Processing
Learn computer programming the easy way with Processing, a simple language that lets you use code to create drawings, animation, and interactive graphics. Programming courses usually start with theory,but this book lets you jump right into creative and fun projects. It’s ideal for anyone who wants to learn basic programming, and serves as a simple introduction to graphics for people with some programming skills.

 

Top 10: Easy Woodworking Projects

I’ve built a lot of stuff with wood in my life, but I do not consider myself a “woodworker” by any stretch of the imagination. When I evaluate a project that uses wood, personally, what I look for is the maximum cool result for the least amount of technical skill and work. Here, then, are ten of my personal favorite bangiest-for-the-buck wooden projects from the vault. Enjoy!

#10

Beginner Woodworking Project for Illusionists?



#9

Nice DIY Bedframe Design



#8

DIY Wood toys for kids



#7

Weekend Project: Rok-Bak Chair



#6

Upcycling Wood Pallets



#5

How-To: Build Nob Yishigahara’s “Dualock” Cross Puzzle



#4

How-To: Trammel of Archimedes



#3

How-To: Build Large Couches on the Cheap



#2

Wooden Buttons From Fallen Branches



#1

Plywood Coffee Table



Did I miss a good one? Let me know, below!

 

Bug Labs at the Health 2.0 / MAKE challenge in Boston

In an update to Making For Health: Calling Boston-Area Makers, Bug Labs’ open source hacker Far McKon just let me know that he’s bringing 5 complete bug bundles to the event for teams to incorporate into their projects. The event is this weekend (Feb 19) in Boston, so register now!

Here’s what Far has to say about the gear:

“The heart of the kit it is the ‘BUGbase’, which has built in Wi-Fi, Bluetooth, and battery, along with the Cortex A-8 ARM for some raw computing guts. The base is similar to the Beagle Board in power and design, but has a bit more built in, like a runtime plug-in system for modules.

Speaking of modules. To extend the base, each kit has a general IO module (the Von Hippel), GPS, and so on. For video output, each kit comes with a full-color touchscreen LCD and HD video-output modules for either on-device or on-screen display. And sample code to use all of them, naturally. We will also have some sensors and components along, so people can use the Von hippel to plug into other projects or platforms through raw IO.

For development, I have a pre-built VirtualBox image, with everything installed. So it should be very fast to get off the ground by coping the VM to coders machines, and launching it.

Everything is open source, from hardware to virtual machine, so a prototype built on using a Bug can easily be remixed into any form factor or new product, using our designs as a starting point.”

Should make for a really interesting day of hacking for a good cause. Thank you, Bug Labs, for the generous support. Hope to see you there!

Related

 

Lego Kanji


Flickr user Empress of Blandings built these clever Lego Kanji. [Via Typegirl]

 

Paper Sculptures by Matt Shlian



Teacher, paper engineer, and artist Matt Shlian created these stunning sculptures from paper. Reminds me of a single-color Jen Stark! [via Cool Hunting]

 

SparkFun’s Funny Take on Obligatory Product Safety Warnings

The clever copy some bright marketeer wrote for SparkFun’s Heaterizer XL-3000 is turning into a pretty awesome viral advertisement for the product, and for SparkFun itself. [via Boing Boing]

 

In the Maker Shed: 6-in-1 Solar Robotic kit


The 6-in-1 Educational Solar Robotic Kit is an excellent beginner building kit designed to teach how solar power is used to drive a small motor. Kids use the 21 snap-together parts (no tools required) to build 6 different working models including an airboat, car, windmill, puppy, and 2 different airplanes. Solar building kits teach children the benefits of solar energy, while they create a toy that’s fun to play with and requires no batteries. Educators, science museums, and hobbyists will surely appreciate the durability, educational value, and endless hours of amusement for children and adults too! Ages 10 and up.

Hint, Hint – Follow the Maker Shed on Twitter, or Subscribe to our Deal of The Day RSS feed to keep up to date on the latest deal!

 


Click here to safely unsubscribe now from "Make: Online" or change your subscription, view mailing archives or subscribe

Your requested content delivery powered by FeedBlitz, LLC, 9 Thoreau Way, Sudbury, MA 01776, USA. +1.978.776.9498