Archive | December, 2011

First test with Arduino

21 Dec

First test with Arduino

My first Arduino test w/o using the code snippets that come with the authoring tool. Just a simple pot controlling some LEDs

Playing with Arduino

20 Dec

For quite some time I’ve wanted to play with Arduino and after the Rock City project, where I did a lot of soldering and hardware integration (based on Phidgets) I decided it was about time I got started. I picked up the kit today and I just couldn’t stop playing with it. The kit that I got was the Ultimate Microcontroller pack from MakerShed. Lot’s of components and I also added a bunch of extra sensors that I though I might find a use for. So much fun!

Arduino programming is C/C++ based and that’s something I haven’t done much. The syntax seems fairly easy and for now I haven’t run into what I’ve always dreaded the most with C - memory management issues. I’m sure I’ll run into some, but I’ve picked up a couple books to read over xmas so that I can try to avoid things like that. I’ve posted a short vid of my first project done without following a tutorial below.

I have one question for those of you reading this that have Arduino experience:
Why will only some of my LED’s fade in/out?
I’m using “analogWrite” to set a value between 0 and 255. Those that don’t fade will always toggle at a value of 128. I’ve swapped around the LED and resistor and that makes no difference. It seems this is related to the I/O ports used. You can see this in the video below.

Housekeeping time

16 Dec

Housekeeping time

Back when I started this blog in 2006, I installed Movable Type and just left it there. Kind of scary given the amount of hackers, but apparently MT is pretty safe now that WordPress has taken over? I’ve finally managed to move this blog to a more recent CMS, so that was certainly about time… I didn’t want to spend time on a new setup, so I tried installing Wordpress - just because it takes virtually no time. It turned out that my hosting company had not yet upgraded their PHP to the version required by Wordpress, so I had to look at other options.

I love ExpressionEngine, but setting it up for something as simple as a blog is totally overkill. Then it dawned on me that the brilliant Bjørn Børresen had created some simple and decent looking EE templates over at ThemeForest. Turns out he has found some really good solutions, so if you just want a simple EE site - go check these out. They come complete with a bunch of Bjørn’s nifty extensions as well so the blog has Gravatar support, thumbnail generation and video embedding support. By just copying the theme files to the server at setup time, everything is set up for you automatically. Very neat!

Next part was moving all the contents of the old blog into EE and the excellent DataGrab module by Andrew Weaver came to the rescue. All my content (including comments) converted perfectly on the first attempt and all I’ve had to do are some very minor tweaks to the content and templates. Have to say that I didn’t expect this to go as smooth, so kudos to Bjørn and Andrew! I also threw together a quick, static site for my ltd company while I was at it.

Now that all my projects are finished for this year and I’m almost done with all other private projects, I will kick back with some Android and iPhone development on my brand new 27” monitor (I needed more pixels!). If you have any challenging Flash projects in January/February - please get in touch! I have extensive device experience and I wouldn’t mind doing some Stage 3D either…
(Note: the usual banners and microsites are not challenging/interesting…)

The Rock City project

07 Dec

The Rock City project

Once in a while there comes along a project where you get to play with loads of fun things. This project was exactly that. Rock City Namsos is a brand new cultural building in the city of Namsos. It contains a movie theatre, a concert hall, a resource hub for professional music, a super-sweet recording studio as well as an exhibition centre. I worked on the exhibition centre part and I was hired by SixSides and my friends at Back to create six of the ten interactive installations. If you’re ever in that part of Norway - make sure to drop by!

The goal for the interactive part of the exhibit is to teach people about how music is created and let them have a go at making it themselves. The theme is the musical style “Trønderrock” which was more or less invented in Namsos. The difficulty of the task is of course that no music skills can be required. Based on seeing both kids and adults having a blast making songs with the software, I think we solved this really well!

The first installation I did was a GarageBand-like editor that had been dumbed down a lot to make it accessible. The app is called “Låtskriveren” (the songwriter) and I could not have done this without the excellent Tonfall library written by Andre Michelle. Thanks a lot for making this library Andre!

laatskriveren.jpg

You create your own tracks by dragging prefabricated loops onto the timeline. There’s drums, bass, guitar and accordion (important for proper TrønderRock!) available. You’ll get a random set of chords initially, but you can change this by just pulling down a drop-down menu. Advanced users can zoom in on the timeline for some minor edits and they can bypass the automatic chords to mix and match as they want. You can jump on the timeline by clicking/dragging the playhead as well, so the app is quite complete.

