Monday, June 30, 2008


Hopefully I get to try out for Masala next week. They're a local afro-cuban/brazilian drumming group here in Victoria. I've seen them perform twice, and they totally rocked out. Cross your fingers for me!



A couple interesting looking Rails plugins:

named fixtures exporter - This plugins can export/display fixtures with belongs_to/has_and_belongs_to_many relations using fixtures names instead of foreign key id.

Google Ajax Libraries API - Implements the Google AJAX Libraries API as a Rails plugin.

Sunday, June 29, 2008


On July 1st, Canada Day 2008, I'm going to first be listening to whales at the lab, and then going to the Canada Day Baroque Concert on Mount Tolmie, here in Victoria BC.

From the website:

"Two, free, hour-long, open air baroque music concerts celebrating Canada Day on Mt. Tolmie, 2 p.m. and repeated at 3:30 p.m. Program: Bach Double Violin Concerto in D minor; Corelli Concerto Op.6, #8; Grosso, Geminiani Concerto Grosso "La Folia"; Handel "Water Music" excerpts. 100 chairs available or sit on the rocks. This concert is presented by the Island String Players Society (the Victoria Chamber Orchestra)"



I'm listening to Masala Mix on CFUV, the campus radio station at UVIC.

Sudakar just played a really nice piece by Bikram Ghosh, he's a tabla player. Highly recommended.



Interactive Linux Kernel map. Very neat, perhaps we should do one for Marsyas?

Thursday, June 26, 2008

jerk it

Download the Jerk It video by Thunderheist.







To get FLAC to compile on Mac OSX:

./configure --enable-static --disable-asm-optimizations --disable-shared

Otherwise you get a very odd error:

gcc -dynamiclib ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/libFLAC.8.2.0.dylib .libs/bitmath.o .libs/bitreader.o .libs/bitwriter.o .libs/cpu.o .libs/crc.o .libs/fixed.o .libs/float.o .libs/format.o .libs/lpc.o .libs/md5.o .libs/memory.o .libs/metadata_iterators.o .libs/metadata_object.o .libs/stream_decoder.o .libs/stream_encoder.o .libs/stream_encoder_framing.o .libs/window.o .libs/libFLAC.lax/libFLAC-asm.a/bitreader_asm.o .libs/libFLAC.lax/libFLAC-asm.a/cpu_asm.o .libs/libFLAC.lax/libFLAC-asm.a/fixed_asm.o .libs/libFLAC.lax/libFLAC-asm.a/lpc_asm.o .libs/libFLAC.lax/libFLAC-asm.a/stream_encoder_asm.o -lm -install_name /usr/sness/lib/libFLAC.8.dylib -Wl,-compatibility_version -Wl,11 -Wl,-current_version -Wl,11.0
ld: .libs/libFLAC.lax/libFLAC-asm.a/bitreader_asm.o has external relocation entries in non-writable section (__TEXT,__text) for symbols:
/usr/bin/libtool: internal link edit command failed
make[4]: *** [] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2



rescuing exceptions in Ruby.

What I needed was to find out what exception was being thrown, I did this with:

raise 'A test exception.'
rescue Exception => e
puts e.message
puts e.backtrace.inspect

Wednesday, June 25, 2008

Tuesday, June 24, 2008


Tascam FW-1804 - This is what we are using to digitize the orca recordings. I'm trying to figure out how to simultaneous record S/PDIF for our DAT drive along with 8 channels of audio from our two banks of audio cassette recorders.

I'm using orcarecord from Marsyas.

Monday, June 23, 2008


I'm working on porting SWHX to Linux, it looks like it's almost there, I got the first demo program to run.

Some other longer term possibilities for doing something like Adobe AIR, but open source are:

neash - The "neash" library provides a compatibility layer to allow haXe programs to target both neko and flash9, giving both web browser and stand-alone support. The API follows the flash9 API very closely to allow easy porting from existing code. The neko implementation currently makes use of the NME library, which in turn uses SDL.

announcing neash - A blog post.

xinf - Xinf (Xinf Is Not Flash) strives to provide a unified SVG-oriented API for graphics programming in haXe. Using Xinf, your application can run on Adobe's Flash Player (Version 9 up), our own 'Xinfinity' runtime, and (with limitations) on standards-compliant web browsers like Mozilla Firefox - from the same source code.

flash debugging trick

A little trick I learned when debugging some Flash in haXe:

I had an event callback that looked like:

