Category Archives: computers

Music Hack Day

Andrew Bridy, Lalit Jain, Ben Recht and I spent the weekend in Cambridge at Music Hack Day, organized by the Echo Nest and sponsored by just about every company you can think of that cares about both music and technology.  We hacked in a somewhat different spirit than most of the folks there; for us, the Million Song Dataset isn’t a tool for app-building, but a playground where we can test ideas about massive networks and information retrieval.

(Re app-building:  Bohemian Rhapsicord.  Chrome-only.)

We’ve actually been playing with the MSD for a few weeks, and I’ll probably post some of those results later, but let’s start with what we did this weekend.  We wanted to see what aspects of the rules of melody we could find in the dataset.  Which notes like to follow which other notes?  Which chords like to follow which other chords?  If you took piano lessons as a kid you already know the answers to these questions.  Which is kind of the point!  When you start to dig into a giant dataset, the first thing you’d better do is check that it can tell you the things you already know.

We quickly found out that getting a handle on the melodies wasn’t so easy.  The song files in the MSD aren’t transcribed from scores, and they don’t have notes:  there’s pitch data, but it’s in the form of chromata; these keep good track of how the energy of a song segment is distributed across frequency bands, but they don’t necessarily correspond well to notes.  (For instance, what does the chroma of a drum hit sound like?)  We found that only about 2% of the songs in the sample had chromata that were “clean” enough to let us infer notes.

But here’s the good thing about a million — 2% of a million is still a lot!  Actually, to save time, we only analyzed about 100,000 songs — but that still gave us a couple of thousand songs’ worth of chroma to work with.  We threw out all the songs Echo Nest thought were in minor keys, and transposed everything to C.  Then we put all the bigrams, or pairs of successive notes, in a big bag, and computed the frequency of each one in the sample.  And this is what we saw:

Pretty nice, right?  The size of the circle represents the frequency of the note.  C (the tonic) and G (the dominant) are the most common notes, just as they should be.  And the notes that are actually in the C-major scale are noticably more frequent than those that aren’t.  The arrow from note x to note y represents the probability that the note following an x will be y; the thicker and redder the arrow, the greater the transition probability.  These, too, look just as they should.  The biggest red arrow is the one from B to C, which is because a major seventh (correction from commenter: a leading tone) really wants to resolve to tonic.  And the strong “Louie Louie” clique joining C,F, and G is plain to see.

Once you have these numbers, you can start to play around.  Lalit wrote a program that generated notes by random-walking along the graph above: the resulting “song” sounds kind of OK!  You can hear it at the end of our 2-minute presentation:

Once you have this computation, you can do all kinds of fun things.  For example, which songs in the database have the most “unusual” melodies from the point of view of this transition matrix?  It turns out that many of the top scorers are indeed songs whose key Echo Nest has misclassified, or which are in keys (like blues scale) that Echo Nest doesn’t recognize.  There’s also a lot of stuff like this:

Not exactly “Louie Louie.”  Low scorers often sound like this Spiritualized song, with big dynamic shifts but not much tonal stray from the old I-IV-V (and in this case, I think it’s mostly the big red I-V)

A relevant paper:  “Clustering beat-chroma patterns in a large music database,” by Thierry Bertin-Mahieux, Ron Weiss, and Daniel Ellis.

Here I am talking linear algebra with Vladimir Viro, who built the amazing Music N-gram Viewer.

DSC_0179 by thomasbonte, on Flickr

Note our team slogan, a bit hard to read on a slant:  “DO THE STUPIDEST THING FIRST.”

Tagged , , , , , ,

Living in the past

CJ and I played Galaga last night.  Galaga is great.  When those spaceships go off the bottom of the screen, except they haven’t quite gone all the way off the bottom of the screen, and then they curl back up and destroy you — that is classic.

Another thing I cannot deny still liking is “Living in the Past,” by Jethro Tull.

And here is Galaga.  I was surprised to find I still knew the background music by heart, after all these years.

Tagged , , ,

Living in the future

I just learned that my father orders his breakfast cereal from Amazon.

Tagged ,

Under the bridge

CJ:  “Trolls are not nice.”

Me:  “That’s true, but they aren’t real.”

CJ:  “Some trolls are real, they are on the computer and they start flame wars.”

 

