« September 2006 | Main | November 2006 »

October 31, 2006

Code for Intelligent Restaurant Lamp

Here is the Arduino code for the Physical Computing Midterm, the Intelligent Restaurant Lamp.

It is based on three major code blocks: an event detection routine, an implementation of a finite state processor, and a state-dependent display routine.

/* Intelligent Restaurant Lamp v1.0

Physical Computing Midterm Project
October 17, 2006
revised: October 19, 2006

Younghyun Chung
Shinyoung Park
Gian Pablo Villamil

description here...

*/

// constants

#define numberLEDs 6
#define numberSensors 3
//#define thresholdValue1 0
//#define thresholdValue2 100
#define thresholdgestureTimeOut 3000
#define thresholdurgentTimeOut 5000 // 5 sec

// state definitions

#define Wait 0
#define BeginOrder 1
#define ContinueOrder 2
#define Order 3
#define OrderUrgent 4
#define BeginCheck 11
#define ContinueCheck 12
#define Check 13
#define CheckUrgent 14

// event definitions

#define sensor1 0
#define sensor2 1
#define sensor3 2
#define cancel 4
#define gestureTimeOut 5
#define urgentTimeOut 6

#define LED11 2
#define LED12 3
#define LED21 4
#define LED22 5
#define LED31 6
#define LED32 7


// variables

int currentState;
int currentEvent;
boolean switchState=false;//rona
int sensorValue[3];
int thresholdValue[3] = {100, 100, 100};
long lastTime = 0;

