Making LEDs dance to music

Share

I am working onย an installation at Amsterdam, trying to transform an ugly vandalised building into an open-air exhibition space, and make it interactive to make the area lively and the project engaging to pedestrians and vehicles.

Part of this involves having LEDs dancing around the building, encouraging the viewers to move around the building. For this, I ordered myself a strip of flexible RGB LEDs from China. These are based on the LPD8806 ( you can find a tutorial here ), run on 5V, do not need continuous refreshing and each LED is individually controllable. Guess what that means ? Yep, you can hook it up to an Arduino and start programming, just like that. I came across the FastSPI2 library, which does a great job of letting you control these strips (they support different chips like the WS2801 and others too) through a very easy interface.

With the LEDs and Arduinos in hand, I set about trying to find a fun enough experiment to do. I had wanted to map out motion data to visuals since a while, but then sound is a good option too, I thought. With that in mind, I tried finding a way to sync visuals to music. The Pink Panther track comes to mind very quickly, because of the simple beats and the associated visual movement being easy to imagine. With suggestions from my Japanese friend Takuma about using MIDI instead of MP3 , with this little script from my Spanish friend Alex to map the timings of the music track to usable text data, and with help from my Dutch team-mate Steven to figure out musical notation and editing, I was able to put together this little demo below. It is very basic, and I hope to put in more effects and visuals soon ! The code is on Github here : http://go.ankitdaf.com/dancingleds

Dancing LEDs from Ankit Daftery.

Share

Open source software you can pay for

Share

Before contributing code as a part of Google Summer of Code (twice), I used to wonder how open source worked. How could entire organisations, maintaining huge operating systems and other very popular software and systems keep running if they released their code out in the open, so to speak ? How could developers afford to pour in months of hard work into countless lines of code, and then let it all out there, for everyone to use, modify,share as they please ? I wasn’t skeptical, just immensely curious.

A few years down the line, I have a slightly better idea. Organisations accept donations, community-built software often gets built cheaper and quicker than developing commercially, using open sourced platforms in proprietary systems is not uncommon, and the like. As a part of Google Summer of Code, I (and every student developer) was paid a stipend, sort of as a compensation. After all, bills need to be paid.

Another approach I have come across, interestingly, is the “Buy me a beer” concept, which is now seemingly dead. The idea is, put in a “cool” way, that I need beer or coffee to keep on putting in those hours to make the code better for you, so please pay for a beer or coffee so I can work on it a little bit longer. This, of course, also depends on whether your code is good enough for someone to want you to continue developing it further.

Almost all my code I have developed so far is open, but I admit, almost none (except my GSoC contributions) are in substantial use. But as is habit, I found and wrote more code to automate my work that extra bit further. Where is this going ? Wait for a moment and see ๐Ÿ™‚

I have a photo-log, a collection of photos from two and a half years, documenting my life and travels over this time. I do not mean occassional albums, but regular pictures of people, places, things, activities. It amounts to 66 GB including videos and pictures. I already had written myself a tool to help me organise my collection better, but when Flickr announced the recent largesse of 1TB for everyone, I thought this was a great solution to backup my photos and share them. So I came across a script to bulk-manage my uploads, and modified it substantially to suit my purpose. Then I thought to myself, there must be a lot of people with needs and thoughts similar to mine, hoping to leverage the extra space. I am sure my script would be pretty useful for them. I would love to add features to it too, but I have a full time job as well. And then the concept of “buy me a beer” and Instamojo, a startup my friends are working on came to mind. That’s when I decided to experiment with “selling” code (the difference , of course is, that I am not selling the “code”, but documentation, tips and hacks to better leverage the code instead), though in a style similar to a performer who lets you pay if you wish to (and my friends at Instamojo tell me however-much-you-wish-to will be possible soon).

Do use the script, and buy me a coffee, if you think it helped you. You can get the script here : http://go.ankitdaf.com/uploadr . I don’t need to make much money out of it, but it would be a nice incentive to keep going. Also, I’d like to see how many people find it useful, and how many like it to the extent of paying for something they could have for free ๐Ÿ™‚ And of course, the coffee would help me stay awake ! Cheers !

Share

Phototime – Photo organizer minion

Share
Code is alright, but I have always been looking for opportunities to write small scripts, little things to automate life. Now, when I have the opportunity, I was only too glad to indulge myself.
I have been maintaining a photo-log since a few days, and that means a lot of photos everyday. The least I hope to gain out of this exercise is to know how my life progressed over a year.
So I figured I would have to name them consistently with their date and time as the file names.
What would let me do this ? Either have the camera’s processor run the code (very far-fetched, true, but it might be a possibility) or have a script on my computer to do the same.
So I chose this opportunity to write a small Python script to rename all photos in a folder in such a fashion.
What it exactly does is :
Supply the path to a photo folder as a command line argument, something like :
python phototime.py –ftype=filetype –path=filepath
and the rest is taken care of.
As an additional step, you could copy it to your “bin” folder which is in the shell path, rename it as “phototime” without the “.py” extension, make it executable (chmod a+x), and then enjoy the added ease of use. A more detailed documentation is on the Github page linked below
I’ve uploaded the project to a Github repository. You canย download it from here.
Please leave back feedback if its useful or if it sucked. Remarks and suggestions for modifications are most welcome.
Share