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
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
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
I just posted a quick update to unlekkerLib. It seems the first version I posted used Java 5 because I hadn’t configured Eclipse correctly. This version is compiled for 1.4. I have tested it with Processing 0125, but please give me feedback if it gives you trouble.
I added two new functions to the library, nothing big but could be useful for some people:
[071028] unlekkerLib-0002 features:
- unlekker.data.POVRay: Primitive POV-Ray triangle geometry export.
- unlekker.data.FeedReader: Feed reading utility class (requires installing extra JARs)
To use the feed classes simply use the code from this previous post, minus the class definitions.
02:30 | October 28th, 2007 | marius watz | +del.icio.us | +digg | trackback
I’ve just uploaded a new Processing library called unlekkerLib. It is a collection of tools and code snippets I use frequently, and which I’ve now just barely cleaned up enough for other people to use. Instead of releasing them piece by piece, I’ve decided to bundle them together in a package hierarchy.
The main reason I decided to release it now is the STL export code I’ve written for my rapid prototyping projects. Several people have asked for the code, so I wanted to get it out there for you to play with. Obviously, it works as well with Processing as it does with regular Java.
Caveat emptor:There’s not much documentation but I do provide the source code. This is v.0001 - the very first release, so it’s pretty basic. See below for an idea of what the library contains. Right now the most exciting new component is the unlekker.data.STL class, which supports export and import of STL stereolithography files for rapid prototyping. Have a look at the Javadoc for more details.
Updates will appear here: http://workshop.evolutionzone.com/unlekkerlib/.
Read the rest of this entry »
19:12 | September 24th, 2007 | marius watz | +del.icio.us | +digg | trackback
After suggesting to my AHO class that they consider using RSS feeds in Processing, I realized that there is actually no built-in functionality to do so. The XML class built into Processing is too basic to handle feeds, it seems. To remedy the situation I’ve cooked up a quick hack using the ROME library for RSS / Atom syndication.
To run the code below you’ll need to download ROME and JDOM. Make a “code” subfolder in your sketch and paste “jdom.jar” and “rome-*.jar” into it, then run the code as given. The FeedReader and FeedEntry convenience classes take care of parsing the feed and returning the entries with the most common fields included. Error checking is rudimentary, however.
Code - feedParser.pde
Read the rest of this entry »
03:08 | September 24th, 2007 | marius watz | +del.icio.us | +digg | trackback
Update: This hack is obsolete as of 0133. Read more here.
For those of you who have been using the hack I posted a while back to force anti-aliasing in Processing, here’s an updated version for Processing 0125. According to the source repository Ben has been fixing lots of little things in PGraphicsOpenGL, so it’s worth updating.
The hack is actually lying dormant in the PGraphicsOpenGL source, but it’s been commented out with the note “how to integrate this properly?”. Obviously, having to set hardware-specific settings goes against the ease of use that Processing is known for. I guess Ben and Casey are just trying to find a way to include it in a manner consistent with the rest of the application.
To use the hack simply download the ZIP archive below and unpack it to produce the hacked “opengl.jar” file. Drop the JAR into the “libraries\opengl\library” subfolder of your Processing application directory. Make sure to make a backup of the original opengl.jar. Once replaced, the new PGraphicsOpenGL class always initializes with 4x supersampling.
Downloads
12:14 | September 8th, 2007 | marius watz | +del.icio.us | +digg | trackback
High-resolution images from Processing using tiling (1.6% / 20%)
A while back I posted about rendering very high-resolution images from Processing using a tiling technique. I had implemented a working version of a solution first described by "surelyyoujest", but didn’t have time to post a clean version of the code. (I did however post ImageStitcher.pde, which is code for stitching these tiled images back together.) But after a long delay, here is finally the more useful bit of code.
The code works by panning the camera over the original viewport area, subdividing the image into tiles. This way, OpenGL’s limitations on maximum resolution can be circumvented. As long as enough memory is allocated, the images created can be very big indeed. The images shown above are from a 15360 x 15360 pixel image, shown at 1.6% and 20% respectively. With 1.5 GB assigned to Java I have so far successfully saved 20k x 20k images. That’s large enough to print 2×2 meter prints at 260 DPI.
What follows is the aTileSaver class and a simple demo application. I will post a more complex example soon.
Update: I’ve changed a few minor details in the code. Make note of the version number if you have download it already. This code is likely to change..
Source code - aTileSaver.pde
Read the rest of this entry »
10:13 | March 24th, 2007 | marius watz | +del.icio.us | +digg | trackback
Update 17 Jan 2008: This library is not available at the moment at the request of Sean Luke, who along with Michael Lecuyer were the original author of the Mersenne Twister code used in the library. In packaging the library for use with Processing I carelessly removed the copyright and license information from the original file, thereby falsely giving the impression that I had written the code myself.
I’m hoping to resolve the issue and provide the library in a different form in the near future.
10:54 | May 16th, 2006 | marius watz | +del.icio.us | +digg | trackback
Update: SoniaHelper should be renamed FFTHelper and integrated into unlekkerLib, but that hasn’t happened yet. The best way to use it right now is to download the code examples from the VJ workshop I did at Cimatics 2007. That has the code you need as well as some examples of practical usage.
I’ve put together a hack for normalizing the FFT analysis values produced by Sonia’s LiveInput.getSpectrum(). It looks at the maximum values produced, and scales them according to the most recent maximum values. That way, quiet sections will produce relative differences according to the current maximum value, so that both quiet and loud sections give dynamic results.
It also allows you to dampen the values so that the rate of change in values can be controlled. This can be used to make the values change appropriately according to the quality of the music, making it easier to use them for visuals that match the music.
Source code
You initialize SoniaHelper like this:
// SoniaHelper(int _n, int _nbands,boolean doAvg)
// Start up Sonia
LiveInput.start(spectrumLength);
// ...or start up Ess
Ess.start(this);
myChannel=new Channel("hello.aiff");
myChannel.setupFFT(512);
// init SoniaHelper
ffthelper=new SoniaHelper(spectrumLength,32,false);
ffthelper.setMaxLimits(200,2000);
damperval=0.1f;
ffthelper.setDamper(damperval);
Update SoniaHelper inside draw() by passing spectral values from Sonia or Ess:
void draw() {
...
LiveInput.getSpectrum();
ffthelper.update(LiveInput.spectrum);
// Ess equivalent
myChannel.loadSpectrum();
ffthelper.update(myChannel.spectrum);
for(int i=0; i< spectrumLength; i++)
ellipse(i,height/2,
100*ffthelper.spectrum[i], 100*ffthelper.spectrum[i]);
...
}
See the sample code in the ZIP file for more code examples.
Downloads
11:58 | May 10th, 2006 | marius watz | +del.icio.us | +digg | trackback