void setup() {
for(int i=2; i

pinMode(8, INPUT);

currentState = Wait;
currentEvent = -1;
Serial.begin(9600);
}

void loop() {
GetInput();
ProcessState();
DisplayStatus();
}

// Scans the sensors, looking for a change
// Returns a new currentEvent

void GetInput() {
for(int i=0;i

//DebugSensorValue();
for(int i=0;i if( (sensorValue[i] > thresholdValue[i]) && (currentEvent != i) ) {
currentEvent = i;
lastTime = millis();
}
}
/*
for(int i=0;i if
if( (sensorValue[1] > thresholdValue1) && (currentEvent != 1) ) {
currentEvent = 1;
lastTime = millis();
}
if( (sensorValue[2] > thresholdValue2) && (currentEvent != 2) ) {
currentEvent = 1;
lastTime = millis();
}
}*/

if (digitalRead(8) && !switchState) {
switchState = true;
currentEvent = cancel;
}
else if (!digitalRead(8) && switchState) {
switchState = false;
lastTime = millis();
}
if((millis() - lastTime) >= thresholdurgentTimeOut && (currentState==Order || currentState==Check)) {
currentEvent = urgentTimeOut;
lastTime = millis();
}
if((millis() - lastTime) >= thresholdgestureTimeOut && !(currentState==Order || currentState==Check)) {
currentEvent = gestureTimeOut;
// currentEvent = urgentTimeOut;
lastTime = millis();
}

//Serial.println(millis()-lastTime);
debug();

}
// Based on the currentState and the currentEvent, updates the state

void ProcessState() {
switch(currentState) {
case Wait:
switch(currentEvent) {
case sensor1:
currentState = BeginOrder;
break;
case sensor3:
currentState = BeginCheck;
break;
}
currentEvent = -1;
break;

case BeginOrder:
switch(currentEvent) {
case sensor2:
currentState = ContinueOrder;
break;
case sensor3:
case cancel:
case gestureTimeOut:
currentState = Wait;
break;
}
currentEvent = -1;
break;

case ContinueOrder:
switch(currentEvent) {
case sensor3:
currentState = Order;
break;
case sensor1:
case cancel:
case gestureTimeOut:
currentState = Wait;
break;
}
currentEvent = -1;
break;

case Order:
switch(currentEvent) {
case urgentTimeOut:
currentState = OrderUrgent;
break;
case cancel:
currentState = Wait;
break;
}
currentEvent = -1;
break;

case BeginCheck:
switch(currentEvent) {
case sensor2:
currentState = ContinueCheck;
break;
case sensor1:
case cancel:
case gestureTimeOut:
currentState = Wait;
break;
}
currentEvent = -1;
break;

case ContinueCheck:
switch(currentEvent) {
case sensor1:
currentState = Check;
break;
case sensor3:
case cancel:
case gestureTimeOut:
currentState = Wait;
break;
}
currentEvent = -1;
break;

case Check: // 13
switch(currentEvent) {
case cancel:
currentState = Wait;
break;
case urgentTimeOut:
currentState = CheckUrgent;
break;
}
currentEvent = -1;
break;

case OrderUrgent:
switch(currentEvent) {
case cancel:
currentState = Order;
break;
}
currentEvent = -1;
break;

case CheckUrgent:
switch(currentEvent) {
case cancel:
currentState = Check;
break;
}
currentEvent = -1;
break;

}
}

// Based on currentState, updates the display of the lamps

void DisplayStatus () {
switch(currentState) { // LED11-2 12-3 21-4 22-5 31-6 32-7
case Wait:
for(int i=0;i break;

case BeginOrder:
digitalWrite(LED11, HIGH);
break;

case ContinueOrder:
digitalWrite(LED11, HIGH);
digitalWrite(LED21, HIGH);
break;

case Order:

digitalWrite(LED11, HIGH);
digitalWrite(LED21, HIGH);
digitalWrite(LED31, HIGH);
break;

case BeginCheck:
digitalWrite(LED32, HIGH);
break;

case ContinueCheck:
digitalWrite(LED32, HIGH);
digitalWrite(LED22, HIGH);
break;


case Check:
digitalWrite(LED32, HIGH);
digitalWrite(LED22, HIGH);
digitalWrite(LED12, HIGH);
break;

case OrderUrgent:
Serial.println("OrderUrgent");
blink(0);
break;

case CheckUrgent:
blink(1);
break;
}
}

void blink(int Status) { // Status 0: UrgentOrder, Status 1: UrgentCheck
int BlinkTime = 250;
if (millis() % BlinkTime > (BlinkTime / 2)) {
for(int i=2+Status;i<=7;i+=2) { // if Status = 0 : i = 2 4 6, if 1: i = 3 5 7
digitalWrite(i, LOW);
}
}

else {
for(int i=2+Status;i<=7;i+=2) {
digitalWrite(i, HIGH);
}
}

}
void debug(){
Serial.print("currentState: ");
Serial.print(currentState);
Serial.print("\t");
Serial.print("currentEvent: ");
Serial.print(currentEvent);
Serial.print("\t");
Serial.println(millis() - lastTime);
}

Paper for Applications class: M5 bus ride

The only assignment for the Applications class (other than the presentation) is to ride the M5 bus from start to finish, and back, then write a 5 page paper about surprises and observations.

I decided to have some fun with it, and wrote it from the POV of someone from 1100 years in the future, experiencing a simulation constructed from the years of media recorded by previous generations of ITP students.

Keep reading after the link if you want the whole thing...

Dérive through Manhattan, New York, October 29, 2006

I have been looking forward to this assignment for months, not just for the access to resources that implies, but also the immense emotional weight attached to it. Oh, the language, you ask? I have chosen to write in North American English of the Late Classical period, as being appropriate to the subject matter.

Do you need context? The assignment is to ride the Manhattan M5 bus route from its beginnings in SoHo, until its end at the George Washington bridge. These places are long gone, of course: the elaborate recording of this route by generations of ITP students has allowed for an accurate reconstruction of the experience (albeit at immense cost, in computational and archival resources).

The collective I am part of has allowed me direct control of the experience, and in my eagerness I arrive early at Holoubek Hall, the presence lab. The technicians still need some time to prepare – physical interfacing is still difficult, even after years of development. I feel prepared, however, having used the network to study the language and geography in the previous weeks. I pass the time by looking out the windows at the port below, where a ship from Madrid is being unloaded.

Finally, everything is ready, and I settle into the control face. The glass of nanomech-laced fluid is tasteless and warm (body temperature), and is swallowed quickly. There is a second of disorientation as the sensory bypasses take effect, and then, I am there:

New York City, a crisp fall day, 1,100 years ago and a universe away.

First impression: so many people! Almost all of them are monogender, and of physical types unknown to me. Each of the bodies I see, one mind. I experience a pang of sadness when I realize the extent of the diversity that has been lost, but avidly return to observing the scene around me.

The street seems to be under repair, a cluster of trucks are gathered around a cut in the pavement. I recall that this period was one of warfare and strife, and guess that perhaps the crews are trying to repair damage from a recent attack. The amount of scaffolding on nearby buildings at first seems to confirm this supposition, but closer inspection shows that the damage is quite clearly delimited, and that the work on buildings seems to be intentional, and not a result of hostile action. It seems that I am witnessing the workings of an ongoing maintenance process, relating to infrastructure that is not yet capable of self-repair. The trucks are labeled “Con-Edison”, which is a reference to one of the pioneers of electrical power distribution.

I am drawn along by the point of view of the long-ago documenter, and brought aboard the bus. The parallelism between the bus as a vehicle, and the way we choose to live now, is striking – and drives home to me the value of the experience. A group of us, all with approximately the same goal, give up short-term freedom of choice in return for increased efficiency.

I watch the streets of the vanished city go by, and am startled to see someone watching me: a ghostly face, floating inches away from the window. A moment of thought and things become clearer: the data on which my experience is based must originally have been recorded using an optical camera, so I must be seeing the recorded reflection of the person who made the original recording. For some reason, the archivists have chosen to leave it in.

It is young face, male, with a somber, almost sad expression, and it will be my companion for the next hour and a half. Across the ages, this student was set the same task I am about: to observe. I am fascinated by this solemn individual, and find myself speculating about him. What concerns shaped the world of an ITP student like him, so long ago? Did he have children? Did he spend his entire life as a single sex? Was he lonely, alone in his mind, with a body all to themselves? Did he survive the transition to our current state, through a combination of life extension and good luck? Was a network connection already as essential to life?

Outside on 6th Ave., street signs serve as a kind of external collective geographical memory. The open space of Houston Street gives way to a narrower road, and buildings become noticeably taller. They are labeled with their dates of construction: Bigelow Pharmacy 1838, Jefferson Market 1929, practically new structures, contemporary with the early years of ITP. Signs are used to communicate the nature of businesses, since at this time navigational tools are still in their infancy. I have to remind myself that none of the people I see around me have the same supplemental displays that I am using. I am struck by the vast amount of information that is fixed in place this way, tied to specific buildings and places. On the walls of some buildings, I see painted advertisements for businesses that had already ceased to exist. How did people distinguish between current and obsolete signage? Did they have no choice but to believe everything that was written?

I continue to be amazed by the sheer amounts of people in the street, practically all of them monoconscious. I can tell by the way their eyes are fixed in one direction, that their sensorium is only serving a single consciousness. This may be the central issue of the time: so many bodies, all of them needing places to live, food, means of transport.

They are served by many small businesses, of astonishingly specific types: different types of food, luggage, separate businesses selling shoes and repairing them, etc. At no time do I see more than 5 people in any of the shops, and often only the staff are there – a profligate waste of resources. A lot of the businesses just north of Houston are clearly concerned with pre-reproductive activities: clothing, food, alcohol.

Continuing north along 6th Ave., I notice how the streets slope down to the river on my left, reminding me of Manhattan’s topography, a granite spine rising between two rivers. Buildings are taller, and more elaborately decorated, mostly brick and sandstone. By 22nd Street, the amount of scaffolding, construction and maintenance activity is much reduced. Perhaps a wealthier area could already afford infrastructure capable of self-maintenance.

By 37th Street, buildings are even taller, materials are mainly glass and steel. I see the genesis of my world in these elevated structures, though the lack of bridges at the upper levels is somewhat perplexing. I know from my research that many of these structures survived until relatively recently, and the parts that remained above water were actually inhabited. As with our world, the driving force for such verticality in construction was scarcity of land. From my perspective at ground level, I can see that they are heavily reinforced and secured around their lower floors. Presumably, the armed guards are there to keep people at the street level from higher floors. In this part of town, security and power seem to be major concerns. In contrast, many of the buildings I saw further downtown actually seemed to encourage access – probably because of their focus on more social activities.

I attribute the cleanliness of the streets and the good state of most of the construction to substantially better infrastructure. This is probably paid for by the corporations in the area, some of which are still with us. Though people at this time may not have realized it, their government had already ceased to be relevant: so-called “public” infrastructure was already mostly bought and sold by “private” companies. (what an interesting contradiction in terms!)

By 57th Street, the monoliths are fewer. I see occasional clusters of small businesses and restaurants: dry cleaners, tobacco shops, snack bars. I smile when I see the “Rock ‘n’ Roll” deli., a cultural reference I am familiar with. So many shops, serving so many people, all of them with individual likes & dislikes!

The bus reaches Central Park, a clear frontier. Past this point, I see fewer people in the streets. Most of the people on the bus get off. The granite outcroppings on which Manhattan is built are finally visible, just inside the park. To my left, Middle-Eastern motifs decorate the entrance of the recently-renamed Jumeirah Essex House. It is ironic to see a building in Manhattan named after a beach in Dubai. The royal family must have had a sense of what was coming, and sought the high ground – but not high enough…

Just north of Columbus Circle, a huge new building is under construction. A truck loaded with pre-fabricated sections of stone flooring is unloading. I notice that this building is designed with security in mind – the lower floors have a bulk that implies heavy armoring. The older buildings at 67th Street and beyond seem less like fortresses. While the use of curved glass implies wealth, they do have windows at ground level. A few blocks further on, a row of mansions overlooking Riverside Park is a throwback to days when land scarcity was not quite so pressing. The bus is now traveling well above the river, along some bluffs. Perhaps it was this high ground that attracted settlement to this area in the first place.

At 112th Street, the density of construction declines markedly. Buildings are only 5 or 6 stories high, compared to the 15 floor structures common only a few blocks south. By this point, the bus is traveling along a high bluff, with the river visible on the left, and street level quite far down on the right. By 135th Street, we have entered an area of huge red brick high-rises and warehouses. Research suggests that, unlike the high rises further south, these buildings were mostly used for housing the poor, or for storage. Perhaps the imminent threat of flooding was not yet a factor?

I sense another adjustment in the automatic translation systems, and I am reading signs in Spanish. Clearly people are concerned about money here – shops advertise which methods of payment are valid, the availability of credit, the possibility of remitting funds to family in other places. Food shops and restaurants are very different from those I have seen before. A full-sized helicopter is embedded in the façade of what turns out to be a supermarket, owned by a José Liberato (“su destino, vender barato” – “his destiny, to sell cheaply”). Very eye-catching. People here seem concerned with their survival as individuals, and as a culture.

At 166th Street, the Columbia Medical Center is the center of a block of non-Hispanic culture. A few chain stores and cafes look like an outpost of West Side culture, but don’t last. By 175th Street the Hispanic community has reasserted itself. It is time to disembark. I know my time is limited, so I pay close attention as the simulation shifts its point-of-view to the beginning of the George Washington Bridge, where long ago someone came to admire the view. Had I grown up with a body to myself, I might find it frustrating to not be able to guide my steps, and instead have to rely on the movements of some long-ago videographer. My last image is of the bridge shining in the afternoon sun, rows and rows of trees visible across the river.

A shock of disorientation, and I am back in Holoubek Hall. It takes a moment to adjust to my surroundings, and to re-establish contact with the collective consciousness that occupies this body: 200 of us, organized as a cooperative.

When the seas rose, and the land ran out, and space turned out to be far more hostile than we thought, the only way out was to gather multiple minds into shared bodies, using formulas for management copied from the real estate world of the late pre-Flood period. As such, some of us share bodies as a condominium, some as collectives, some as totalitarian hierarchies where a single consciousness is able to physically express itself. Of course, all minds have their own network connection, which is where most of our living, working & playing takes place. Most of the time, we are passengers in the bodies that carry us, but this does not seem onerous, as long as we have our connection to the nets. My chance to control our shared body today is a rare privilege.

I am left with a sense of awe and astonishment, and understand the wisdom of this assignment: to get out into the physical world, to understand a life in motion, without the ever-present umbilical of the network. Alien as it may seem, that is the world inhabited by generations of students in this very program, some of the architects of the world we live in now.


October 25, 2006

ICM Midterm Dialogue

Pekka & Toivonen, two students, reflect on the Internet as a driver of social and political change. Pekka believes that by it's very nature, the Internet can promote democracy and social change. Toivonen is more skeptical.

A dialogue on concentration of wealth, power & the Internet.

 

Characters:

Pekka: An idealistic young student
Toivonen: A less-idealistic student

 

Scene:

Somewhere in the East Village

 

Toivonen: Hey Pekka! Where are you going?

Pekka: To find something for lunch - are you hungry?

Toivonen: Not really, but I will go with you. There are a lot of interesting things to see on the way. Over there, for example, a branch of the New York public library, originally designed to serve German immigrants.

Pekka: Nowadays, new immigrants can just use the Internet.

Toivonen: Perhaps to read newspapers in their own language, and to communicate. I don’t think it replaces books or a place to meet. The library I pointed out became the hub of an immigrant community in this neighborhood, a focus for social life and organization.

Pekka: An online community can become such a hub as well!

Toivonen: I think it can keep new immigrants in touch with their community back home, but not really act as the focus of a new community here. Note how the strongest communities are geographically concentrated. Even the Japanese and Koreans, with great technical sophistication and Internet access, all gather together in clusters…

Pekka: Still, I think the Internet makes the experience of a new immigrant far different from the past. Their ability to stay connected, to be informed, and to influence their living situation is far greater.

Toivonen: That depends on whether they can get on the Intenet at all! Internet café’s are not all that widespread, and still quite expensive here, and the immigrants with the greatest need to organize are not buying computers.

Pekka: Still, they manage to get there. I know of a lot of families that keep in touch with their home country by e-mail and Skype. Even those cheap calling cards you get at grocery stores are made possible by cost reductions driven by the Internet, and VoIP.

Toivonen: And of course, their children do play online games! But what you described, all that does is keep them in touch with their friends & families back home, it does not make them part of a cohesive community here. I don’t think it forsters any kind of political organization or self-determination here.

Pekka: Don't you think the Internet is a powerful democratizing force? It makes it possible for the population at large to be better informed.

Toivonen: But not to take action. You can spend endless hours “researching” many issues, but at the end of the day, your vehicles for action are the same as they always were: vote, write your congressman, spend your money or protest. (Arguably, the first three are roughly equivalent…) If you’re not ending up with one of those four, you’re basically just spinning wheels – in cyberspace. If you care enough about an issue to take action, you probably cared already, before the Internet came along.

Pekka: I don’t agree! I think it makes it possible for committed people to multiply their impact, to get others to take action as well.

Toivonen: Well, you still need committed people in the first place. The Internet doesn’t magically summon them into existence.

Pekka: Perhaps not, but it certainly makes it possible for these committed people to be more easily heard. After all, they can set up a website, a blog and an e-mail newsletter almost effortlessly, with a global reach.

Toivonen: Global reach does not equal a global audience! You can write and publish all you want, but it is no guarantee that anyone will read. Besides, too many voices quickly become noise. People respond more readily to a single loud voice, than the chatter of many. Moreover, it anaesthesizes people, insulates them from the reality, and convinces them that online life is real life, hence precluding real action. Even if you can get people to read, getting them to take action is still difficult.

Pekka: Well, perhaps by moving wealth and power away from the traditional establishment, the Internet creates avenues for social change. Look at all the new wealth that has been created, and put in the hands of young, intelligent people.

Toivonen: I would disagree – the “new” fortunes created by the Internet, and technology in general, have benefited already powerful and educated persons. Look at Bill Gates for example - his father a powerful lawyer, and his mother on the board of Sprint, even before he became wealthy. Most of this wealth has been created by highly educated university graduates (and yes, I know Bill Gates dropped out!), who are already a cultural elite. If you want an example of an industry that has benefited the underprivileged, try hip-hop music! It’s certainly put wealth where there was none before, but hasn’t exactly led to social change…

Pekka: Surely it leads to a more even distribution of wealth, by creating more efficient markets?

Toivonen: On the contrary,it leads to concentration of wealth and power, since competition is fluid & unfettered by geography, dominant players can achieve market positions unthinkable if constrained by geography.

Pekka: But surely, the values of these idealistic young billionaires cannot be corrupted so easily. These are people who understand how the system works, who are driven to create change even before they accumulate wealth.

Toivonen: Even radicals become coopted once they become wealthy, look at Steve Jobs.

Pekka: But coopted into what?

Toivonen: The wealthy seek their own interests, and quickly forget the interests of others. More subtly, if you are a highly-educated, intelligent, wealthy person with a social conscience, you will act from that basis. You will have difficulty understanding the issues of the people you are trying to “help” from their point of view. The very dynamic of social activism driven by the wealthy pushes the “beneficiaries” into a passive position, as simple recipients, and ultimately perpetuates disempowerment.

Pekka: But surely, something like the Gates Foundation can be far more effective than channeling the same amount of money through governments!

Toivonen: Well, a foundation can be more effective because decision making is highly concentrated. However, this power is concentrated in the hands of a wealthy individual, who can do what they think is right, without accountability to the recipients. If they happen to be doing nice things, everyone is happy, but they could change their mind on a whim, and do something else. Also, they may choose to focus their efforts on things that are not actually supported or required by their beneficiaries. Finally, consider this: say a poor African country receives massive grants from the Gates Foundation to implement vaccination programs. It will pretty soon become obvious to their people that it is the foundation, not their government, that has the money and power. This makes the government seem ineffectual, and will lessen people’s interest in trying to influence it. Instead, they will end up begging from the foundation, which has no incentive to respond based on anything other than the founder’s whims.

You may be able to get more people vaccinated in the short term. However, in the longer term, you may make it harder to for people to control their own destiny, by undermining their local institutions.

It reminds me of the EU’s misplaced “charitable donations” of surplus food to Africa, which had the effect of putting African farmers out of business… Sure, you fed some people in the short term, but destroyed their ability to feed themselves going forward.

Pekka: So what is to be done?

Toivonen: Don't count on the Internet as the answer - you must continue to strive for change and action. And don't confuse clicking on a mouse with action! The Internet can be a tool for creating a better society, but there is nothing inherent in its nature that will lead to that.

October 24, 2006

Midterm project completed - field report & lessons learned

Shinyoung (Rona), Younghyun & myself took the "intelligent restaurant lamp" to a restaurant. We've documented our experience, and some lessons learned, after the link. Please also look at Rona's blog and Younghyun's blog.

Click here for the demo movie.

Interestingly, the waiter told us that two years ago a similar product had been tested in the restaurant, a button-like object that lit up red or green, according to whether the customer wanted to order or ask for the check.

He did not think his restaurant was big enough to justify such a product, and thought the staff was quite alert. However, customers at the next table disagreed, and thought the lamp would be a good idea!

We learned a lot carrying out this project:

1) IR sensors are very delicate, and sensitive to physical positioning!

2) IR sensors can be triggered by tungsten lights in the room. This has the unforeseen effect of changing the function in the lamp according to room lighting. When it is dark, the lamp is triggered by detecting IR light reflected by the user's hand. However, when there is bright IR-emitting lighting, the lamp should be triggered by detecting an IR shadow cast by the hand. We've tested this by manually making the switch, but it should be possible to automate by averaging readings from across all three sensors, and looking for the "odd man out". Alternatively, choose a better proximity sensor.I now understand why IR sensors like this are popular for faucets - hiding them under the tap shields them from room light.

3) The gesture control mechanism is very appealing, possibly even more than the real utility of the lamp. People really enjoyed playing with it. The way the LEDs light up progressively gives very crisp clear feedback. I noticed many people would naturally try to reverse the gesture, but by then the lamp was locked into "order" or "check" mode. I would consider making a simple room lamp with the same hardware, only using gestures to make the lamp brighter or dimmer.

