Processing, Ported to JavaScript

imageProcessing derives its power from its use from Java, and using Java applets, you can run Processing sketches in a browser. (You can even use 3D — OpenGL included, with some trickery.) But what if you could use Processing syntax with JavaScript — even just for the heck of it?

John Resig has done just that, porting Processing’s syntax and basic functionality to JavaScript, using the browser support for the Canvas element:

Processing.js

Incredibly, the whole project fits in a svelte 5000 lines — a 10kb compressed download. Now that it’s done, is there any advantage? Well, I can see using it for simple, lightweight JavaScript visualizations in the context of a Web design in which an embedded Java applet didn’t make sense. You will want to keep your expectations realistic: you lose out on some of the performance and functionality advantages provided by Java, and John has the additional warnings:

NOTE: I highly recommend that you use the latest Firefox 3 beta to view the demos. Most will work in the latest WebKit Nightly and a majority will work in Opera 9.5, but all will work in Firefox 3.

Note again: A lot of these demos will peg your CPU. As I mentioned above, I’m trying to squeeze the most out of the browser, as possible - be ready for it!

That said, I’m running Firefox 2 on a modest CPU and most of the demos are actually just fine. Anyone out there who, for some reason, has been waiting for this, I’ll be curious to hear more about how you think it might be used. But for the rest of us, it proves that some of the power of Processing is in the underlying concept and syntax, not just the literal implementation — and that’s a cool thing. As for those crazy hackers out there, well, keep on hacking!

For a previous example of this kind of in-browser insanity on Create Digital Music:

Lily: Browser Beatboxes and the Rebirth of Max-Like Patching

Play the NY Times Website Like an Instrument, and Other New Lily Tricks

First Max 5 Details Are Here (And More to Come)

It’s no secret that a major update to Max/MSP/Jitter is coming from Cycling ‘74, with a major overhaul of the underlying code and an entirely new, friendlier interface. What has been secret is just what that upgrade will look like. We still don’t know what it’ll look like visually, but Cycling ‘74 today released some new details about what it is and isn’t.

In short, it promises to be:

  • Easier to use: Multiple undo, debugging tools for patches, and a visual catalog for perusing objects.
  • Easier to learn: Integrated, rewritten documentation, even including Web links.
  • Easier on the eyes: A new, zoomable patching interface with lots of new goodies — that’s not only skin deep, but makes patches easier to navigate.
  • Mo cross-platform: A new code foundation should make Max more modern, reliable, easier to support on C74’s part, and better supported across OSes. It even opens the possibility of someday seeing Max/MSP/Jitter on Linux and not just Mac/Windows.
  • Not full of gobs of new objects: Normally this is not a feature, but here, it’s a good thing: by introducing only a few objects, the new Max focuses instead on improving existing objects and building a better environment / platform for the future.

I’m meeting with Cycling ‘74 this week at AES, so hope to have more details then, including more on what’s changed for Jitter users. Audio users should note a big caveat — Pluggo support won’t be present in Max 5 at launch, which is critical to using patches as audio effects and instruments in other hosts, though it sounds as though that may be added at an undetermined point in the future. But on the visual side, it looks like it could be a pretty smooth upgrade: most patches and externals should be compatible, with some potential updates needed for tools that have special UI features. (I imagine some patches will look a little odd, too, once they hit the new UI — worth keeping that older Max copy around, just in case.) Overall, looks like good news. Naturally, we want to know more. Lots more. Soon. I’ll keep you posted.

Java and JavaScript support will continue to work. And that means Processing is supported, as well (via mxj), so this could be a great Processing prototyping environment, or a way of coupling Processing with other features. (See jklabs MaxLink. And yeah, it really does work … very cool. Viva Java.)

Cycling ‘74 Releases Max 5 Details: Bringing Max Out of the 80s, into to the Future [Create Digital Music]