The other app I did based on Tonfall was a full mixing desk with motorized faders! This app called “MiksEnMaster” was incredibly fun to do! All the interactive parts of the exhibit are activated using RFID cards that is made to look like a stage-pass (with Access All Areas of course). The passes are given out when the user enters the exhibit. The user will go up to a station, scan the card and if they save the result and register, they’ll be able to view and share what they created at the exhibit when they come home.

miksenmaster.jpg

When you scan your badge on “MiksEnMaster”, the motorized faders will all move up to the max position. This is done using standard mixing desk faders that we picked up from Yamaha along with Phidget motor controllers. Next you’ll select one out of four classic Trønderrock tracks and on the “window” (a 46” monitor) in front of the desk,  a guy will show up to tell you what to do. Hit play and you can tweak the eight tracks as you like. When you know how you want it, you press record to do the actual mixing.

As the user is working the faders, I’m adjusting the volume of each track in the Tonfall-setup. It simply works super-smooth! When the song is finished or the user stops the recording, we write the captured sound-bytes to an uncompressed WAV file and then convert that to MP3 using AIR’s NativeProcess capabilities. If the user is happy with the mix, we’ll save it to the server so they can show it off when they get home.

kuler.jpg

There’s also a third app in the exhibit that uses Tonfall. This one was done by @sunjammer and @deplifer and it’s a rythm-table! A big desk contains a bunch of holes and a string of LED’s that play along the top. By putting different colored balls into the holes, you can build your own rythms. The installation uses an AIR-app that controls two webcams that read the color of the balls. Each color is a sound and you can build some pretty cool rythms (or make a complete mess) with this installation.

Another app I made is “CoverDesigneren” (the Cover Designer). This is a multitouch-application for designing your own CD cover. I had played around with multitouch quite a bit before, but making this work on a 23” screen for completely novice users was quite a challenge. I would say that any app should get at least 25% extra hours if proper multitouch (other than the basic gestures) is required.

In the app, you can select pre-made backgrounds or take a snapshot using a webcam, add graphics and text as well as add effects to all of these. It’s kind of a mini-photoshop for CD covers. Thanks to Mario for his neat color manipulation classes in this app! The resulting covers from this app is played back later in the exhibit on a multi-projector setup where you’ll see your own cover along with classic Trønderrock-covers.

Many museums/exhibits have an archive, but Rock City now has the neatest of them all. On a purpose built class table containing two 46” screens, you can browse a huge archive of newspaper clippings and images previously unavailable. The people sitting down at this installation can easily just sit there reading for 15 minutes or even more.

avisbordet.jpg

The navigation is really cool as well. Beneath the glass surface, there’s four touch-buttons that light up if navigation is possible in that direction. It took forever to solder the 32 LED’s but the end result was simply beautiful. They make the table really easy to use. Another fun bit of this installation is that it is placed in a room that is made to look like a hotel room and just above the table, there’s a “window”. The window is also a 46” screen and when you’re reading an article about Tokyo, the window will change to show a view of Tokyo. Both sides of the table will “compete” over the “view” so we needed a simple way for these to tell what image to use. The maybe obvious choice here would be to use a socket server, but we used something that is much smoother to work with - Peer 2 Peer multicast! Thanks to the Cocoon-p2p library created by Peter Elst, the apps will just send a simple message onto the network that is then picked up by the machine running the view on the window.

We also use Cocoon in another part of the exhibit - the stage! Here you’ll scan your badge and enter a proper Stage. Once the first badge is scanned, a countdown will display on monitors in front of the stage until a recording starts. When the song is finished, you can view your recording on a big screen in the adjacent room. The setup consists of four different computers controlled with Cocoon p2p that runs different projections as well as the concert lighting rig that hangs above. @thomasnesse did this installation and while it was a fairly complex setup, I think he solved it very elegantly and simple thanks to the p2p capabilities in Flash/AIR!

My friend @plo also did the app running the Multitouch kiosks in the exhibit. These were done as AIR apps based on HTML/CSS/JS and this worked quite well. Personally I would still use Flash for custom UI like this, but it was fun to see that HTML is getting there as well for stuff like this.

tnt.jpg

This is certainly the most fun project I’ve done in ages and we could not have done this in such a short amount of time if it wasn’t for open source projects like Tonfall and Cocoon.

Did I mention this was all put together in only 3-4 months time? The project owners had set the launch to be 11.11 2011 at 11.11 so we had no slack in terms of the opening. The setup of the exhibition also got more epic thanks to a huge water leak that went straight into our server room the day before opening, but I absolutely loved this project. So many nice people and fun challenges are rare to come by. Fingers crossed that I’ll get to do more projects like this!

(images by Rock City, Lars Petter Garen and me)