4) There is no problem with misrecognized gestures. The sensors are very precisely focused, and the lamp will only trigger on the exact gesture. In fact, it is almost too precise.

5) As it stands, the lamp is too big for a restaurant like Cozy's. It needs to be smaller (flatter or narrower, height is OK), or stacked over the condiments.

6) The finite state machine as the core of the program worked very well, it was very easy to modify or add behaviours.

7) It is important to plan ahead when doing the wiring. In hindsight, I would have run a power and ground bus to all levels of the lamp. This would have meant 15 less wires running down to the breadboard, since 3 LEDs on each level could share a common ground, and the IR emmiter/sensor could share a power lead.

8) Given how easy it was to build and program, I would not hesitate to add additional functions, perhaps a solenoid-activated bell, and a few more control gestures.

October 23, 2006

Using random video input for music generation

I was recently reading about the special effects for the upcoming movie "The Fountain", which were done using microphotography of particles in fluid.

Apparently the result was incredibly dense, rich visuals of starfields & such, with a texture difficult to match by CG.

I was thinking of how to process such imagery, and use it to generate a matching soundscape. Perhaps by taking live video of the tank, and running it through a computer vision application that would generate sound?

October 22, 2006

Finished our presentation!

On October 17th, our team did our presentation for Red Burn's class, "Applications of Interactive Technologies". The format of the class is very interesting - the first half is two student presentations reacting to the previous week's guest speaker, the second half is a invited guest.