Austin Grossman’s new novels: soon they will be available

The very first post on this blog was about Austin Grossman’s first novel.  Good news:  he just signed a deal for two more! The first one, You, is about computer games.  The second, Crooked, is a supernatural thriller about Richard Nixon.  I haven’t been this excited since they filmed both Back to the Future sequels at the same time.

Tagged , , , , ,

Ngrams: one more way to win an argument using Google

I thought I’d never see a definitive answer to this one, but thanks to the brand-new Google NGrams Viewer, the facts are clear:

It is “another think coming,” and it has always been “another think coming.”

A lot of words and phrases (though not these) show a dip starting in 2000 or so.  I wonder if the nature of the corpus changes at that point to include more words?  You see the same effects with name frequencies — the frequency of any given name has been decreasing over the last twenty years, just because names are getting more and more widely distributed; the most popular names today take up a smaller share of namespace than much lower-ranked names did in the 1950s.  A quick and dirty thing to check would be the entropy of the word distribution; is it going up with time?

Lots of good ngram examples on Tom Scocca’s blog, here and here.

Oh, and here’s the Four Shortstops:

Ripken, appropriately, is showing great staying power.

Tagged , , , ,

Partha Niyogi has died

I’m sorry to report that Partha Niyogi of the University of Chicago died last week, at 43, from brain cancer.  Partha gave a beautiful lecture at UW last spring as part of our MALBEC series on machine learning.  My description of his work in the linked blog post is inadequate; here’s his paper with Smale and Weinberger from which his talk here was drawn.

 

 

Tagged ,

Robert Siegel said my name

I was on All Things Considered today, talking a bit about compressed sensing. They let me tell the syphillis story that didn’t fit in the Wired article. The radio broadcast has come and gone, but you can still hear it at NPR’s website. Laura Balzano made the audio demo; for more explanation and more cool demos, see her page.

Update: I just listened to the piece.  Sorry for the inaccurate title:  Art Silverman, not Robert Siegel, said my name.

Tagged , , ,

“The rest of the world was uncertain what had been proven and what not.”

Until a minute ago I had never heard of Mizar, a project to record as much mathematics as possible in computer-readable form.  The pieces of this project are published in the Journal of Formalized Mathematics.  Here, for instance, is the paper “Non-negative Real Numbers, part I.”

I learned about Mizar when glancing through the publicly available archive of QED, a mailing list from the early 90s devoted to the formalization of mathematics.  It’s interesting to be reminded just how excited people were about the prospects of computerizing large precincts of mathematical practice, an ambition which as far as I can tell has now receded almost entirely from view.

I found the QED archive, in turn, via Math Overflow, which quoted these pointed remarks of Mumford about algebraic geometry in the Italian style:

The best known case is the Italian school of algebraic geometry, which produced extremely good and deep results for some 50 years, but then went to pieces. There are 3 key names here — Castelnuovo, Enriques and Severi. C was earliest and was totally rigorous, a splendid mathematician. E came next and, as far as I know, never published anything that was false, though he openly acknowledged that some of his proofs didn’t cover every possible case (there were often special highly singular cases which later turned out to be central to understanding a situation). He used to talk about posing “critical doubts”. He had his own standards and was happy to reexamine a “proof” and make it more nearly complete. Unfortunately Severi, the last in the line, a fascist with a dictatorial temperament, really killed the whole school because, although he started off with brilliant and correct discoveries, later published books full of garbage (this was in the 30’s and 40’s). The rest of the world was uncertain what had been proven and what not. He gave a keynote speech at the first Int Congress after the war in 1950, but his mistakes were becoming clearer and clearer. It took the efforts of 2 great men, Zariski and Weil, to clean up the mess in the 40’s and 50’s although dredging this morass for its correct results continues occasionally to this day.

Readers with good memories will recall that this is the second time I’ve quoted uncomplimentary remarks about Severi.

Tagged , , , , ,

Compressed sensing in Wired

My new Wired piece, about compressed sensing, is now online. For a more technical but still gentle introduction to the subject, see Terry’s blog post.

Update: Igor at Nuit Blanche has a great post clarifying what kind of imaging problems are, and aren’t, currently susceptible to CS methods.

Tagged , , ,
%d bloggers like this: