Processingをはじめよう

As some of you may remember, at the beginning of last year’s zemi class, I handed out a number of a copies of Getting Started with Processing, a very short introduction to programming in the Processing environment by the founders of the project, Casey Reas and Ben Fry.

That short book is probably the best book for beginners to get started with Processing, or P5 as it is known for short. However, I suspect that some of you may have been put off by the fact that the book is written in English. Since a few months ago, the same book, with some additional helpful sections, has been translated into Japanese and is available from Amazon. The book seems to be selling fast, so if you plan to buy a copy, it might be a good idea to do so soon.  If the first run sells out, which I think may be likely, there could be a lag before a second printing appears.

The best way to get started with P5, of course, is to download the program from the P5 community site and start writing some simple programs. The syntax of P5 is similar to C, which most of you have seen in the first year programming classes. However, you’ll soon realize that P5 can be much more fun than C, because it is much easier to get interesting graphical output. Many experienced programmers use P5 as a prototyping tool as they find it is an excellent system for sketching ideas and trying things out. There are lots of libraries for doing all kinds of things such as 3D graphics, computer vision, sound, simulation etc… All completely free, because the developers are believers in open software and sharing. As it turns out P5 is more stable, and much more user-friendly than many expensive software development environments.

It’s possible to get by just with the online documentation, tutorials, and help files included with P5 itself. But having an introductory book does help a great deal. I had a look at the Japanese edition of Getting Started with Processing this afternoon and liked the fact that it includes a glossary of the core P5 functions.

In our era, ignorance of programming is akin to an inability to read and write for someone born after Gutenberg. If your experience with C turned you off, why not give programming another try with P5? I guarantee you that a little effort will reward fun and understanding. These books are available at Amazon, linked to the images above.

p5js doodle

Epicycles & Visual Music

I spent some time this evening looking again at the motion of particles moving along epicyclic trajectories. The motion of a single particle q in the complex plane, z, is given by the following parametric function of t:

z_{q}(t) = Re^{i\omega_{q} t} - re^{i\Omega_{q} t} \;\;\; with \; \Omega_{q} > \omega_{q}, \;\; R > r

The animation above is generated using 50 particles moving according to the same parametric equation, with angular velocities given as integer multiples of a fundamental value:

\omega_{q} = q \omega_{1}, \;\;\; \Omega_{q} = q \Omega_{1}, \;\;\; q = 1, 2, 3 \cdots

With the velocities distributed in this way, the angular positions attain various kinds of harmonic relations, whence the arrangement of the particles in the complex plane falls into simple symmetric patterns. The animation bears some resemblance to the visual music of James and John Whitney. In his later work John Whitney made use of digital computer programs to create visual music animations (Whitney, 1981), using particle systems related to the one described here.

[1] John Whitney, Digital Harmony: On the Complementarity of Music and Visual Art , New York, McGraw-Hill, Inc., (1981).