Thursday, February 25, 2010

Little Computers: Fun With Drawing


This week for Little Computers, we were asked to use iPhone drawing techniques to create an app that utilized them in an interesting or animated way.  Given the weather, I decided to use precipitation for inspiration, and made an app based around rain.  

The app starts out (as above) with some clouds and a low lying body of water.  As you shake your iPhone, the accelerometer detects the movement, and the app generates water drops in response.  As the drops reach the body of water, it rises accordingly.

Once the body of water has risen to the edge of the clouds, it detects this, and holds off creating rain so it can have a moment to recede.  After that, you can start all over again!

The shapes in the application were rendered in Quartz, the 2D rendering engine native to Mac OS.

Sound And The City: New Japanese Underground

This week for Sound and the City, Mark Triant, Igal Nassima, and I were asked to present on some aspect of sonic history.  We collectively decided upon Japanese noise music, sometimes known as the "New Japanese Underground".  Below is our presentation (complete with graphics and sound) to the class.  Enjoy!

pdf: New Japanese Underground Presentation

Monday, February 22, 2010

Nature Of Code: Midterm Proposal

For the Nature of Code midterm, we were asked to do the following:  

Develop a proposal and a prototype for a "midterm" project. The scope of the project can be quite large (trial idea for a final, for example), however, you will not be expected to implement the entire project. For the proposal, include a description, relevant links, and a quick Processing sketch of the first step towards the idea. Link your proposal from the wiki. Next week, we will look at a selection of proposals and then on Mar 2/3, the results for all midterm projects will be presented.

As such, I've decided to continue my work on modeling popcorn using the Box2D library.  While the original attempt was moderately successful, there are a number of aspects that I'd like to modify and enhance so that the simulation will be more realistic.  Specifically, they are to:
  • Enhance the geometry of the popcorn so that the kernels and popped corns are not uniform in shape and size.
  • Work with density variables to create more realistic behavior as the corn pops and expands out of the kettle.
  •  Work with kernel placement and velocity so that the kernels don't breach the kettle walls upon popping.
  • Allow for user interaction and variability with the simulation, including: amount of popcorn, turning the kettle on an off,
  • Create more realistic visualizations to associate with the simulation as a whole.
These changes will also serve to further familiarize me with the Box2d library, and its ramifications for geometry and particle systems in a modeling context.  The project will not be the prototype for a final project, but rather the final iteration of an earlier project before I embark on a final.

Tuesday, February 16, 2010

Nature Of Code: Popcorn Modeling

This week in Nature Of Code, we were asked to use the Box2D library to implement a model of some real world phenomena.  Box2D is a physics system that manages the physics of a given system, which you can add various physical "bodies" to.  This allows you to create a realistic physics model for a given 2D system with very little coding overhead.  For whatever reason, when I heard this, my mind immediately went to popcorn.

For a smaller number (100) of kernels, my model (with a small amount of tweaking) actually works quite well.  The kernels pop somewhat naturally, and the system generally handles the physics of the situation how you would expect it might:  just like a real popcorn popper!  You can see the effect of 100 kernels in the first two illustrations of this post.


However, from there I started adding more kernels, and got into some trouble.  At 150 kernels (above) the physics started behaving a bit erratically, and areas with a lot of popping density would cause kernels to move through solid objects.

When I increased the number of kernels even further, to 300, this behavior became almost ubiquitous in the system.  Kernels were popping out of the kettle left and right, and the walls of the kettle seemed almost meaningless.

I have yet to discover what the cause of this behavior is, but my guess is that it's an inability of Box2D to handle the sudden transition from kernel to popped kernel.  A few ideas I've had include increasing the time of the "pop" from one step of the physics engine to say, 3 or 4.  This might allow the engine to handle the change more intuitively.


One of the challenges of Box 2D is that it has no graphical output, so everything you draw is based upon a Box2D object, but isn't actually a Box2D object.  What this means is that errors in one's graphics code can appear to be Box2D errors, when in fact they are coding errors on the users end.  This is unquestionably one of the downsides of using a "black box" engine, but hardly enough of a problem to avoid using such a versatile tool.


source: Popcorn Model

Thursday, February 11, 2010

Sound And The City: Final Project Proposal - orchestraSeating

This week for Sound and The City, we presented our proposals for final projects. My project, orchestraSeating, is an installation piece that interactively deconstructs classical music scores. The Power Point presentation for my proposal is can be found below.


ppt: orchestraSeating Proposal

Tuesday, February 9, 2010

Nature Of Code: Flower Modeling Mk. 3

The image above is a screen grab of the third revision of my flower-based physics model, last mentioned here.  Since then, the model has gone through a number of iterations.  The first modified the graphics to be slightly more refined, and more successfully integrated a wind force, as well as a flower "wobble".  The initial issues I had with the wind being too uniform were resolved by putting a limit on the force vector, as opposed to the resulting velocity vector.  The velocity limit had been causing all of the flowers to share velocity and direction.  I intriduced the "wobble" in an effort to give each flower its own movement, in spite of the shared wind vectors.

This revision, the third, takes the second revision and adds the concept of thermals.  The thermals can be seen in the regions defined by white lines above.  These thermals provide a third, largely upward, force that is defined by the developer.  When blooms cross them, the addition of the thermals can result in spontaneous upward movement, ostensibly due to air current resulting in difference from temperature.  From here, I think the next logical step is transferring the wind force from a single shared force screen-wide into an array of wind vectors, varying based on screen location.

Code:  Flower Modeling Mk. 3

Thursday, February 4, 2010

Sound And The City: Soundwalk - "Imaginary Commute"


This week for Sound and The City, we were asked to create a "soundwalk", whereby we would make a field recording of a walk through a given area, and narrate along.  Since I live about 10 blocks from Penn Station, I decided to do an "imaginary commute" as though my home were an office, and I needed to catch a train at Penn to get home.  I left my front door around five in the evening, and the result is below.

audio: Soundwalk - Imaginary Commute