Category: Open source
Multiple JDIC browsers in Processing sketch

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 »

4 Comments »

I got an email from two Caseys last night (i.e. [Casey Alt-http://caseyalt.com/] and Casey Reas), announcing the relaunch of the artsoftware.org Wiki. The intention of the site is to be a gathering point for information about free and Open Source software created by and for artists.

Take a look at the list of existing pages and see if you can’t contribute something…

No Comments »

AHO RP 004 Object #1 - #3 [lo]

Rapid prototyping objects generated with Processing and output to STL using unlekkerLib.

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 »

No Comments »

I just added a Flickr badge to Generator.x using the excellent phpFlickr library. The code to retrieve the images from the Generator.x Flickr group is less than 20 lines. I turned it into a function and put inside a basic WP plugin shell, giving me a new API call for inserting into the sidebar.php template.

Code – gxflickr.php
/*
Plugin Name: Generator.x Flickr utilities
Plugin URI: http://www.generatorx.no/
Description: Support utilities for Generator.x web
Version: 1.0
Author: Marius Watz
Author URI: http://www.generatorx.no/
*/

require_once("phpFlickr/phpFlickr.php");

function gxFlickrSidebar() {
  $f = new phpFlickr("API_KEY");
  $f->enableCache(
    "dbname",
    "mysql://username:password@host/dbname"
  );

  echo("<div class=\"gxflickrSidebar\">");
  echo("<div class=\"gxFlickrTitle\"><a href=
      \"http://flickr.com/groups/generatorx/\">".
      "» GX on Flickr:</a> Recent images</div>");

  // get photos using the Generator.x group's ID
  $photos = $f->groups_pools_getPhotos('59096658@N00', NULL, NULL, NULL, 12);

  foreach ((array)$photos['photo'] as $photo) {
    echo "<a href=http://www.flickr.com/photos/" . $photo['owner'] .
      "/" . $photo['id'] ."/in/pool-generatorx>";
    echo "<img border='0' alt='$photo[ownername]: $photo[title]' src=" .
      $f->buildPhotoURL($photo, "Square") . ">";
    echo "</a>";
  }
  echo("</div>");
}

Once that’s done, all you need to do is insert the function call in your Wordpress template:

[..html..]
  if (is_home() || is_page()) {
    gxFlickrSidebar();
  }
[..html..]

No Comments »

Marcus Wendt has published a new Processing library called libCollada, providing 3D export in the Collada 3D format. Collada is XML-based, and is intended to provide support both for basic 3D geometry and more advanced 3D authoring features like shaders and physics.

The obvious question is why another 3D format? Well, I guess the ones out there still aren’t good enough. Collada looks very complete, but most importantly is not tied to a single software vendor. It comes with a range of Open Source libraries for importing and exporting for various languages, and so could easily become a good choice for Open Source developers.

I recommed subscribing to Marcus’ Infostuka blog for technology- and design-related news. His own projects like Gestures on Sound show a great eye for computational work.

No Comments »

JDIC embedded browser engine

Screenshot of IE running integrated with Processing and other AWT components.

For a while I’ve been wondering if it couldn’t be useful to be able to render proper HTML from inside Processing. While Processing is excellent for realtime graphics, the typographic support is a little basic when faced with the task of designing a more complex layout. Rather than write a new library, why not just use a fast HTML engine?

While there are quite a few HTML rendering engines out there, not all are very complete or indeed very fast. This might be one of the cases where using native code makes sense. Both Internet Explorer and Mozilla offer ways of embedding their rendering engines through native bindings, and after a little googling I was able to find JDIC – the JDesktop Integration Components project.

JDIC aims to bring Java applications closer to feeling like “real” desktop apps. I’m not sure if that’s a battle I would have taken on myself, but in any case they have exactly what I needed: A simplified web browser ready for embedding, able to use either IE or Mozilla as engines. A little coding later and I had a hybrid Processing / AWT application running a web browser. It will even support Flash and Java content, provided that you’ve installed the proper plugins.

The WebBrowser.setContent() function is perfect for loading your own machine-generated content, and events can be captured and processed appropriately. It would even be possible to have a hybrid application, with part of the interface being straight Processing and the rest AWT. I’m keen to try using this to create more complex on-screen layouts. HTML and CSS will always look much better than anything one could create using Swing.

See Flickr for some screenshots.

Code – JDICsample.pde

Read the rest of this entry »

6 Comments »

I generally try to avoid tinkering too much with the insides of Wordpress, but if I did I would read Devlounges How to Write a Wordpress Plugin first. It’s even available as a nicely downloadable PDF.

Yesterday I needed to delve into Arne Brachhold’s Del.icio.us plugin to figure out how to add proper titles for links from main or archive pages. It was a dirty hack, but I got it working somehow. If you need to know, it involved hacking his Javascript and I’d be happy to share if you ask.

No Comments »

Minim, a new sound library by Damien Di Fede was just posted on processing.org. Sound has never been the strongest point of Processing, and with ESS and Sonia already in existence, that makes Minim the third attempt at providing sound functionality. But to be fair it should be said that Java on the whole has never been that good at sound, with Sun notoriously neglecting the media APIs.

Like ESS, Minim is based on the JavaSound API, but at first glance it seems like a more complete solution than either ESS or Sonia. It allows stereo input from either line-in or file (the others only do mono), it has beat detection and there is a class hierarchy for realtime sound synthesis and filtering. And there is more good news for those using Processing in Eclipse or other Java IDEs – Minim comes with full source, released under a GNU license. This should be mandatory for libraries, but sadly isn’t.

I haven’t tested Minim yet, but it certainly seems very promising. For my own purposes (realtime sound responsive visuals), the stereo option as well as the beat detection could come in very handy. I recently created new visual set for a gig at Lovebytes, if I had known about Minim I might have tried it then.

Here is an abridged feature list, taken from the Minim introduction:

  • AudioFileIn: Mono and Stereo playback of WAV, AIFF, AU, SND, and MP3 files.
  • AudioFileOut: Mono and Stereo audio recording either buffered or direct to disk.
  • AudioInput: Mono and Stereo input monitoring.
  • AudioOutput: Mono and Stereo sound synthesis.
  • AudioSignal: A simple interface for writing your own sound synthesis classes.
  • Comes with all the standard waveforms, a pink noise generator and a white noise generator. Additionally, you can extend the Oscillator class for easy implementation of your own periodic waveform.
  • AudioEffect: A simple interface for writing your own audio effects.
  • Comes with low pass, high pass, band pass, and notch filters. Additionally, you can extend the IIRFilter class for easy implementation of your own IIR filters.
  • Easy to attach signals and effects to AudioInputs and AudioOutputs. All the mixing and processing is taken care of for you.
  • Provides an FFT class for doing spectrum analysis.
  • Provides a BeatDetect class for doing beat detection.

My thanks to Damien Di Fede for contributing what looks like a very useful addition to the Processing arsenal.

3 Comments »

DIGG announced the launch of the public DIGG API yesterday. I’m not a DIGG fan myself, but it is a major service so the launch is significant.

The API should enable more visualizations along the lines of the popular Swarm and Bigspy visualizations. This is clearly part of the interest on DIGG’s part, as they have also announced a DIGG API Visualization contest. Entries must use the Flash toolkit provided by DIGG.

You can read more about the launch on the DIGG blog. Basic API concepts are fleshed out here.

3 Comments »

Some assorted updates and snippets

  • Processing is now up to version 0121. This fixes several bugs, including fixing modelX/Y/Z(), issues with createGraphics() and font problems. As always, read the revisions.txt for information.
  • Daniel Shiffman has updated his Moviemaker library for Processing. It’s a neat little lib that allows direct Quicktime export from Processing. I have used it on several projects with good results, it saves you from having folders with 5000+ individual frames and having to prerender movies with After Effects. Just remember to use Quicktime Animation codec for lossless compression…
  • Sun has GLP'ed Java, finally making it an Open Source platform.
  • Our good friend and unrecognized genius Andreas Schlegel has released a new (and very good-looking) GUI library for Processing: ControlP5. He has even provided drag-n-drop functionality. See the demo for general shock and awe.

No Comments »