function mouseDownListener (e:MouseEvent):Void {
trace("e=" +;

Which would give me the name for the object that I clicked on. It would just give me a name like "instance15" which wasn't very helpful.

It's easy to make it more readable, just set the name of the Sprite when you create it:

drag_icon = new Sprite(); = "drag icon"; // sness - For debugging, very handy.


HippoHX is a layer on top of SWHX to help with developing Flash applications on the desktop.


Sadly the creator of the CrackleBox, one of the first alternative music interfaces, has just died.



Organic Responsive Landmark - 15,371 individual fibers 65 km of fiber optics. The Cloud is located in downtown Florence just outside the Fortezza da Basso.

Sweet, I really enjoyed Florence, and this could have only have enhanced my visit.


Midify - This tiny board lets you add a MIDI port to just about anything. Can be installed directly into a GBA, GBA-SP, DS or DS Lite, or with some extra parts you can interface it with other devices.


Sunday, June 22, 2008


Women are screwing up human evolution by going out with the "Bad Boy".

I heard a really insightful analysis about why great women go out with bad guys on CBC yesterday, by a woman psychologist and writer. She said that it's because girls see all these roles layed out before them when they're growing to be a woman, these stereotyped societal roles, and just say "No!". They also see the good guy as boring, and the bad boy as exciting. I found this analysis very illuminating.

Saturday, June 21, 2008


lua - Quite an interesting new programming language.





(This week was Ruby, Javascript, Flash, haXe, XHTML/CSS and C++ for me.)

Yes, XHTML/CSS is a programming language, and if more programmers thought of it as an actual programming language, we would have a better web. is a social web site that you can submit bugs and have other people help you answer them. Very smart.


Karmetik Collective - music, robotics, software. Very cool.

Friday, June 20, 2008


I just learned about MarsyasX today from Gustavo. MarsyasX is a new version of Marsyas 0.2 that supports video as well as audio. Sounds neat.

responds to mp3

To allow a client to download an MP3 file from Rails:

First, download the mime-types gem:

gem install mime-types

Then, register mp3 as a Mime type in environment.rb:

Mime::Type.register 'audio/mpeg', :mp3

Then in your "respond_to" block, add a handler for mp3 files. Redirect the user to the location of the file you want to download.

def show_recording_audio_file
@recording = Recording.find(params[:id])
@audio_file = @recording.audio_file
respond_to do |format|
format.html # index.html.erb
format.mp3 {
redirect_to @audio_file.public_filename
format.xml { render :xml => @audio_file }

You could also send the file directly:

send_file RAILS_ROOT + "/public" @audio_file.public_filename + ".mp3"



Bokardo has an article about 5 ways to improve reputation systems which is from Boxes and Arrows, On A Scale of 1 to 5

Take aways:

1. List the behaviors you want to encourage and those that you want to discourage
2. Be transparent
3. Keep your reputation system flexible
4. Avoid negative reputations
5. Reflect reality


1. Who is doing the rating?
2. What, exactly, is being rated?
3. If people are being rated, what behaviors are we trying to encourage or discourage?

Midfield General (Official) - 'Disco Sirens'

Midfield General - Disco Sirens (Calling In Sick Remix)

Thursday, June 19, 2008


A really good blog rant by Steve Yegge called Rhinos and Tigers. One of his points that I really believe in is "Learn New Languages". The last few years I've been learning with and using lots of new languages, and it really has made me a better programmer.


The galvactivator is a glove that senses changes in skin conductivity response, which is related to your arousal level.

So cool!

I read about this when reading a paper in the Computer Music Journal by Mark Feldmeier and Joseph Paradiso called "An Interactive Music Environment for Large Groups with Giveaway Wireless Motion Sensors".


How to compile haXe.


SWHX on Linux

I've made a little progress in getting swhx running on Linux.

SWHX is a really cool alternative to Adobe AIR, and lets you make a Flash application that runs on your local machine. It works by running a Neko process that launches and controls a Flash player on your local system.

It runs on Mac OSX and Windows, but not yet on Linux.

It was a little tricky to find out how to just compile it, so here's what I learned.

First of all, install it like normal:

haxelib setup
haxelib install swhx

Then get the source code from svn on Google Code:

svn checkout swhx

Change directory into the sample projects directory and copy the 1-basic to 0-verybasic

cd samples
cp -av 1-basic 0-verybasic
cd 0-verybasic

Replace the App.hx file in there with something more recent:

// App.hx
class App {
static function main() {
// initialize ScreenWeaver HX
// create a 400x300 window with title "My Application"
var window = new swhx.Window("My Application",400,300);
// creates a remoting server
var server = new;
// create a flash object inside this window
var flash = new swhx.Flash(window,server);
// set the HTML attributes of this flash object
// activate the Flash object
// display the window
window.visible = true;
// enter the system event loop (will exit when window is closed)
// cleanup SWHX properly

Compile and run:

haxe compile.hxml
neko app.n

You should then get a box with a red square in it.

If you try to install the haXe libraries on Fedora with:

haxelib setup

you might get an error about not being found. To correct this, just symlink your /lib/ to, like this:

ln -s /lib/ /lib/

And reload your libraries with:

ldconfig -v

You don't have to download that Debian version of libpcre, they just unilaterally chose to rename libpcre as version 3 for some reason, and because so many people use Ubuntu, it's starting to creep into common usage.

Wednesday, June 18, 2008


pngwriter - A sweet little C++ library for quickly writing PNG files. Nice.


wtop is like top, but for your web server:


req/s avg min max 3xx 4xx 5xx slow
home 0.20 126 26 .........* 543 -- -- -- --
landing 12.60 62 0 @*........ 1319 1.20 -- -- 0.07
search 0.93 597 92 **........ 1764 -- -- -- --
signup 0.20 285 22 @*.......* 1415 -- -- -- --
css 1.63 9 0 #......... 294 0.40 -- -- --
image 3.40 2 0 #......... 192 0.40 0.07 -- --
js 1.63 46 0 @*........ 471 0.67 -- -- 0.03



Sketching in Code by A List Apart.

I'm a big believer in massively iterating. Start small, show people what you got, and improve. Rince and repeat.

Make sure you use a source control management tool like git, and tag the code each time you get something working, so that if you don't like the direction you went in the last couple hours (or days), you can just zip back to a previous version that worked.

I also like to do this with one host that I look at things on, and then push out the latest version to another server, so that your users can always see the latest good version, and not see your current working copy.

silver selkie

Check out my friend Katrina's website Silver Selkie Studio. She's really cool, a funky lesbian who lives up in Powell River and designs jewellery, art and fibre.

Tuesday, June 17, 2008


sproutcore - develop rich web applications with Javascript. Looks neat.



For a conference I'm thinking of going to, they want a submission in ACM proceedings style, and I'm doing it in Latex.

Some good links:

Latex Tutorial
Latex backing files - For ACM style
sig-alternate howto
latex style
ACM Proceedings templates


For a conference I'm thinking of going to, they want a submission in ACM proceedings style, and I'm doing it in Latex.

Some good links:

Latex Tutorial
Latex backing files - For ACM style
sig-alternate howto
latex style
ACM Proceedings templates

victoria jazz

You can get tickets for concerts at the Victoria Jazz Fest at:

Ticket Outlets - Jazzfest International

Suite J, 727 Johnson St.
(250) 388-4423
Toll Free 1-888-671-2112

726 Yates St.
Service charges may apply
All prices include GST
No refunds or exchanges

Royal Theatre & Tourism Victoria Visitor Info Centre
Charge by Phone 386-6121
Toll Free 1-888-717-6121



Monday, June 16, 2008



Tomorrow is Firefox day! Please download Firefox and help set a world record.

Here's a Field Guide to Firefox 3.


tzosdclock is a cute little OSD (on-screen-display) clock for Linux.


I just signed up for github. I'm going to try hosting a project on there, to see how it goes. Most of my projects are at SourceForge, but I like that github supports git so well. I've got no huge problems with svn, but I do think that git is better tech.

utc migrations

Interesting, in the latest version of Rails, the migrations are now in UTC, not a simple series of incrementing integers.

Less likely to conflict, but less pretty.


Stephen Travis Pope websites:

HeavenEverywhere Music
FASTLab Inc.



New presentation software called multitalk.

Friday, June 13, 2008


I'm going to be using Discrete-Event System Simulation in a course in the fall. Sounds neat!

Thursday, June 12, 2008

static types

Damien Katz had an eiphany about static types. Some great comments.


Object-Oriented Reengineering Patterns collects and distills successful techniques in planning a reengineering project, reverse-engineering, problem detection, migration strategies and software redesign.

Available as a free PDF as well, nice.


Yesterday Gregor Kiczales came to give a talk in the Computer Science department here at UVIC. It was the talk he gave at OOPSLA last year, and was just fascinating.

He talked about Lucy Suchman, and how her research goes into sociological analyses of user interfaces, and I really connected with those ideas. I really need to read her book Human-Machine Reconfigurations, the small excerpts that he presented resonated strongly with the way I view the world.

He also talked about Brian Cantwell Smith and his book On the Origin of Objects. Some interesting ideas here as well, I was reminded strongly of semotics, with signs and signifiers, and how meaning is constructed by each of us.

He also talked a bit about Aspect-Oriented Programming, objects and Mylyn.

Too bad that it's all in Java, I've done some large projects with Java, and I just don't find it a very satisifying environment to work inside. I much prefer something like Ruby or Python, and I've been having a lot of fun with ECMAScript languages, like haXe, Flash and Javascript.

Tuesday, June 10, 2008


I was using tzosdclock for displaying the time in the corner of my screen. It uses xosd.

I used it in my .lircrc like this:

button = Back
prog = irexec
repeat = 0
config = /usr/sness/bin/tzosdclock -fn '-*-helvetica-bold-r-normal-*-34-*-*-*-*-*-*-*' -tc black -oc white -ft "%I:%M %p" -ha right -os 10
config = killall -9 tzosdclock

This worked great, but I found that I was limited by the fact that I couldn't use large truetype fonts, so I switched to urxvtc running a little Ruby program:


date ="%I:%M %p")
printf "#{date}\r"
sleep 30

And started it on startup with

eesh -e "goto_desktop 3"
eesh -e "goto_area 1 0"
urxvtc -fn "xft:Bitstream Vera Sans Mono-100" -geometry 8x1-0+0 -bl -b 3 +ptab -rv -e sh -c 'clockr.rb'

Which worked even better. Now I just switch to that desktop, which has aumix in text format, and the clock, and looks like this:


We got talking about Karlheinz Stockhausen today at work. I remember reading some of his works when I was at Pearson College, and listened to a number of his works.

I'm now looking for a series of essays he wrote on electronic music, if anyone has any pointers, leave them in the comments below.


E.coli make a big evolutionary leap to metabolize citrate. A really neat little story.

marsyas making waves

Marsyas, the framework that I'm working with to do Music Information Retrieval is being used by Charlotte Curtis in her Google Summer of Code project. Check out her blog posts about it.

audacity label tracks

Label Tracks in Audacity. Will be the model for a new Flash application I'm creating.


Right beside my desk is:

The mixman dm2. I have it hooked up to my Linux box. Sweet.


A woman marries the Eiffel Tower. Hmm, perhaps I should marry Emacs.

Monday, June 09, 2008


280slides - Cool web based presentation software.


Rev - is an event library for Ruby, built on the libev event library which provides a cross-platform interface to high performance system calls . This includes the epoll system call for Linux, the kqueue system call for BSDs and OS X, and the completion ports interface for Solaris.

Not quite cross-platform enough, but very cool nonetheless.


ctheory - "One of the three leading intellectual electronic reviews in the world..."
-Le Monde


REST - The short version


flash audio - sample exact

bead sort

Bead sort - using physics to solve sorting problems in O(sqrt(n)) time. Wonder if it could be done quantum mechanically in O(1) time?

16th tones

The Carrillo Tone Piano is a recording with a prepared piano that can play a scale with notes separated by 1/16th tones.

flash audio

I'm writing some Flash9/haXe code to generate audio on the fly in Flash.

This one blows my mind, a TB-303 implemented in Flash. And it sounds kick-as.

How cool is audio programmming?
Play the tiny drum machine!
how to make actionscript 3 play generated pcm wave data
Dynamic Sound in Actionscript 8.5 - from Robots w/Lasers

markov and semiotics

Sunday, June 08, 2008


A very funny Firefox plugin : - This plugin will alert you if you accidently stumble onto, and take you back to the site you came from.


zsh sleep and background

To sleep for 2 hours and then rsync a file to the server, so that it'll upload after I go to bed, in zsh:

(sleep 2h && rsync -avP file.avi n:./) &


A great screencast of the new features in Firefox 3. Firefox 3 has some very cool new features.

Friday, June 06, 2008

hide gmail header

Stylish is a great plugin for Firefox that allows you to change the appearance of websites.

What I needed it for was to autohide the Gmail header, with the new "Google Labs" link, it overflowed onto two lines on my small screen with my large fonts.

Dual x0xb0x Demo

x0xb0x Mod Final Prototype Video 1

The making of x0xb0x

MIREX 2008

MIREX 2008 - Music Information Retrieval Evaluation eXchange (MIREX 2008).



My little Cantillion Flash application is starting to become a real program, it now needs a Menu Bar for all the commands.

I'm going to be implementing this in pure haXe/Flash, toolkits are for the weak. lol.

Thursday, June 05, 2008



Quick guide to Servo motors

safe fonts

5 salts


no photoshop

Why 37signals doesn't use Photoshop.


yeti is an ML style functional programming language, that runs on the JVM.

Neat and wacky!



Not sure if I should use:

Ruby on Rails
GNU microhttpd

For the new project I'm working on.

Rack: a Ruby Webserver Interface
Rack docs

I'm going to start with Rails, and then hopefully go with microhttpd.


GNU libmicrohttpd is a small C library that is supposed to make it easy to run an HTTP server as part of another application.

Wednesday, June 04, 2008


FT232R - The Serial to USB converter that is on my Ardunio board.

It's going to be very interesting to compare the Make Controller and the Arduino controller. The Make Controller has built in Ethernet (and USB) and talks via OSC, and the Arduino is simpler and just talks via USB. The Arduino is less than half the cost as well.

I think they both rock.

rock on

I just got my Make Controller Kit to turn on it's LEDs with Linux.

One thing they don't mention very prominently is that mchelper doesn't work with USB mode under Linux. You need to use Ethernet to control it instead.

This seems to be due to no support for USB CDC. Hopefully someone fixes this soon.



I just got some code running on Linux that reads the output of the Radiodrum alternative music controller. It reads data right from the MIDI port, /dev/midi1 and outputs the values to stdout.

#include <sys/soundcard.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

#define MIDI_DEVICE "/dev/midi1"

int main(void) {
unsigned char message[4];

int byte1, byte2, byte3;
float s1x, s1y, s1z;
float s2x, s2y, s2z;

int s1whack;
int s2whack;

// first open the sequencer device for reading.
int seqfd = open(MIDI_DEVICE, O_RDONLY);
if (seqfd == -1) {
printf("Error: cannot open %s\n", MIDI_DEVICE);

// now just wait around for MIDI bytes to arrive and print them to screen.
while (1) {
read(seqfd, &message, sizeof(message));

byte1 = message[0];
byte2 = message[1];
byte3 = message[2];

s1whack = 0;
s2whack = 0;

if ((byte1 == 160)&&(byte2 == 1)) {
s1whack = 1;
if ((byte1 == 160)&&(byte2 == 8)) {
s1x = byte3 / 128.0;
if ((byte1 == 160)&&(byte2 == 9)) {
s1y = byte3 / 128.0;
if ((byte1 == 160)&&(byte2 == 10)) {
s1z = (byte3-14.0) / 128.0;
if ((byte1 == 160)&&(byte2 == 2)) {
s2whack = 1;
if ((byte1 == 160)&&(byte2 == 11)) {
s2x = byte3 / 128.0;
if ((byte1 == 160)&&(byte2 == 12)) {
s2y = byte3 / 128.0;
if ((byte1 == 160)&&(byte2 == 13)) {
s2z = (byte3 -14) / 128.0;

printf("%f %f %f\t%f %f %f\n",s1x,s1y,s1z,s2x,s2y,s2z);




query variables in haXe

This one took me quite some time to research:

What I wanted to do was to have a way to pass a variable in a haXe script that I'm compiling down to Flash 9. There are a bunch of ways to do it, but the one that fit my needs the best was FlashVars.

To pass in a variable into your haXe/Flash script, you just need to either embed the parameters at the end of the URL, like this:

<embed src="testpassvariables.swf?test1=la">

Or use the FlashVars variable name, like this:

<embed src="testpassvariables.swf"

You then access this variable in your haXe/Flash script with:

trace("p=" + flash.Lib.current.loaderInfo.parameters.test1);

If you are running in the standalone Flash player, it doesn't look like you can pass in FlashVars, so you need to do something like:

if (flash.Lib.current.loaderInfo.parameters.test1 == null) {
trace("standalone and undefined");


Flare from prefuse is an amazing animation library built on Flash. This link about Fizix might be useful in getting it running with haXe.

Tuesday, June 03, 2008



Converting MIDI to Hertz and back again.


Neumes are the basic elements of Western and Eastern systems of musical notation prior to the invention of five-line staff notation. The word neume is a Middle English corruption of the ultimately Greek word for breath.


Paradigmatic analysis is the analysis of paradigms embedded in the text rather than of the surface structure (syntax) of the text which is termed syntagmatic analysis.

Monday, June 02, 2008



Expressivity in Music and Speech


This conference is where a paper I'm helping with is going to be presented.

Sunday, June 01, 2008