It’s not often that I find myself in the Bobst Library at 7.30 AM but on days that I do, I am lucky to see this view and then I wonder why don’t I do that more often. But that’s not what we are going to talk about today. The part which fascinates me most about this image is the interplay of the light with the branches. The shadows are sharp and solid but they do not overpower the contours or the colors of the trees. In fact, the shadows accentuate the shapes and the colors which creates contours by both its presence (the main branches near the center) and its absence (the dark branches near the top). Not only the plants, but the building at the top left also is suffused with a glow because of this interplay of light and dark. I wonder whether this also has to do with the concentration of particulate matter in the air.
But the thing I wonder the most about looking at this photo is that I should get up early more often.
Growing up in India, you see America through the eyes of its TV shows, comics and movies. And of of the iconic images is that on an american bar. From Edward Hopper’s Nighthawk to Seinfeld and How I met your mother, the bar is both iconic and mundane. So, when I found myself in a secluded bar on a rainy Tuesday night, I took this shot and decided to make it the first piece in my assignment.
The soft red lighting is being diffused by lamps placed on the side in a way that doesn’t create harsh shadows. The light de-emphasizes the human face and one is hopefully, more engaged in a conversation with people as humans. The soft diffuse reds are periodically accentuated with spot lighting in many forms. The candles on the tables, the strip bulbs that spread across the top walls like a radioactive creeper, The diffused green bottom lights at the bar create a melange of light where neither overpowers the other. The use of matte surfaces on the bard counter and the worn out wood panels on the walls add to the mood by diffusing the light softly without any accentuated shadows.
1st week in ITP is bizarre. The floor turns into a bazaar with students hopping in and out of classes and checking Albert more than Instagram. Caught in a vortex of this hurricane that sweeps through the floor, I somehow ended up in Light & Interactivity (People who dropped the class, I owe you one!). So without much ado, here’s the first assignment.
My task: To fade an LED without using linear PWM. (It’s not the first semester anymore!)
Now, the task seemed pretty deceptively simple. All, you had to do was figure out a curve pattern, figure out the equation of the curve and voila! an expressive LED. That was until I hit an issue that is apparently, an open secret. To explain further, here is the first video:
As you watch the LED fade, trace an imaginary graph of the increase in the light with your fingers. You will come to a realisation which is this:
The curve on the left is what was used to program the LED (linear PWM) but your eyes see what is essentially an exponential growth. This article does a great job explaining the issue and some good discussion can be found here.
So, it was clear that the curve needed to be compensated for in the opposite direction to create a more linear fade. I came across this article which suggested an equation for achieving the same and it felt much better.
This seemed like a good point to try out more curves. First comes the normal sine fade from Tom’s example.
Watching this go on and off, I thought it would be cool to replicate the ‘breathing‘ light on the Mac laptops of old. Turns out, that the pattern is patented (Duh!) and Lady Ada tried to reverse engineer it but did not publish the curve equation. More on that here. If you notice the wave function on the oscilloscope, it looks like a sinusoid function with the top clipped off at the peak. I assumed that I would have to do the math for it but lo and behold! The internet giveth in abundance! Someone had written a great blog on the topic and done the math. Woohoo! Its a great post which fully explains how to derive an equation from a curve using wolfram alpha. read it here. Off I went and wrote an arduino sketch with the results as below:
I am not sure if you can see the difference but a small subtle change in the graph can create perceptible differences. After having scratched the itch of doing the macbook light, I started looking at other repos on Github and came across this repo which has a sine transition as quadratic equation. The author has a great post explaining his approach in balancing the performance and the ease of use while developing the library here.
The result looks like this:
While doing these experiments, I started thinking of the motion curves that are used for defining animations, I wondered if there were of any use. Turns out, there is an old library which has converted all of Robert Penner’s iconic work with easing curves for arduino. It was written for controlling servos, but with a few tweaks, I could get it to work with LEDs:
I did not get much time with the library but on first impression, its extremely easy to use it for any motion with an Arduino control BUT the light fades are not as pretty as the motion curves either because of perceptual differences or the need for modifications to be made to the library. I shall dig into this more later and report back.
Currently listening: Lucy in the sky with diamonds- The Beatles