Our team's speaker was Ethan Zuckerman, founder of Global Voices Online, an aggregator of blogs from places that are not reached by the global news media.

Our presentation worked very well: each member of the team chose a different style to present, and delivered it on and off the stage. Meredith took to the stage with a mike, myself and Baek stood in the back and read from blogs from different regions, Emery made a tickertape that ran under a video of Ashlen with her mouth taped up. Goal was to show how the conventional media "drown out" voices from other places, and how active intervention by the audience is necessary to change the situation.

There was some tension in how the team worked, but in the end it worked out. I think I have learned a lot about how to work with people who do not come from a business background, where team skills are kind of hammered into you.

A flock of intelligent lamps

Inspired the correct functioning of the midterm project (an intelligent lamp for restaurant patrons), I have been thinking about ways to take it forward.

I am thinking of moving things in several directions:

1) More decorative lighting than practical tool, which means replacing the LEDs with brighter bulbs

2) Networking several lamps together - lighting one lights all, in sync and/or having them put on a synchronized show

3) Adding sound, perhaps with little bells or gongs triggered by solenoids

October 19, 2006

Midterm project - Success! (almost)

We have now completed the "intelligent restaurant lamp", at least a first version.

It responds correctly to gestures, all controls are working. Still working on timeout and display routines.

Here is a picture:

