Wishful Coding

Didn't you ever wish your
computer understood you?

Chord Progression Suggester

I did this project together with Sarah, the goal is to suggest good chord progressions to musicians.

GUI screenshot

We both know some music theory, so we started out by reading about what makes a good chord progression. The longer you look at it, the more complicated it gets. I quickly concluded that music is art, not science, so you can do whatever you want.

Instead, we wrote a scraper for guitar tabs. Just download a ton of them and look for anything that looks roughly like

([A-Ga-g][b#]?)(m)?((?:maj)?[0-9])?(sus[0-9]|add[0-9])?(/[A-Ga-g][b#]?)

We then try to figure out which key the original song was in, and convert the chords to intervals, called universal notation.

Now that we have these sequences of legit chord progressions, we need to persist them in a smart way.

We went through markov chains, tries and some other crazyness, but fnally settled on just a flat list. It turns out just scanning the whole list for the given pattern takes an acceptable amount of time.

The final step was to write a gui that could suggest chords for you. It’s written in Tkinter and uses Mingus for some playing and parsing.

Get my new pop hit

Get the source

Face Tracking Laptop Crawler

First post from the US!

I can’t really do nice photography, video and building instructions here, but I did make a robot.

This thing sits under your laptop, and can drive it around and tilt the screen. The idea is that it will always face you, and keep a fixed distance too.

It uses the webcam of my laptop to track my face using OpenCV from Python.

It could also keep a fixed distance using the ultrasonic sensor, but this is not implemented.

Published on

NXT in-line skater

I found a video that features a skating robot, it moves, but skating? I did a lot of skating myself, so I started to think about a better skating movement.

It occurred to me that while skating around pylons, you don’t need to take your skates of the ground. What you do instead is hard to explain.

I tried to explain my idea to anyone who’d listen in #mindboards, but to no avail. You just have to see it with your own eyes.

It is a really fun thing to build and play around with. I suspect you can find more efficient and inexplicable ways to move and turn.

Get the building instructions for this model

This is the Mirah code I used in the video:

import lejos.nxt.Motor
import lejos.nxt.Button

def align()
	Motor.A.rotate(360 - (Motor.A.getTachoCount() % 360))
	Motor.C.rotate(360 - (Motor.C.getTachoCount() % 360))
end

speed = 150
Motor.A.setSpeed(speed)
Motor.C.setSpeed(speed)

Motor.A.forward()
Motor.C.forward()

Thread.sleep(20000)

Motor.A.stop()
Motor.C.stop()

align()

Motor.A.backward()
Motor.C.forward()

Thread.sleep(20000)

align()

Motor.A.forward()
Motor.C.forward()

Button.waitForAnyPress()