Last week I got the news that I’d been accepted into Nokia’s community device program and would be receiving a Nokia N950 so that I could help produce some nice open source MeeGo apps ready for the launch of the Nokia N9 later in the year. The device hasn’t arrived yet, but I’ve already started on the first of my projects which is to create a Libre.fm radio client. Most of the basic functionality now works including authentication, tuning to stations, playing, pausing and skipping back and forth through the playlist. I won’t be making a release until after I’ve had a chance to actually test it on the device itself, but the code is all in the GNU FM git repository. Here’s a quick video of it in action:

I’ve had a Kindle for a little while and really like it, but one of the areas it seems to be somewhat lacking in is the availability of translation dictionaries, as such I knocked up a quick script to convert TinyLex dictionaries from the Apertium project into indexed Kindle dictionaries. The most useful of these is probably the German – English dictionaries as these are very complete (over 160,000 entries).

One thing that I find quite useful is setting the German -> English dictionary as my primary dictionary (instructions below) then opening the English -> German dictionary and searching for words (or vice versa), this way you can get an instant re-translation of any words suggested to you.

Installation

Download whichever dictionary you’re interested in from the list below.

Android 2.2 (Froyo) support – Previous versions didn’t work under Froyo due to the new streaming framework (libstagefright) not supporting HTTP redirection, so resolving the final URL is now handled by Libre Droid itself.

Ability to add custom tag stations – You’re no longer restricted to the preset tag stations so if you want to listen to female vocals, to finger picked guitar, to monkeys or anything else our music might be tagged with then you can create a dedicated station for it.

Support for playing a user’s loved station – All the music you’ve ever loved in one easy station.

Support for the community loved station – The Libre.fm community’s favourite music, this is a selection of all the music that’s ever been loved by any of our users with the most popular tracks playing most frequently.

New artwork.

Plus a few miscellaneous bug fixes.

To access it directly on your phone either scan the QR code below or click on it from within your phone’s browser. Alternatively you can simply search for “Libre Droid” in the Android Market.

Local map rendering and route finding with libchamplain, Spatialite and Open Street Map

This tutorial takes you through the steps necessary to build a simple application which is capable of displaying data from OpenStreetMap and find driving routes between two locations without the need for any network services.

Preparation

libchamplain – Provides clutter based mapping widgets. You’ll need version 0.7.1 or later for memphis support, when compiling add –enable-memphis to the ./configure parameters.

Spatialite – Provides OpenGIS compatible routing (and more) on top of SQLite. This needs to be version 2.4rc3 or later. You’ll also need the spatialite-tools package for importing OSM data

Next we’ll need to acquire some OSM data to work with, for this example we’ll be using a small area around Nantwich in the UK, which can be download here. Data for entire countries can be downloaded from CloudMade, or data from a smaller specific area can be obtained from the OpenStreetMap API.

This is a fairly standard champlain program except it uses the memphis renderer to create tile images locally instead of fetching them from an online tile server. In addition to nantwich.osm you’ll also need default-rules.xml, which defines the appearance of the map.

The resulting program will give us a small window that displays our map data without the need for an internet connection:

Creating routing data

Before we can performing any routing tasks we first need to import our OSM data into spatialite and create a routing network from it.

Automatic import

I’ve joined these stages together into a small script, available here: populate_spatialite.sh. It takes two parameters, the first being the OSM data to import and the second is the spatialite database to be created:

./populate_spatialite.sh nantwich.osm nantwich.sqlite

Finding and drawing a route

First we define a couple of new global variables for storing references to our route’s polygon, our Spatialite database, and our database’s filename:

The main part of this likely to need further explanation are the SQL queries being used. To find a route between locations a query can be performed on the Roads_Net virtual table, to see the sort of results this generates we can load the database into spatialite directly and try some queries.

spatialite nantwich.sqlite

This starts an sqlite session with the spatialite extensions already loaded, so we can just type out our query directly and see the results:

The first row gives us details about the entire route, each following row is a single step along that route including the name of the road we’re travelling on at the time. You’ll notice that the Geometry column appears to be empty, this column is actually accessed through a number of different functions, to get a plain text representation of the geometry for our route we can do:

From here the program could be easily extended to look up OSM IDs based on their street names (stored in the roads table), to find the nearest OSM ID to a GPS position or to display text based driving instructions, all with just a few SQL queries.

Complete listings

The full source code and data for this tutorial can be downloaded here: champlain-routing.tar.gz. The complete program includes some additional enhancements such as the ability to request routes based on street names (in a simple, but non-robust manner) and zoom level controls.

If you create anything based on this tutorial I’d be very interested to hear about it .

I’ve had another stab at getting Jokosher running on the Nokia n900 and I’m getting much closer to something actually usable now, as this screenshot attests:

There’s still a number of issues that need resolving before it’s really ready for use (most notably some playback/recording issues and some dialog boxes that are too large for the screen), but it’s getting there. When it’s working fully it could make the n900 a very useful device for portable podcasting, allowing users to record, edit, mix, encode and upload their roaming shows with nothing more than their phone.

A while back I wrote a few GStreamer plugins that expose OpenCV functionality as GStreamer elements (source code), I haven’t had much time to work on these recently myself, but thankfully a number of other folks have started contributing now. Yesterday Daniil Ivanov kindly packaged gst-opencv for the maemo extras-devel repository, and the n900 performs surprisingly well considering how CPU intensive many of the vision operations performed are.

This first video shows edge detection being performed from the n900’s main camera (whilst simultaneously being encoded):

This second video shows the faceblur element in action, it detects any faces in the current scene and blurs them out, the frame rate and resolution on this one had to be reduced somewhat due to the complexity of the operation, it looks clearer when performed directly to an xvimagesink rather than attempting to encode at the same time.

Andi is looking into making it possible to do collaborative editing tasks between multiple Jokosher instances, between Jokosher and Pitivi and potentially between Jokosher and a small remote control (so you can use your phone/MID to start Jokosher recording/playing without needing to be sat at your PC). The project is progressing well with some Jokosher information and events already being exposed via a dbus interface.

Pēteris is working on finishing up some old work to provide telepathy support within Jokosher and then further extending this to add support for telepathy tubes. This will make it very easy for users to record VoIP sessions within Jokosher and the tubes support will also tie-in with Andi’s collaborative editing project, allowing him to send his dbus messages via telepathy connections to remote users. The most interesting use case from my perspective is for podcasters working over VoIP, in the scenario where both participants are using Jokosher it should be possible for them to carry out a standard VoIP call and then afterwards have the two Jokosher instances automatically synchronise a high quality recording of each participant’s side of the conversation; so while the VoIP call quality might not be perfect the final audio will sound as if they’re both in a studio together.

David is attempting to add musical score editing support to Jokosher, allowing people to sketch out musical ideas that can be played back as MIDI instruments alongside normal recorded audio. He’s already made some good progress in creating a python GStreamer element that can output some simple MusicXML based on an internal model (which can then be rendered to MIDI via the musicxml2midi element), this will then later be connected to a score editing UI, with the potential for multiple interface types (traditional scores, guitar tablature, drum events, etc.).

So hopefully by the end of the summer we’ll not only have a number of very exciting new features but also three more core Jokosher developers .

A few months back I started writing a GStreamer element for converting MusicXML into MIDI, the eventual goal of this from my perspective is to allow for score editing inside Jokosher (without Jokosher having to deal with all the pain of the MIDI format itself). It’s far from being perfect and still has trouble with more complicated files, but hopefully it’ll be of use to some people in its current state so I’m releasing version 0.1.

Contribute

All the source code is stored in a git repository: http://github.com/Elleo/gst-musicxml2midi. If you’d like to help out simply clone the repository and start hacking away, once you’re happy with your changes you can propose your branch for merging with my own.

For the past few months I’ve been working on the Libre.fm music service. It provides Last.fm compatible APIs, allowing you to submit your listening habits and to stream creative commons music.

Over the past week I’ve put together an Android application called Libre Droid, allowing people to stream music from libre.fm directly to their Android mobile phones. Here’s a short video of it in action:

A Not-So-Secret Project

With Jokosher 0.11.1 on the verge of release I think it’s time that I made my not-so-secret project slightly more public. For the past few months I’ve been slaving away to bring Jokosher to the poor unfortunate souls who, for whatever reason, are still stuck using Windows. That task is now for the most part complete, as this pretty screenshot will attest:

Testers Wanted

Jokosher’s 0.11.2 release will feature an easy to install Windows package, however I’m making a release candidate available now in the hopes that any major bugs can be discovered before the main public release. So if you have a Windows machine handy and feel like having a fiddle with Jokosher just download the installer package below. Everything you need is included in that one package, so installing it should be no different than installing any other Windows application. Then if you find any bugs please report them in the Jokosher bug tracker.