We've learned that IR sensors are very fiddly to work with: the IR LED transmits a very narrow beam, and the receiver sees a very narrow field of view. Therefore, the two components have to be angled towards each other so that when an object is in front of them, the IR beam projected by the LED is visible to the sensor. A tiny variation in the position of the transmitter or receiver has a huge impact on the values returned. Here is a picture of the emitter & sensor mounted.

I think using the finite state machine concept for programming has been very helpful: we were able to define all states completely, in a very reliable way. I will use this technique again, whenever feasible.

I actually like this device, and would spend the time & effort to make one for myself! I would replace the LEDs with actual lightbulbs, to make it more lamplike, and make a slightly more elegant mount for the sensors.

Working with Shinyoung & Younghyun was a great experience. We understood each other very well, and shared our tasks effectively. Shinyoung actually wrote the code for processing the state machine table, Younghyun and I physically constructed the lamp.

Woven Circuits

My team's midterm project for Physical Computing involves lots & lots of wires. It occurrs to me that a way of making this attractive (and somewhat obscure) would be to weave the wires together, into a sort of textile, where in some way the colored patterns formed by the wires would represent the circuit itself.

October 17, 2006

Midterm project - status update

We have moved along further with the restaurant lamp. We now have the physical structure built, have tested the sensor, and have completely defined the gestures and responses.

Here is illustration of the state transition diagram, which shows how the lamp processes upward and downward sweep gestures to get to an "order" and "check" state.

We now need to finish Arduino coding, and wire up the lamp.

October 13, 2006

Reactions to "Moving Pictures" at Grey Art Gallery

The early history of moving pictures is an excellent case study of the birth of a new medium, since it is sufficiently recent for excellent documentation to be available, yet sufficiently developed that many of the longer term cultural and social effects have become visible.

The exhibition "Moving Pictures" at the Grey Art Gallery focuses on the very early stages of the history of motion pictures, juxtaposing very early film with contemporary examples of painting, illustration and photography.

Though the works only cover a period of 10 years, this is enough to convey a lot of insight about the birth of a medium.

What I found most striking about the early films is how closely they tracked the subject matter and sensibility of visual arts from the same period. In many cases, short films from the Edison lab were essentially moving representations of subjects portrayed in paintings. These early filmmakers found themselves copying iconic images from other media.

I have encountered an example of this, when I went to Turkey to see the total solar eclipse. I intended to make a short video project, including footage of dervishes, Istanbul, people dancing, etc. It turns out that that the film "Baraka" includes similar footage - in fact, clips from this movie were used as background visuals at the eclipse festival which I attended. After I had returned to Tokyo and edited my movie, I was struck how a previous viewing of "Baraka" had influenced my choise of shots: in many cases I had similar imagery from the same places (albeit less polished). This did not surprise me, but as I collected various short videos from other attendees at the festival, I was struck by the discovery that the same thing had happened to everyone! Slow motion scenes of dervish dancing, timelapse sunsets over Istanbul, crowd shots in the markets, etc - all these images from "Baraka" appeared in the videos! After discussing it with some of the other video makers, it is clear that no-one set out to copy or re-make Baraka: however, the influence of the imagery was such that it conditioned everyone's choice of scenes. It seems that the first artist to capture an impressive image or sequence will inevitably be imitated by subsequent artists, unless an effort is made to break away.

In this context, it is particularly impressive to observe the work of early motion picture pioneers who broke away from stereotypical images, and truly innovated.

For example, the works of the Lumiere brothers actively played with the dimension of motion. Their graphic style and careful technique anticipate the much later development of moving pictures as an art form. Their hand-tinted films of exotic dancers capture a dimension of the scene which had escaped painters and photographers.

Another great example of an innovator is Eadweard Muybridge, who did not set out to create art. His initial motivation was scientific, to document the motion of horses. The exhibition comments that as a consequence, he discovered that paintings did not actually represent horses in realistic poses, once their motion was analyzed! This is the polar opposite of the early Edison films, which attempted to copy paintings - the Muybridge films highlight the inaccuracy of painting, by using completely different techniques.

A key aspect of the works displayed is the focus on the novelty of motion - few of the works attempt to tell a story, convey a message or induce an emotional state. It is interesting that the exhibition focuses only on this very early stage, before moving pictures had established themselves as an art.

Finally - I was impressed by the curatorial effort that must have been involved to pull the show together. The number of and diversity of institutions that loaned works is staggering, it must have been very difficult! Of course, things were simplified by transferring the film material to digital media.

October 12, 2006

Midterm project - Restaurant attention lamp

I had some further discussion with my midterm group for Physical Computing, and we have converged on something that works.

Initially, we wanted to do a "mood indicator" for people working with laptops. However, this did not have a clearcut application, or interaction with the user. Frankly, it didn't resonate with any of the team members.

The new idea is much better: a gesture controlled lamp that is used to send messages to wait staff at a restaurant, such as wanting to order, pay the bill, etc.

We've noticed that in the US there is no clear way to get the attention of wait staff at restaurants that isn't interpreted as rude. Yelling is not well regarded (unlike Japan & Korea), and gestures are often not seen, or ignored. An intelligent lamp will be able to get attention in a polite way, and "escalate" the request automatically on behalf of the customer.

