Archive for May, 2006
  • Seltar's snippet palace: Processing user Seltar has set up a useful collection of code snippets, neat little things like the difference between two dates, handling multiple keys pressed etc. It’s set up so that users can contribute, go ahead and make the palace bigger.
  • MovieMaker Library: The indefatigable Daniel Shiffman has put together a library for writing Quicktime movies directly from Processing. It’s a little rough around the edges yet, but should be fun to play with.
  • Daniel Shiffman » Teaching: While talking about Shiffman, have a look at his extensive course materials from ITP, which he generously publishes online. It has some great tutorials.

No Comments »

060522_pdf_niaf_postcards.jpg

More PDF output examples: Graphics for NIAF

More gratuitous (real-world) examples of how great PDF output is. These are teaser postcards for Norwich International Animation Festival, which will take place in October this year. I am doing a generative piece which will function as identity graphics for the festival. Essentially, a single Processing software will generate a large variety of stills for print use (using PDF), as well as realtime animated trailers to be run ahead of every screening.

See Flickr for my sketches for the NIAF piece, the image over shows the 4 postcards that will go out in the next few weeks. Posters and a catalogue will follow, which I am very excited about. Again, the images show that the new PDF output library gives very high quality for print when using 3D objects.

However, there are a few quirks to PDF:

  • No depth-sorting or intersecting objects. In the NIAF project that proved to be a benefit rather than a setback, as the shapes would sometimes intersect in a visually unattractive way.
  • No pro-vertex shading, i.e. no gradient-filled polygons. In the NIAF piece you can see that I have used multiple polygons with interpolated color. This is not ideal, as it produces banding, but it can be worked into the aesthetic of the piece.
  • No possibilities for using groups or layers, a typical feature of PDF and Illustrator documents. If this could be added it would make it much easier to post-edit the results. Processing uses the free iText PDF library, and I experimented briefly with inserting layers by directly accessing the PDFWriter object, but no luck so far.

Still, PDF output is a god-send for a range of new Processing applications.

No Comments »

After my post about Flickr yesterday Robert Hodgin and Stephen Boyd have both posted some beautiful pictures to the Processing Pool. Enjoy!

(My apologies to Stephen Boyd and Processingblogs readers, who got an empty post with one of Stephen’s pictures when the aggregator caught an unedited post from Flickr. Worse still, the picture was uncredited. My bad.)

1 Comment »

For many applications like saving images, PDFs, logs or temporary files one typically wants to use a set filename structure. One such typical structure is “Sketch-####.png”, where # denotes a single number. It is often convenient to not have to keep track of the numerical component, but just assuming that it will update automatically.

This hack describes a simple function which can be used to return the next valid filename in a sequence, so that you won’t have to worry about erasing files. It is very useful if you have a “snapshot” function for saving images of your work-in-progress.

Source code - getIncrementalFilename.pde

Read the rest of this entry »

No Comments »

What follows is a pro-Flickr rant, so ignore at will…

Among the many unique features of the visual programming tool VVVV, one of the most enviable is the CTRL-3 shortcut for “Upload screenshot”. All screenshots are immediately uploaded to the vvvv.meso.net web site and shared with all users. It’s an excellent way to get an overview over what people are working on, and it’s simply a very cool community-building tool.

Personally, I publish sketches to Flickr regularly when working on a project. I sometimes even blog those pictures here. It serves as a repository of various versions, and lets users (both curators and random passers-by) comment on the work. What I like best is going back and seeing versions and ideas that went nowhere, and which I had forgotten about. From re-discovery it is a small step to resurrection…

There is a Flickr pool for Processing already, but sadly it doesn’t see much use right now. Uploading manually to Flickr is not as spontaneous as the VVVV function, but it still works well for showing off sketches etc. I’m hereby proposing that all Flickr-using Processing heads should upload their snapshots. Start by making your own Processing set, tag the images “processing.org” and add them to the Processing Pool. You’ll be surprised at how well it works as a sketchbook, where people can even comment on the work as it happens.

See the Flickr Processing Pool for what is already there. For some users who are making good use of Flickr, see the following:

See also the tag “processing.org” on Flickr. This is the best tag for letting people know that an image is Processing-related, and is the tag you should use on your blog or your del.icio.us account as well.

Of course, the use of Flickr in this way is not unique to Processing. flickr.com/photos/tags/jitter gives many more results than flickr.com/photos/tags/processingorg. Sometimes looking at flickr.com/photos/tags/generative/clusters/ can prove fruitful.

1 Comment »

Complex 3D output using PDF in Processing

Complex 3D output using PDF in Processing.

Sample code for PDF output of complex geometries from Processing, with a 3D shape using lines and polygons being written correctly to PDF. Uses beginRaw() / endRaw() and should probably be used with revision 0115 or later due to recent bug fixes.

Source code - pdf_complex.pde

Read the rest of this entry »

5 Comments »

Proof positive of the power of PDF export in Processing: I have just uploaded images of 4 posters I’ve made for the upcoming C.stem exhibition in Turin. Using the new PDF export, I was able to effortlessly output print-ready files which were then finally prepped in InDesign. Using PDF has many advantages over the older libraries (AIExport, my own SimplePostscript etc):

  • Using beginRaw() / endRaw() it is possible to render 3D shapes.
  • Adding PDF output is typically 6 lines of code.
  • PDF has transparency support.
  • Using PDF with Processing gives you accurate control over the canvas size and units.

As you can tell, I can not say how excited I am about the PDF output. Thank you, Ben!

This set of posters were output as black only, so that the printer could easily output a single film for each poster. They are then printed as a single-color process, with each using one of the CMYK colors. See also the Sketches Flickr set for in-progress examples, or C.Stem: CMYK posters (Original size) for a higher-res version.

3 Comments »

Toxi has posted a useful comment on the nature of FFTs over on the Processing forum. It should be of interest to those who have been looking at the SoniaHelper library.

[...] Even if you’re thinking of analyzing only the range of formants of human voices you can work with ONE frequency band, but please don’t mix this up with the spectrum bins returned by the FFT… In most cases speaking about a band of frequencies will refer to a whole collection of bins. Escpecially if you want to target/analyze the behaviour of a specific frequency bin, you’ll need as many bins as possible to start with. In theory a spectrum of only one bin would cover the whole frequency range 0 Hz < f < 1/2 the sampling freq...

Since the FFT is attempting to break down the signal into a series of sinoids, at least 2 samples are required in order to work out the contributing frequencies of this signal (It's mathematically impossible to do it with one only).

Running danger of becoming too mathematical, the number of frequency bins required directly relates to the number of samples analyzed. In other words, the fewer bins you want in your spectrum the shorter (in time) the chunk of signal analyzed and so the poorer the quality/precision of the computed spectrum as well. For most applications a spectrum of anything under 128 bins will be pretty unusable since the related time window is too short (<3ms) and you might be better off just working with the average volume of the samples by using Ess's equivalent of Sonia's LiveInput.getLevel() method.

Toxi wrote the FFT code that is used in Sonia. You can download it here: http://www.toxi.co.uk/p5/fftDebug/.

No Comments »

Real test of complex polygon models with PDF output from Processing, rasterized and monotoned in Photoshop. Some very few 3D rendering artifacts are visible, but considering the complexity of the scene it’s impressive.

hint(ENABLE_DEPTH_SORT) breaks PDF output for me, so haven’t been able to see if that would help with the few incorrectly sorted triangles visible to the right.

No Comments »

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.

1 Comment »