mission.japan

Midnight coding

Monday, January 22, 2007

Matt asked last week if I could put something together to help his shakuhachi-making hobby.

Specifically what Matt wanted was a way to plot out the nodes along a particular piece of bamboo to see what the aesthetics would be like when the holes were drilled. Apparently you can have a shakuhachi that plays fine but doesn’t have the right appearance, which is why searching for just the right stalk of bamboo can be a time-consuming, laborious process.

I started turning the problem over seriously in my head last Thursday and came to the conclusion that a) it was a simple thing that could be knocked out in a few hours with, at the most, some JavaScript, and b) if I didn’t do something about it I wouldn’t get much sleep anyway. I have this really bad tendency to not be able to stop thinking about things when I’m supposed to be falling asleep, particularly new programming problems. Routine tasks don’t keep me awake, but new problems that need a solution always do.

So despite knowing I would regret it the following day I stayed up all night to come up with shakuhachi.deltafour.net, which Matt says works great. In all it took six and a half hours (starting at midnight) from start to finish. I had most of the JavaScript snippets I needed from a prior project, so the lion’s share of the time went to figuring out the CSS positioning and then slicing up a photo of a real shakuhachi to give a more realistic plot. Fortunately IE7 has improved CSS support, so I didn’t have to do much of anything to make it work there once I had it finished in Firefox. Standards-compliant, too—XHTML Strict and CSS.

Comments

David Schaab wrote on January 23:

Maybe I’m dense – the only thing I see changing is the picture – simply cuts off the bottom if I reduce the length. I was thinking I’d see calculated results but then maybe I’m doing something wrong.

Derek Schaab wrote on January 26:

It doesn’t really calculate anything per se—you have to measure out the length and the positions of the nodes and holes. It takes that data and builds an image of approximately what it should look like when it’s done.

Using this after you’ve drilled the holes (and committed yourself to a particular set of measurements) is pointless. But it does come in handy if you have a stalk of bamboo ready to drill and are wondering if taking a bit off of one end or another might improve the aesthetics.