Input will be by making a sweeping gesture in front of sensors embedded in the vertical lamp. An upward sweep to order, a downward sweep to pay. Up and down sweeps would cancel each other, ie when showing "order" state a downward sweep would cancel the state. (Alternatively, we may include a dedicated "cancel" button. When signalling a state, and too much time passes, the lamp will signal urgency by starting to flash. There may also be light sensors to read overall light levels, and perhaps modify behaviour of the sensors in the lamp.

Our design concept is of a vertical paper lantern with three or four segments, each segment casting light in a different color. The sensors will be embedded in the side.

We will carry out observations this weekend, of how customers in restaurants attract attention, and we will also work out the state table that describes the behaviors.

Big Science VJ

I have been thinking about building a very large scale interface for VJing, using big levers, knobs and knife switches. The idea would be to put on a VJ performance that looks like it's being put on by madmen in lab coats working with arcane instruments, not nerds checking e-mail...

October 11, 2006

Getting info from Google in Processing

Wrote my first functioning program to fetch info from a Google RSS feed and manipulate it in Processing.

See it here.

Surprisingly easy to debug. Display routines were hardest. XML parsing was easy!

Update: I found some Java code to return straight ASCII from the escaped HTML returned by Google.

Ultrasonic scanner v.4

Finally got to version 4 of the ultrasonic sonar scanner!

This one now has fully functioning comms between the Arduino microcontroller and a Processing program working on the laptop.

There are some minor glitches: servomotor motion is somewhat jerky (possibly a data rate issue) [fixed!], sensor readings lag somewhat, readings are sometimes a bit erratic. I understand that it may be possible to improve quality of the readings by decoupling the signal line, using a capacitor.

Next big step: analyzing transitions & changes in the sensor data in order to trigger MIDI (sound) events.

Keep reading for source code of the Processing and Arduino projects.

===================================================
The Arduino program
===================================================

/*
Rangefinder control v2
Gian Pablo Villamil
October 10, 2006

This program waits for a signal from processing to move to an angle, then returns a
rangefinder reading at that angle.

Key points:
use long for lastPulse
use Serial.available before every read
problem with scaling function (scale in processing)

*/

int servoPin = 9; // Control pin for servo motor
int minPulse = 500; // Minimum servo position
int maxPulse = 2500; // Maximum servo position
int pulse = 0; // Amount to pulse the servo

long lastPulse = 0; // the time in milliseconds of the last pulse
int refreshTime = 20; // the time needed in between pulses

int analogValue = 0; // the value returned from the analog sensor
int analogPin = 0; // the analog pin that the sensor's on

int rangeFinderValue = 0;
int rangeFinderPin = 1;

int servoAngle = 0;
byte incomingByte ;
byte done ;

int scale(int inputValue, int inputMin, int inputMax, int outputMin, int outputMax);
void moveServoTo(int angle) ;
void returnReading() ;

void setup() {
pinMode(servoPin, OUTPUT); // Set servo pin as an output pin
pulse = minPulse; // Set the motor position value to the minimum
Serial.begin(9600);
servoAngle = 0;
lastPulse = millis();
}

void loop() {
if (Serial.available()) { // message available?
incomingByte = Serial.read();
switch (incomingByte) { // what is it?
case 'a':
// set servo angle and get reading
servoAngle = 0;
bytesReceived = 0;
done = false;
while (!done) {
if (Serial.available()) {
incomingByte = Serial.read();
if (incomingByte >= 48 && incomingByte <= 57) { // it's a number
servoAngle = servoAngle * 10 + (incomingByte - 48);
}
else {
done = true; // or else we're done
};
}
};
pulse = (servoAngle * 19) / 10 + minPulse;
moveServoTo(pulse); // move the motor
returnReading(); // return the reading
break; // Break from the switch
case 'i':
// set minimum
Serial.println("minimum");
break;
case 'o':
// set maximum
Serial.println("maximum");
break;
}
while (Serial.available()) {
incomingByte = Serial.read(); // clear the buffer
};

}

// if nothing else happened, refresh the servo

if (millis() - lastPulse >= refreshTime) {
moveServoTo(pulse);
lastPulse = millis(); // save the time of the last pulse
}
}

void moveServoTo(int pulse) {
digitalWrite(servoPin, HIGH); // Turn the motor on
delayMicroseconds(pulse); // Length of the pulse sets the motor position
digitalWrite(servoPin, LOW); // Turn the motor off
}

void returnReading() {
rangeFinderValue = analogRead(rangeFinderPin);
Serial.print("r"); // we are returning a reading
Serial.print(rangeFinderValue, DEC); // send the reading
Serial.println(); // send a carriage return
}

int scale(int inputValue, int inputMin, int inputMax, int outputMin, int outputMax) {
return ((outputMax-outputMin)*(inputValue-inputMin)/(inputMax-inputMin)+outputMin);
}


===================================================
The Processing program
===================================================
import processing.serial.*;
import processing.opengl.*;

/* Sonarscan v4

Enhanced version of sonar scan, with better support for sweeping back and forth.

Major change from v2.0 - got rid of the Trails array completely, now using alpha rect
to achieve trail fading.

Major change from v3.0 - now actually turning the motor and reading the sensor.

Gian Pablo Villamil
October 10, 2006

*/

// constants

int motorMin = 100;
int motorMax = 900;

int angleMin = 0;
int angleMax = 127;

int numReadings = 128;
int numTrails = 255;

int distanceMin = 0;
int distanceMax = 0;

int sensorMin = 0;
int sensorMax = 255;

float ONE_AND_HALF_PI = PI + HALF_PI ;

// variables

int sweepMin = angleMin;
int sweepMax = angleMax;

int currentTrail = 0;
int sweepDir = 1;

Reading[] roomReadings = new Reading[numReadings];

int i;

// interface stuff

Serial serialPort;

void setup() {
// size(screen.width, screen.height, OPENGL);

size(640, 480, OPENGL);
frameRate(60);
smooth();
background(0,0,0);
strokeWeight(3);
distanceMax = width/2;

// check the serial ports

println(Serial.list());

serialPort = new Serial(this, "COM4", 9600);

// setup the room & trail arrays

for (i = 0; i < numReadings; i++) {
roomReadings[i] = new Reading();
}
i = 0;
println("finished setup");
}

void draw() {
fill(0,1);
noStroke();
rect(0,0,width,height);
translate(width/2,height);

roomReadings[i].current = GetReadings(i);
DrawTrail ();
roomReadings[i].previous = roomReadings[i].current;

i = i + sweepDir ;
if (i > sweepMax) {
sweepDir = -sweepDir;
i = sweepMax;
}
if (i < sweepMin) {
sweepDir = -sweepDir;
i = sweepMin;
}
}

// Get sensor reading for an angle, store the value in the roomReadings array and in the
// Trail array.

int GetReadings (int angle) {
int bytesReceived = 0;
int returnValue = 0;
int motorAngle = scaleInteger(angle,angleMin,angleMax,motorMin,motorMax);
int incomingByte;
String motorString = str(motorAngle);
// println("sent a"+motorString);
serialPort.write("a");
serialPort.write(motorString);
serialPort.write("\r");
boolean done = false;

while (serialPort.available() == 0) {
}; // wait for something to come back
incomingByte = serialPort.read();
if (incomingByte == 114){ // we are receiving a reading
while (!done) {
if (serialPort.available()>0){
incomingByte = serialPort.read();
if (incomingByte >= 48 && incomingByte <= 57) { // it's a number
returnValue = returnValue * 10 + (incomingByte - 48);
}
else {
done = true; // or else we're done
}
}
}
while (serialPort.available()>0) {
incomingByte = serialPort.read(); // clear the buffer
}
}
// println("got back " + returnValue);
return returnValue;

}

// Draw the sweep

void DrawTrail () {
float lineAngle ;
float lineDistance ;

lineAngle = scaleFloat(i, angleMin, angleMax, HALF_PI,ONE_AND_HALF_PI);
lineDistance = scaleInteger(roomReadings[i].current, sensorMin, sensorMax, 0, distanceMax);

if (roomReadings[i].current >= roomReadings[i].previous) {
stroke(0,255,0);
}
else {
stroke(255,255,0);
}
strokeWeight(3);

pushMatrix();
rotate(lineAngle);
line(0,0,0,lineDistance);
popMatrix();
}


// general purpose scaling function for float return

float scaleFloat(int inputValue, float inputMin, float inputMax, float outputMin, float outputMax) {
return ((outputMax-outputMin)*(inputValue-inputMin)/(inputMax-inputMin)+outputMin);
}

// general purpose scaling function for integer return

int scaleInteger(int inputValue, int inputMin, int inputMax, int outputMin, int outputMax) {
return ((outputMax-outputMin)*(inputValue-inputMin)/(inputMax-inputMin)+outputMin);
}

October 06, 2006

Observation Assignment - Part 2

For part 2 of the observation assignment, I observed people using laptop computers at Dunkin Donuts on Second Avenue. Since this place provides free wireless access, has plenty of outdoor tables, and is cheap, there are often lots of people there using computers.

Almost always the pattern of interaction with the laptop was the same: a lot of doing nothing, some stroking of the lower part (using a pointing device probably), and even less frequent bursts of typing. The big exception was when more than one person was interacting with the device, in which case there was a lot of pointing at the screen, and touching. I thought this was very interesting.

What most struck me was the body language and stance of people using the laptops. Rapid bursts of typing were accompanied by an "attention" stance, sitting up in a chair and leaning forward, while the bulk of the time the user was in a "relaxed" stance, sitting back. There were some brief times where the user was in an "attention" stance while not doing anything, or maybe sipping coffee while staring at the screen. There was almost no variation in the focus of attention while using the laptop, save occasionally reaching for coffee.

There was a remarkably consistent pattern that preceded putting the laptop away, which involved looking around, touching the laptop, looking again and then packing it away.

Switching to "observer from another planet mode"...

10am, outdoor tables: Three people are staring at what I have been told is a "laptop computer". All are seated, all are young males. One is sitting at indoor counter, facing out the window. Other two are sitting in the outdoor table area, facing the entrance to the outdoor area and the shop. They are staring intently at the upper part of the device, and their hands are resting on the lower part of the device. Frequently they make soft stroking motions on the bottom part of the device, and occasionally there are bursts of finger activity as well, repeatedly pressing buttons. There is a change in body position when this happens - the staring and stroking can take place when leaning back, but the bursts of activity are often accompanied by leaning forward.

about 20 minutes later: After some time of no activity, one of the people using a laptop closes the lid, while looking at the device. They then raise their head, and look around at other people in the place, and at the general environment. Laptop is placed in a bag, then the person stands up and leaves.

...time passes...

other laptop users have continued as before. Numerous persons come and go, with various food purchases. Other people sitting at tables indoors and outdoors, reading newspapers & books. One person arrives with a bag, orders donut & coffee, asks a question. There is a bit of searching behind the counter, the person behind the cash register writes something on a napkin, and hands it to the person (customer).

The newly arrived person looks around, goes to a table outdoors, looks around again, puts down coffee and food, sits down. Looks around one more time, reaches into a backpack pulls out a laptop computer and puts it on the table, and opens the lid. Looks at the napkin that was given by the clerk.

...time passes...

Something seems to happen with the device, and the person is quickly in what appears to be an "attention" state. Reaches forward, several quick bursts of finger activity (typing) then a pause. Looks at the napkin again, then while holding the napkin, very deliberate typing. Pause, with the person staring attentively at the device. Person relaxes. Short burst of finger activity, some stroking of the device, then the person appears to relax even further, leans back in chair, takes a sip from cup and starts a pattern of behavior almost identical to the other two people. This is basically the intermittent stroking & staring pattern, with occasional bursts of typing.

... time passes ...

One of the other people folds down the lid of their laptop without preamble, looks around, stands up, places laptop in bag, looks around again and leaves.

Another person sits up, stretches, types quickly, stares intently at the laptop for about 5 seconds, looks around, folds the lid, looks around again. Packs the laptop into bag, packs some other small items, stands up and leave.

=====================

This is a second set of observations, from the evening. Five people are using laptop computers. All are young males, warmly dressed. In this case, three are sitting in a row of tables to the left of the entrance, with their backs to the wall. Another two are sitting at the counter at the window, facing out. Two users are wearing headphones.

As before, mostly people are looking at the device, with very little motion. Occasional stroking, with short bursts of typing. However, this time, one of the users turns to another at the next table, and talks to them. Both then turn and stare at the laptop of the one that initiated, with latter turning his laptop towards his neighbor. The neighbor touches the screen of the laptop, the laptop's owner nods and touches as well. The laptop is restored to its previous position, but both people continue to talk for several minutes

... time passes ...

Both people who have been talking make a series of nodding/bobbing motions, and the pitch of conversations rises momentarily, before stopping completely. Both users turn back to their laptops in an upright "attention" stance, before relaxing back into their chairs and resuming their periodic stroking/typing.

... time passes...

One person sits up, looks around, puts hand on laptop lid, looks around again, but then sits back, and types. A few minutes later, sits up again, looks around, closes the laptop and slowly packs up.

Project idea - the scanner

I'm working on the following: mounting an ultrasonic rangefinder on a servo motor, then using a program in Processing to sweep it back and forth and take readings. Ideally, if the readings are then displayed using polar coordinates, it should show a rough map of the surroundings.

The next step: by keeping track of the readings between sweeps, it should be possible to detect if objects are moving closer or further away. So perhaps it might be interesting to send out a MIDI signal, and rewire it to Ableton or some such, whenever motion is detected.

The idea is that motion of the sweep would introduce a rhythm to the piece, then the position in the sweep field, and the distance, of objects would cause different sounds to be played.

I've built the hardware (turret with motor and sensor), can control the motor from the laptop, and receive sensor readings.

Now I basically need to code a matching set of routines for the Arduino board, and for Processing, that will move the servo to an angle, take a reading, and return the reading to Processing. It may be easier to just use the sensorbox firmware for Arduino, which basically turns it into an I/O box with all functions controlled from the laptop.

Next up is a display routine for the gathered data. I have mostly figured this out, the breakthrough was the need to keep an array for the stored readings separate from the individual sweeps used for display.

Finally, a routine to analyze for changes, and send MIDI out. I cannot seem to get the proMIDI libraries to work, but have reached out for help on this already.

Project idea - deconstructed film

My friend Rui told me about an interesting work: an edit of the election debates between John Kerry and George W. Bush, where all the talking was removed, and only the silences left. While I have not seen this yet, it does sound fascinating.

I am considering taking a well-known movie (for some reason "Star Wars" comes to mind) and cutting it up into scenes featuring specific characters, then showing all the character specific streams simultaneously in a multi-window presentation.

Characters with less screen time would have their own window go blank early, while the characters with most screen time would have their window persist until the end.

I was also thinking of stretching/speeding up the various videos so that scenes with multiple characters sync up, or alternatively, let the viewer choose the point of synchronization.

In the short term, an easier thing to do would be to take a shorter scene, say a dialog between two characters, and play both halves of the conversation at once, on a split screen.

Project idea - crashed artifact

I have been playing around with this idea for a while: build a working "artifact from the future", and surround it with a set & audiovisual presentation that will give it context.

I am impressed with a lot of the work I have seen at ITP, but it almost always stands alone, like an alien artifact plopped down by itself in the building. What if these "alien artifacts" brought along some of their environment with them? What if they were surrounded by debris, explanatory material, etc. but from their own time & place, incomprehensible to us?

Works that inspire me are things like the "Codex Seraphinianus", the artificial archaeological dig created at Burning Man in 2004, and many fascinating illustrated books & exhibition catalogs I have from Japan. All of these works are loaded with information, but requiring a huge effort to even begin to understand.

There is another work I like, called "1/1 Scale" from an exhibition called "Gundam Generation" - it is a full size replica of a spacecraft, that has obviously suffered massive damage, and has been abandoned by its crew. It is emplaced in the middle of the gallery, surrounded by a multi-screen projection of mysterious images.

I would like to work with the idea of the presence of the artifact being the result of some incomprehensible accident or tragedy, whose meaning must be discovered by the viewer.

Project idea - distorted communications

I really dislike cellphones. Since they don't allow sharing a context with your callers, often calls come in at the wrong time, and then the quality of the communication is very poor. A lot of conversations are either establishing context, eg. "where are you?" or clarifying misunderstandings eg. "what did you say? I didn't catch that?" or even trying to see if the communication is still working eg. "hello? hello? are you there?".

I was thinking of building an installation around this theme:

Build some kind of booth, featuring a phone that will call anywhere (using VoIP or something) for free. The downside is that calls are filtered through a software system that introduces distortion: stuttering, pitch shifting, delays, etc.

The distortion can be reduced by manipulating physical controls (levers, dials, etc) that require some concentration, and force, to operate.

This will encourage reflection on the subject of "how hard are you willing to work to make yourself heard" and "how much energy does it take to really communicate".

Perhaps there is room to record the conversation and evaluate how much is overhead, focused on the quality of the medium, versus convesation, the "content" of the medium.

October 04, 2006

Midterm project - initial brainstorm and observations

Our team had an initial brainstorming regarding the midterm project. Pictures of our notes are here.


This is based on situations we've seen at ITP, and at other locations during the observation assignment.

We are converging on the idea of a device for indicating whether or not a user is in a communicative state, with sensors to signal the approach of others, and uncomfortable noise levels. This may take the form of an "intelligent laptop pad" or a hat, or both.

The interactions we are hoping to capture are:

* sensing presence of the user, and turning on lights
* allowing user to indicate "mood" - contactable, busy, hungry
* sensing approach of others, and responding automatically according to user mood
* sensing noise levels, and responding automatically
* burglar alarm
* sensing darkness and proximity, and lighting up to help location

October 03, 2006

Idea for ultrasonic sonar scanner

I am planning to mount one (or more) Maxbotix range finders on a servomotor, so that I can sweep it back and forth and map out the shape of nearby objects.

To do this, I need a program in Processing that will run on a laptop, and a small program on Arduino to take the readings and report them back.

Read more to see v1 of code for the laptop display routine.

import processing.opengl.*;

// Sonar scan v1.1
// Program to plot values as a radar-like sweep
// Will ultimately take input from rangefinder on the Arduino
//
// Gian Pablo Villamil
// October 2, 2006

// Define constants

int maxReadings = 360;
float sweepAngleIncrement = TWO_PI/maxReadings ;
int numSweeps = 90 ; // number of sweep lines to draw
color whiteColor = color(255,255,255);

// Define variables

int curReading = 0 ;
int sweepRadius ;
float curSweepAngle = 0 ;
color sweepColor ;

int[] sonarReadings = new int[maxReadings];

void setup() {
size(640,480,OPENGL);
// size(screen.width,screen.height,OPENGL);
smooth();
frameRate(120);
sweepRadius = height/2;

// initialize the array of readings

for (int i = 0; i < maxReadings; i++) {
curSweepAngle = TWO_PI * i / maxReadings;
sonarReadings[i]=getReading(curSweepAngle);
}
}

void draw() {
background(0,0,0);
translate(width/2,height/2); // center the coordinate system
drawSweep();
curReading = (curReading + 1) % maxReadings;
curSweepAngle = TWO_PI * curReading / maxReadings;
sonarReadings[curReading]=getReading(curSweepAngle);
}

// draw current sweep, and trail of fading readings

void drawSweep() {
pushMatrix(); // save coordinates
rotate(TWO_PI*curReading/maxReadings);
for (int i = curReading ; i >= curReading - numSweeps ; i = i-1) {
if (i == curReading){
strokeWeight(3);
sweepColor = whiteColor; // draw the current reading in white
}
else {
strokeWeight(2);
sweepColor = color(0,(numSweeps-(curReading-i))*(255/numSweeps),0);
}
stroke(sweepColor); // stroke color fades from green to black

// draw a line by rotating the system by an increment, drawing line

int j = i ;
if (j < 0) {
j=j+maxReadings;
}
rotate(-sweepAngleIncrement);
line(0,0,0,sonarReadings[j]);
}
popMatrix(); // restore coordinates
}

// getReading function
// returns an integer "range" value for a given angle

int getReading(float readingAngle) {
return sweepRadius;
}

October 02, 2006

Observations on "La Jetée", by Chris Marker

I watched "La Jetée" on Google Video, an interesting short work by Chris Marker, and undertook to write about my reactions to it.

My first reaction is that this is a lovely piece of work! It has an original and interesting story with lots of depth, and is told using a very limited, yet evocative, set of audio visual techniques. The technique complements and enhances the story very well.

The film is made using only a succession of black & white still photographs (there is a small segment of motion towards the end), with a voice-over narration. This apparent constraint actually opens up many creative possibilities. I have found this to be true in general - that constraints (either imposed or chosen) encourage creativity.

By limiting himself to photographs, the director is able to put a seamless mix of historical images (for example, the ruins of a bombed city, standing in for a future Paris) with photographs shot for the film, and have them appear consistent.

The use of still photographs limits the ability to convey information through camera moves, yet the creative use of pans and zooms gives a powerful sensation of motion.

Moreover, this format works well with the story: the memories of a time traveller. The use of monochromatic stills leads to a "distance" from the subject that makes it very much like a distant memory. This also creates a sense of nostalgia, of longing for a long-gone past (our present!).

That said, the montage of photos is very skillfully edited as a *film* - the duration of shots, the pace of edting, and the focus on specific parts of the image shows the hand of a skilled film director at work.

The soundtrack is equally restrained, limted to the narrator's voiceover, and a moody choral score.

Finally, the length of the work is worth commenting on: it is only 26 minutes long, yet manages to tell a complex and engaging story. It is possible that the highly constrained form has led the director to put together something where every second counts... not unlike the life of the protagonist and the enigmatic woman in his life.