Transcribing Piano Rolls, the Pythonic Way

What this guy does with Python is just amazing:

> Piano rolls are these rolls of perforated paper that you feed to the saloon’s mechanical piano. They have been very popular until the 1950s, and the piano roll repertory counts thousands of arrangements (some by greatest names of jazz) which have never been published in any other form.
> In this post I show how to turn into playable sheet music with the help of a few lines of Python. At the end I provide the sheet music, a human rendition, and a Python package that implements the method (and can also be used to transcribe from MIDI files).


With any luck, one day in the not too distant future, something like [Dat][] will be interesting to humanists. What is Dat? Dat is “an open source project that provides a streaming interface between every file format and data storage backend.”


Sagan on Humans

There will be no humans elsewhere. Only here. Only on this small planet. We are a rare as well as an endangered species. Every one of us, in the cosmic perspective, precious. If a human disagrees with you, let him live. In a hundred billion galaxies, you will not find another.

Roy Blount’s Review of “Confederates in the Attic”, circa 1998

Roy Blount's Review of "Confederates in the Attic", circa 1998

Roy Blount’s Review of “Confederates in the Attic”, circa 1998

My one-book-down-more-to-go purge continues, but now in my campus office. I came across this review of _Confederates in the Attic_ written by Roy Blount and published in the _New York Times Book Review_ on 5 April 1998. (And here’s the PDF version, which has been OCRed and is searchable … because all PDFs should be.)

Sagan on Books

A book is made from a tree. It is an assemblage of flat, flexible parts (still called “leaves”) imprinted with dark pigmented squiggles. One glance at it and you hear the voice of another person, perhaps someone dead for thousands of years. Across the millennia, the author is speaking, clearly and silently, inside your head, directly to you. Writing is perhaps the greatest of human inventions, binding together people, citizens of distant epochs, who never knew one another. Books break the shackles of time ― proof that humans can work magic.

Lessig in Louisiana

For those readers looking for the original version of this note: the revision captures my thinking after having more time to digest. If there’s anything in the earlier version to which you particularly want access, email me and I’ll send you a copy.

Today’s talk by Lawrence Lessig at the ABiz 50 luncheon was interesting, and by interesting I mean I haven’t quite figured out what to make of it.

I should begin by thanking the ABiz people for allowing me to attend the talk for free: tickets were $50 a plate, and while I dithered over spending that kind of money, the event sold out. Robin Hebert of ABiz set up a will call ticket for me to sit in the peanut gallery.

I got to the Cajundome Convention Center early, to ensure my place, but I need not have worried: I was one of only 4 people who ended up occupying the 20 chairs set out. It seemed odd to me not to see any press there: the ABiz luncheon, from a brief glance at the seating charts they had posted at the entrances to the ballroom was something of a who’s who in the Lafayette business community. (And given some of the striking things that got said, it seems to me it would have been rich pickings for headlines and pre-commercial break teasers. But what do I know about modern media?) One of my compatriots nodded at an empty table, and wondered why we couldn’t sit there. I didn’t feel like incurring the wrath of the organizers, but it was odd to watch the empty table get served food throughout the luncheon. (This bit of needless classism, whether it was intended or not, was also reflected in the two separate entrances for the event: one for CEOs and VIPs, and one for everybody else. Really? 250 people and you need to segregate folks? Lafayette ain’t that big: what is with our love of being big fish in a small pond?)

I confess to largely being ignorant about ABiz, but it was am impressive crowd. If my math is correct, there were at least 250 people in that room. Good for them. The program got started around 12:30 with two awards for local businesses that had achieved some measure of success that I didn’t quite catch. And then, then it got weird. The emcee then introduced a third person who was to speak just before Lessig, the superintendent of the local school system. (Quick sidenote here: the local superintendent is facing an investigation instigated by a subset of the school board, who have so far been unwilling to reveal what they want investigated or why.) The superintendent appears well liked by the business community, and he made a pitch for moving forward no matter the distractions.

But here’s where it got weird. The superintendent went out of his way to note that while the children of those present in the room may not attend public schools, 80 percent of the people in the city did/do attend public schools. And they need to be trained to be ready to join the workforce. He didn’t say anything about turning out the next generation of leaders or innovators. He talked about workers. What it felt like he said was Listen, your kids don’t go to the prole schools, but they are going to have to mix with the proles, because, you know, they’re out there, and the proles need jobs, so we need to attend to this prole education business.

It was weird. And unnecessary. But yet he clearly felt like that’s how you had to frame public education to Lafayette’s business community, or, perhaps even the community’s business elite. And that was kind of the setup for Lessig, and, in a strange way, it was kind of the right setup. Lessig’s focus, as many will know, is on the corrupting influence of money on the American political system. His argument is that the private funding of public campaigns has created a system in which politicians spend more time raising money than they do governing. That’s not good.

But the way Lessig began the talk was with a brief history of voting rights for African Americans, ending with the particular Texan innovation of creating a whites-only primary followed by an open general election. He had a terrific quotation from another scandalous moment in American history, the Tammany Hall scandal, where William Tweed was once heard to say: “I don’t care who does the voting so long as I get to do the nominating.” Lessig’s observation is that we now live in a green-only nominating system, green of course being the color of money.

But I don’t know that his audience was fully over the comparison to African Americans. It didn’t seem to sit well in the room — from my vantage point, I only saw one African American attending the luncheon, every other African American in the room was Cajundome staff manning gear or catering staff serving meals. Awkward. And it didn’t get better as he brought his history up through the civil rights era: when he flashed the photos of protesters, all I could think was were people in the room seeing brave souls seeking justice or Ferguson?

To my mind, Ferguson weighed more heavily in the room than anyone would want to admit. The scenes of disorder, no matter their causes, are not something the establishment in Lafayette wants to think too much about. And I don’t know that it’s really a matter of race so much as class (and goodness how those two things are intertwined). The school superintendent argued for workers: he argued for the status quo. Lessig’s talk hedged at potential change. There was polite applause at the end, but that was all.

There was no question and answer period, which may be a function of the limited time allotted for a luncheon, but there was a book signing. I grabbed a copy of the book — $18! for a paperback! — and didn’t have to wait long to get the book signed: people were not lining up to talk with Lessig at all, and, to be honest, he didn’t appear interested in talking with people. I introduced myself, and I got a polite nod. I added, “We corresponded by email.” No response. I added that I’d like the book inscribed for my daughter, who was ten years old — Lessig had ended his talk by referencing his own children, one of whom is also ten — and hoped for a human connection. Blank look.

Maybe he was tired. Maybe the talk’s reception had put him off. Maybe the weirdness with the school superintendent, or something said at his table, disquieted, or quieted, him. I don’t know. Maybe his celebrity status has changed the way he interacts with people: maybe people like me are just proles in his eyes. We don’t produce ideas; we just consume them: so here’s your book, full of my ideas; move on.

And that’s where the weirdnesses converged and left me disquieted. Lessig is himself now firmly a celebrity as well as a member of the institutional elite. His background — a BA from Penn, an MA from Cambridge, and a JD from YAle — suggests he may have long been a part of the elite. And while I appreciate his willingness to disassemble the current power structures, even his commitment, he’s also part of the problem. He’s a bright guy, perhaps even a brilliant man, but he’s also lucky. Lucky in many, many ways. But like many successful men and women, he seems to have forgotten that luck had anything to do with his success. Saying this does not detract from the hard work any successful person has put in, but it does remind us that for every one lucky soul, there are hundreds or thousands of equally hard working, perhaps working even harder, souls who will not get lucky.

And, dammit, Lessig spent enough time thinking about culture to know this. The simultaneity of so many inventions should have revealed at least that much to him. He should know that luck plays an amazing role in who gets credit for something a lot of people imagined, perhaps even made, but not in front of the right people.

And, too, I think that talking about luck would have been one way to reach his audience better. Love, yes, but luck. We all need to be reminded that “there but for the grace of God, go I.” (The guy from the Ville Platte metal shop who won the first award seemed astonished still by his luck.)

I’m glad the ABiz folks brought Lessig to Lafayette. Their effort was, I hope, not lost, but I think our speaker missed some opportunities to tune his talk to his audience. My sense is that, like a lot of celebrity speakers, there’s a kind of fixity to the talk that to my mind diminishes the public performance of it: in this day and age, one could watch it on YouTube — Lessig said as much during his talk. The purpose of appearing before a live audience, a different audience, for an actual performance is to try to seize the opportunity to connect with them.

That particular failing is not ABiz’s fault. They tried. And perhaps Lessig tried. We all need to do more, I think, to bring in outside perspectives. ABiz is to be commended for trying. Lafayette needs more fresh ideas, more fresh perspectives. We are far too content with congratulating ourselves on what a splendid city we live in, how good the food is, how good life is, how lucky we are to live in a city like Lafayette. We all know people who talk about themselves like that. And we generally avoid them, because either they are narcissists (which Lafayette does seem to love) or they are making up for a whole host of issues (or both) which makes dealing with them more trouble than it’s worth.

Here’s the thing: the outside perspective is already here. It lives among us. As my own work has proven to me, and I hope to others, time and again: there are remarkable engines of creativity and leadership living among us, if we would but give them the time of day, give them some luck.

Imperial Measurements

[rnelsonee offered the best explanation][r] of the imperial measurement system I have ever read:

> Imperial is similar to metric if you constrain yourself to one type of measurement. Like liquid volume uses power of 2 instead of 10:

1 dram x 2 ** 2 = 1 Tbsp
1 Tbsp x 2 = 1 fl oz
1 fl oz x 2 = 1 jig
1 jig x 2 = 1 gill
1 gill x 2 = 1 cup
1 cup x 2 = 1 pint
1 pint x 2 = 1 quart
1 quart x 2 ** 2 = 1 gallon

[*The notation “2 ** 2” should be read as “two squared [that is, 4] or “two to the second power.*]

> But then Imperial gets all weird because entire different scales get mixed together. For example, a mile isn’t a terrible unit – it’s just a thousand paces (hence miles), and is more intuitive/easier to measure (when walking) than km. I like the foot and inch (thumb size) as well, even though people obviously have different sized feet (but hey, it’s not like the meter is easy to recreate with no tools). But no one has any business mixing inches and miles (at least they didn’t 1,000 years ago) because you’d measure troop movements in miles and your dick in inches. It wasn’t until we started doing a lot of ‘extreme’ levels/measurements with physics that we needed metric to easily convert between the two scales.

Of course, this was after this:

from Josh Bazell's "The Wild Things"

from Josh Bazell’s “The Wild Things”

And then this:

Imperial versus Metric by Bar Graph

Imperial versus Metric by Bar Graph