Processing visualization head Jer Thorp is putting his money where his mouth and publishing 7 pieces of code in 7 days, free to download and experiment with. Judging from the three that he’s released so far they’re not your standard 20-minute sketches either:
- GoodMorning! is a Twitter vizualization, showing users around the world popping up on a globe as they utter the magic words “good morning”. With a little geocoding and spherical mapping thrown in, this is a sweet sketch
- NY Times: 365/360 uses the New York Times open data API to retrieve news stories for an entire year and draw connections between them. The results combine complexity with elegance for that true infoporn look.
- tree.growth revisits that old classic, the L-system tree. Thorp uses colors and abstract “leaves” to great effect.
With such a strong start, one certainly looks forward to seeing the next four sketches to come. It’s not so common to find sketches of this complexity freely available, so they’re a great study for users who are on the threshold of making more complex applications.
23:27 | October 14th, 2009 | marius watz | +del.icio.us | +digg | trackback
Good news for Processing heads who use sound: Damien de Fede has released a new major version of his excellent Minim library. Along with bug fixes, new features include:
- added functions to FFT for doing forward transforms with an offset: forward(float[] samples, offset) and forward(AudioBuffer samples, offset)
- added a freqToIndex(float freq) method to FFT for finding out the index of the spectrum band that contains the passed in frequency.
- added a stop() method to AudioSample, so that playing samples can be immediately silenced.
- added setPanNoGlide(float pan) to Controller, which will snap the panning setting of a sound to the provided value.
- added setInputMixer(Mixer) and setOutputMixer(Mixer), which allow you to specify which Java Mixer object should be used when obtaining inputs (AudioInput) and outputs (AudioOuput, AudioPlayer, AudioSnippet, AudioSample).
Download from the Minim project page. Read more about the development process on the Compartmental blog.
04:48 | October 5th, 2009 | marius watz | +del.icio.us | +digg | trackback
Processing does not provide any direct mechanism for manipulating the look of the sketch Window, but Java natively supports tricks like turning off the window chrome, explicitly setting window position and making a window “float” over all other UI elements. All of this can be accessed via PApplet’s internal “frame” field, which holds an instance of a Frame object representing the window your sketch is running in. But even so, Java won’t let you have free reign without a little trickery.
The following hack demonstrates how to make a window that has no OS chrome, always stays on top of the UI and has an explicitly set screen position. You can even use the cursor keys to move the window around the screen.
Personally, what I like most about this hack is that it gets around Processing’s (or possibly Java’s) assumptions about a minimum window size of ~120×120. If you specify a size that’s less than 120 on one side, Processing will be pad that side with grey pixels to reach the minimum. But with this hack you can have tiny windows that you can micro-manage to your heart’s delight. I use it to make debug dispays, small control panels and other useful things.
Update: @CedricKiefer pointed out another Processing example that allows for transparent and even irregularly shaped windows. It’s Windows-only apparently, I bet this kind of thing is a major violation of Apple GUI laws anyhow.
Update 2: @ideoforms took my post literally and made a sketch with multiple bouncing windows. Nice.
Code: FloatingWindow.pde
Read the rest of this entry »
02:34 | September 29th, 2009 | marius watz | +del.icio.us | +digg | trackback
As documented in this thread on the Processing forums the TileSaver class seems to be broken for current versions of Processing. Sadly I’m not sure what the problem is and I don’t have time to fix it right now.
However, I tried the original TileSaver code posted back in 2006 and miraculously that still works. This would imply a larger issue with the unlekkerLib library and Processing 1.0, which I’ll have to address when I have the time.
For now, here is a link to a working Processing sketch using the old TileSaver code: TileSaverTest.zip
07:22 | August 18th, 2009 | marius watz | +del.icio.us | +digg | trackback
After several requests I’ve taken the time to make unlekkerLib compatible with Processing 1.0. Apologies to anyone who’s been inconvenienced by the lack of a 1.0 version.
In particular, STL export should work again. However I haven’t had the chance to test the code very much, so please let me know if you find any bugs.
Download
08:19 | April 16th, 2009 | marius watz | +del.icio.us | +digg | trackback
Multiple JDIC browsers integrated into Processing sketch
A while back I posted a simple hack to open a web browser from Processing by using JDesktop Integration Components (JDIC). A recent discussion on the Processing forums asked about how to use it to open multiple browsers inside the actual Processing sketch window.
My original hack used an instance of org.jdesktop.jdic.browser.WebBrowser integrated into a java.awt.Panel instance and laid out in a java.awt.Frame. That meant that the browser would open in an external window. The discussion on the Processing forum asked specifically about opening multiple browsers in the main sketch window, so I made the following quick hack.
Code – JDIC_multiple.pde
Read the rest of this entry »
21:52 | September 6th, 2008 | marius watz | +del.icio.us | +digg | trackback
I’ve uploaded a new version of my unlekkerLib library. For some inexplicable reason version 0002 was missing some classes that were needed for certain examples to function. As a result the TileSaver class was broken, which was a serious omission.
You can download unlekkerLib-0003 from the Code & Form Google Code repository. I’ve added the missing classes, but otherwise the library is the same. If you still experience problems please report them here.
20:51 | July 12th, 2008 | marius watz | +del.icio.us | +digg | trackback
Lee Byron has written a neat little Processing library called Mesh which allows for easy calculation and display of Voronoi, Delaunay and Convex Hull diagrams.
Given a set of points, these diagrams calculate the minimal regions around the points (Voronoi), an optimal triangulation of the points (Delaunay) or the polygon shape that contains all the points (Convex Hull). So far the library only supports the 2D versions of the diagrams, but it is in part based on the QuickHull3D java library which also handles 3D hulls.
Byron didn’t include any code examples in the current release, so I hacked up a quick demo.
Code: MeshLibDemo.pde
To run this example, download MeshLibDemo.zip and unzip it inside your Processing sketches folder. The Mesh library is included in a “libraries” subfolder, but you’ll have to restart Processing for the library to be recognized.
I’m posting the full code below for easy reference.
Read the rest of this entry »
00:23 | June 1st, 2008 | marius watz | +del.icio.us | +digg | trackback
I’ve decided to put my Processing hacks from the Code & hacks page and consolidate them into a downloadable archive. Thus the Code & Form code library is born. It will contain various demos and hacks, as well as example code for the unlekkerLib library. It should be much easier to publish code this way, since students etc. can simply download the archive and dump the contents in their sketchbook folder for quick access.
I’ve started a Google Code repository for this purpose, which seems a good way to go. I’m still figuring out SVN etc, hopefully I can switch to publishing the unlekkerLib source “live” through SVN once I figure it out. I’ll also publish archives of code written during past workshops to the repository.
There seems to be a growing list of Processing-related Google Code repositories out there, examples include Toxi’s Toxiclibs, interfascia and jddaniels. Do a search for processing.org to find more.
14:44 | April 12th, 2008 | marius watz | +del.icio.us | +digg | trackback
The following Processing example shows how to set up a separate thread for loading images into a sketch. I wrote it up in response to this post on the Processing forums, figuring it will be useful to some of my students too.
Code: ThreadImageLoader.pde
Read the rest of this entry »
15:00 | March 9th, 2008 | marius watz | +del.icio.us | +digg | trackback