Coming out of Hibernation

I think as spring approaches I’m starting to get ambitious again.

I have two personal coding projects going. Both of them are sound-based (my current obsession) and at least one should be released open-source in the next month. The other is a bit more long term since I’ll be needing to learn quite a bit of math to make it happen.

Besides code, I’m also working on getting my basement workshop fully setup (only took 4 years!). I now have 3 workbenches, two of which I built myself based on plans from Make Magazine. I also have all the wood to build one final workbench for organizing out laundry.

The general situation is still a god-awful mess, but I’m slowly working through it. Tomorrow I hope to mount my drill press and jig saw. I probably won’t mount my chop saw - I intend to make a rolling cart for it at some point. Once my big tools are out of the way I need to mount a few sheets of peg board and get the rest of my hand tools organized.

I don’t think I would have gotten started on the basement had I not had a project in mind. The project in question is to use my neophyte woodworking skills and somewhat more advanced electronics skills to build a pair of custom XBox 360 joystick controllers. This was mostly driven by my current obsession with Street Fighter IV, but also out of a desire to have a good set of controllers for the kids to use (normal controllers are WAY too big for them, and probably will be for years to come).

Now that all of my electronic parts are on the way the pressure is on for me to get started on the enclosures - but to do that I need to have a decent work area setup, hence the frenzied activity to clean up my basement!

On an entirely unrelated note (except that it does seem to tie into my recent mental re-awakening) just tonight I finally fixed our upstairs toilet. I ended up removing every single moving part and replacing them all. The end result seems to work perfectly so far.

Oh, and a couple of days ago I learned how to slice a kiwi. Even though I don’t care for them, I did find peeling and slicing oddly fun. I think the novelty of it is what made the task so enjoyable. You see, since a kiwi’s skin is both tough and a little stretchy you can use a spoon to peel them in a melon-baller-like fashion.

Eating the Elephant

They say that the way you eat an elephant is one bite at a time. For me this is a kind of mental pacifier for when big project starts wigging me out. The real secret though is looking up on occasion to make sure you still eating the elephant you want!

All too often I’ll get deep in the trenches in a project and not take enough changes to pop my head up and make sure what I’m building is really the optimal solution. All too often you’re munching down on elephant and realize you’re really in the mood for some water buffalo!

Breadcrumbs

Just a small observation. For me, motivation is a kind of natural resource. It ebbs and it flows, yet I actually need a measured amount of it every day. Any little trick I can find to bury little nuggets of motivation is a good thing.

Recently I’ve found that I can spend a few minutes at the end of day leaving myself breadcrumbs - obvious things to to do - and they seriously help me get started the next day. I also find that this works best if I leave myself the kind of work I am supposed to do the next day. For example if I’m supposed to be spending the next day debugging, I’ll leave myself a nice juicy, easy to fix bug.

On Seemingly Obsolete Technology

Recently I’ve been working  a cool little audio API for ActionScript 3 that lets you load and manipulate audio in some pretty powerful ways that were impossible before Flash Player 10. One of the things I really wanted to add was adjustable playback speed - where I could stretch the virtual “tape” to make sounds last longer or smoosh it together to speed up. The problem was I wasn’t really sure how in the heck I would do that with PCM audio data. I mean the simple cases, twice as fast and half as slow are easy, you either double up each sample or skip every other sample. But what do you do about all of the other cases?

This is where an old “obsolete” book I own (it came with a 3 1/2″ floppy disk and touts that it’s for the new Pentium and 486s!) jumped up and made itself very, very useful. The book, by Michael Abrash, is about graphics techniques for computers that were modern about 15 years ago. You wouldn’t think a lot of information in such a tome would apply these days - but in fact, that’s where I found my solution!

Since with the audio data I’m working with discrete units of both sound and time I could think of my playback line as a sort of pixel display - like a monitor. In thinking about the problem in this manner I realized that a good, fast line drawing algorithm would solve my problem perfectly . That when I remembered that the old Abrash book contained a detailed chapter on drawing lines quickly.

I had read through that chapter many years ago and  I clearly remember that even back then (I think I was still a teenager at the time!) I found one algorithm, Bresenham’s, to be really impressive. It isn’t the best algorithm in terms of the “prettiness” of the line, but it’s lightning fast due to the fact that it only uses integers and requires absolutely no divides. 

Sure enough after a few hours of hacking I was able to use this old line drawing algorithm to allow me to manipulate the playback speed of audio! Here, here for seemingly obsolete technology that saves the day!

How Logical…

Patti and I are both pretty logical people. I mean, we’re programmers so it comes pretty natural at this point. Now I think that more formal method of thinking is starting to rub off on the kids.

I’m starting to see our oldest son apply logic and given that he just turned 3, I’m pretty damn impressed. For example, I told him tonight that next week I would be going to San Francisco and so he wouldn’t see me until Friday. Usually he sort of shrugs these things off, but tonight he got very, very upset and kept saying that HE wanted to go to San Francisco with me. He even managed to turn around the tenses at one point and say “I’m going to San Francisco and you are coming with me!”.

The part that blew my mind is when he stuck a couple of pieces of knowledge together like so: San Francisco is far away (he knows this because we recently got him a map to show him all of the places Patti and I travel to along with where all of our friends and family live - it was very handy when Patti was traveling a few weeks ago, let me tell you!). Because San Francisco is far away we need to take the car. Because we need to go outside to get to the car, we need our coats.

The result of this is that when I thought Kai was done throwing a fit he was instead planning our trip and immediate departure. He popped up next to me a second later, coat and hat in hand telling me to put it on him and to get the car keys… we were going to San Francisco! Wow.