This program allows you to use the trackpad on a mac book pro as a midi controller. This means you can play it like an instrument:
The program looks like:
If you're not using this with a real midi synthesizer, you need a software based one like SimpleSynth
It's designed for the macbook pro touchpad, but also works on the magic mouse. I believe it would also work on the touchpad for the desktop; it should be the same.
The program is free: (download)
The source code is available under the gpl, and you can download it from github. There's a command line client with all the functionality of the gui version that you can build if you start from source.
For details on how I made this, see the development blog.