Red Echo

April 5, 2010

The 24LC256 is a 256K EEPROM chip with an I2C interface (two-wire serial). Up to eight can be used on a single bus, and each chip costs $1.18 at Digikey.

April 2, 2010

interesting link: some audio mixer circuits, with a somewhat rambly but informative explanation of the role op-amps play in signal isolation.

My other electronics project lately has been a piece of hardware that encapsulates the rhythm algorithm I was working on a couple of weeks ago. The algorithm works surprisingly well, and I think it would make the essence of a great live performance tool. My concept so far is an Arduino-based black box that accepts a MIDI time signal and broadcasts MIDI note messages: a procedural sequencer which leaves the generation of sound signals to an actual drum machine.

I’m still thinking about the front panel layout, which will likely feature a lot of encoders and LED seven-segment displays, but I’ve started working on the MIDI implementation. My in and out circuits are based on this design [see P.P.S.] and my thru circuit is the MIDIbox design. It looks simple, but I’ve never done this before, so I want to take each step individually.

postscript: It works! I have a prototype board set up with MIDI in/out/thru ports one one side, and Vcc/GND/RX/TX on the other. The parts involved, which cost $5.20 from Digikey, are as follows:

Post-postscript: The link to the I/O circuit has gone dead since I wrote this, but I’ve since found the official MIDI electrical specification, a complete schematic for a reference MIDI interface implementation.

My new soldering iron arrived yesterday, so I finished up one of the LED glow poi I’ve been making for Ava. I did a little experimentation with the accelerometer, and determined that poi experience pretty high G-forces: even at the accelerometer’s 6-g maximum setting, it was easy to peg the maximum. This makes it easy to tell when someone is spinning the poi, but it means the influence of gravity is lost in the noise. I’ll have to use some clever math to determine rotation speed. In the meantime, some straightforward PoV code gives a pretty nice effect, and the poi is smart enough to turn itself off after you’re done playing with it.

March 31, 2010

It’s just a rant, but it’s one I can relate to. Autotools must die:

But autotools was a kluge. And it did accrete kluges and crocks around it, adding layers of complexity until it became sore difficult to tell which end was up. And lo, it became a festering pile of special cases and obscure semi-documented rules, leading to a combinatorial explosion of unplanned interactions and obscure lossage.

Some good comments too.

March 21, 2010

How to Build a Three-Pendulum Harmonograph

A harmonograph is a mechanical device that uses swinging pendulums to draw pictures, believed to be originally invented in 1844 by Scottish mathematician Hugh Blackburn. There are other types of harmonographs, but this 3-pendulum rotary type gives a wide variety of pleasant results, and is fairly easy to build once you’ve settled on a design and have acquired the appropriate materials and tools. This is a great project to do with kids and can result in endless experiments creating new types of geometric designs.

March 20, 2010

Using an arduino to control a digital potentiometer

In this tutorial you will learn how to control the AD5206 digital potentiometer using Serial Peripheral Interface (SPI). Digital potentiometers are useful when you need to vary the resistance in a ciruit electronically rather than by hand. Example applications include LED dimming, audio signal conditioning and tone generation.

March 17, 2010

Synthesis of various percussion sounds

Percussion synthesis on the Nord Modular
Bass drum from three components
SOS article on various bass drum synthesis algorithms
SOS article on snare drum synthesis

Notes for an Arduino-based midi device implementation

Circuit for an IN port
Circuit for an OUT port
Circuit for the THROUGH port
Arduino interface with IN and OUT
Software to use the Arduino’s USB port as a MIDI interface

How to make your own oLED at home

Instructions for making your own oLED using ordinary household tools – Q-tips, aluminum foil, duct tape, a microwave, a hair dryer, and a multimeter.

Toshiba stops manufacturing incandescent light bulbs

After 120 years, Toshiba will stop producing incandescent light bulbs, switching instead to LEDs and compact-fluorescents.

March 14, 2010

At Wade’s with Ava


March 11, 2010

I seem to have snapped out of a creative funk. During the last day I have spent time thinking about, doing background research on, designing, or actively working on the following projects:
– LED poi for Ava (thinking about a simpler graphics algorithm)
– Automatic drum sequencer (tweaking algorithm, thinking about hardware)
– Bassline sequencer (rhythm is obvious, need some input for chord progressions and some kind of complex arpeggiator)
– Device for controlling large numbers of LEDs in rhythmic patterns (for a party later this summer)
– Multi-band, multi-source mixing audio compressor (looks workable but hard to do without lots of computing horsepower; arduino is probably not enough)
– Rearranging my music box so I can place the keyboard behind the rest of the controls (better ergonomics)
– Custom kick-drum synthesizer/MIDI metronome device (what goes into a solid kick drum sound?)
– Jacket design involving irregular vertical pleats (bought some fabric and buttons; simple design, interesting texture)

March 8, 2010

Right, so, what have I been up to?

I had a cold for a week. Lots of coughing.

I’ve been getting down to the last petty annoyances on my motorcycle to-do list. I’ve replaced the control levers, replaced the clutch lever bushing – it actually pulls straight and smooth now, for the first time since I’ve owned it! – replaced the broken seat latch, replaced all the worn-out rubber bushings that hold the side panels on, replaced the headlight element (the high-beam didn’t work). The carbs need to be cleaned & synchronized, but that’s a bigger job than I want to deal with myself, so I took the bike over to Steg’s shop. Perfect timing, since we’re having a serious cold snap today! The bike will be in great shape by the time spring arrives in earnest.

I’ve been playing with an algorithm for generating percussion sequences. The idea is to create an instrument I can add to my music machine that will let me create and adjust percussion tracks on the fly, driving a MIDI drum module. The central conceit of my music project is that I want to create as live a performance as possible, and if this thing works out it’ll let me improvise drum tracks from scratch instead of just tweaking the ones I’ve prepared ahead of time.

The algorithm works surprisingly well, for the simplicity of its design. It’s based on Toussaint’s paper The Euclidean Algorithm Generates Traditional Musical Rhythms, in turn based on Bjorklund’s timing system for a neutron accelerator, The Theory of Rep-Rate Pattern Generation in the SNS Timing System. It all sounds very high-tech, but the basic idea is simply this: natural-sounding rhythms are those which distribute their energy as evenly as possible across the repetition unit.

February 27, 2010

I learn to weld



I took Rusty’s MIG welding class at Hazard Factory today, with Heater, Brian A, Mark A., and Adam H.

February 19, 2010

I have a new mouse. The scroll wheel on my old mouse stopped working, and the rubber grip peeled off, leaving the side all sticky, so I felt annoyed every time I touched it. I decided to take a peek into the modern world and try out a bluetooth mouse. I picked out a Razer Pro|Click Notebook Mouse, since it was available in red. It looked cool and had a neat glowing LED, but I wasn’t very happy with it. The bluetooth system basically works, but the pointer would skip whenever CPU load spiked, and I had to reboot my machine one day after the mouse and computer forgot how to communicate with each other.

I decided I would go back to a plain old USB mouse, which arrived today. It is a Trust Predator 2000 dpi High Performance Optical Gamer Mouse with seven buttons, adjustable resolution, and XXL Teflon Feet for Super Dynamic Movement. I don’t know what half of that stuff means but it is clearly meant to signify that this is a very cool mouse.

I bought it because it is black with red stripes and has a cool glowy LED thing under the scroll wheel. I like my new mouse.

February 18, 2010

Ava and I just came back from an interview at the homeland security office down in Tukwila, near the airport. The interviewer asked us a handful of questions, asked us how we’d met, why we decided to get married. We showed her our wedding photo, pictures of us with my family, and the like. And that was it – she approved Ava’s “adjustment of status”, and her green card will arrive in a few weeks. Exciting! This process has gone far more smoothly than I expected.

February 13, 2010

Planting trees along the Cedar River


February 12, 2010

More on the laser mosquito zapper:

If Microsoft founder Bill Gates unleashes more mosquitoes at this year’s Technology, Entertainment and Design conference, Nathan Myhrvold will be ready for him. Myhrvold demonstrated a “Death Star” laser gun designed to track and kill mosquitoes in flight. The device was crafted from parts purchased on eBay by scientists at Myhrvold’s Intellectual Ventures Laboratory.

Includes a video of mosquito wings getting burned off. Looks like they are using a blue/violet laser, as found in a blu-ray player: makes sense, as higher wavelength = more energy.

February 6, 2010

It feels like springtime here. The skies were blue, or at least bluish, and the weather – while crisp and cool – was by no means wintery. It’s been a good day. I got up at ten, made myself a leisurely breakfast, wandered over to the auto parts store, got a set of metric hex-key sockets, walked over to where my bike has been parked for the last week, and started working. One relaxed half-hour later, I’d finished installing the new starter, and much to my delight discovered that it completely solved the starting problem. I had no idea how badly worn the old starter was! I’ve been used to having to work hard to get the bike moving, frequently having to push-assist – the new starter gets it going every time after just a couple of revs. So excited!

Of course I went out for a ride. I ran the Lake Washington bridges, not too fast but enjoying the cruise. The carbs might still need a little cleaning, but it runs pretty well for a bike that went to the playa and back, and has been sitting in my shop ever since.

The afternoon I’ve spent working on two pairs of yoga pants, one for me and one for Jeff T. I’m using the same design for each, though his will be 3/4 length and mine full, and I’ll probably give mine an extra pair of pockets so I can wear them out dancing. They’re pretty tame for dancing pants, though; I’m using matte stretch fabric in black and dark red, nothing shiny or fuzzy or otherwise attention-grabbing.

January 31, 2010

working on LED poi


January 29, 2010

I realized, when I was working on my bike last weekend, that the clutch cable was stiff because I had cinched it onto the frame using zipties, creating extra friction between the cable and its housing. I did this because the cable I ordered was too long, and I had a few extra inches to squish out of the way. Er. That was not so smart. I put up with this for over a year, since I didn’t realize it was a problem with the cable, and not part of the clutch design. The replacement replacement arrived today, and it took all of fifteen minutes to install it. I’m laughing at myself now for taking so long to think of this.

Parts for a pair of LED poi are scattered across my work table at the moment as I figure out how I am going to assemble them. I haven’t started any of the electronics work yet, but it’s a simplified version of the juggling ball prototype I made early last summer, so I expect it all to be straightforward. I’m using 3.3v circuitry this time, which means I don’t have to shift levels in order to talk to the accelerometer, I’m using plain ol’ AAA batteries instead of the fancy lithium-polymer rechargeable system, and I’m using a manual “wake up” button instead of an accelerometer-driven interrupt. Simple as can be.

Each poi is made from a pair of 3″ acrylic hemispheres, with a length of ball chain and a braided leather handle. I’m going to diffuse the light by sanding the insides of the hemispheres and painting them with aerosol window frosting. I think it would be simple enough to epoxy all the electronics onto one of the hemispheres; what I haven’t worked out yet is how to securely mount the battery box, how to keep the batteries from popping out during use, and how to attach the hemispheres together in such a way that it is still possible to change the batteries.

Come to think of it, maybe a rechargeable system would have been easier, since I could solve both of those problems with epoxy, and leave the poi permanently sealed.

January 27, 2010

Generating good syntax errors using a table-driven parser: apparently it is possible after all.

The objection to parser generators that seems to resonate most is that generators like yacc produce inadequate error messages, little more than “syntax error.” Better error messages were one of the key benefits hoped for when g++ converted from a yacc-based C++ parser to a hand-written one (and to be fair, C++ syntax is nearly impossible to parse with any tool; the many special cases cry out for hand-written code). Here the objection seems harder to work around: the parser internally gets compiled into an automaton—usually a big table of numbers—that moves from state to state as it processes input tokens. If at some point it can’t find a next state to go to, it reports an error. How could you possibly turn that into a good message?

Difficulty reporting useful error messages is one reason I’ve abandoned parser generators. I’m still not interested in going back any time soon – parsing just isn’t that hard! – but parser generators are probably not going away, so it’s interesting to see a technique for getting useful results out of them.

January 26, 2010

I figured out how to crack combination locks when I was about 16, and caused my chemistry classmates at SCC some little consternation when I demonstrated the technique. This is how you do it.

January 24, 2010

I spent Friday afternoon/evening getting my bike’s new headlight and turn signals wired up and bolted on. I gave it most of a can of starter fluid and got it running again – yay! Took a quick trip over to Brown Bear and went over it with the pressure washer.

Adam and I spent a couple of hours moving his bike to the shop and mine back home, which involved a detour up to the Lincoln Towing lot on Aurora, since it turned out his bike had gotten one parking ticket too many. It took some fresh gas, a hit of starter fluid, and a jump from my car to get it running, but then everything worked fine.

Friday evening I went over to AND for cocktails and music, and ended up walking home late. I went back to pick up my bike the next morning and it once again wouldn’t start! I tried push-starting it and got nowhere. Hmmm.

I went back today and gave it another try, with jumper cables and starter fluid, and still got nowhere. It was dark and rainy so I gave up for the time being. I’ll try again tomorrow; clearly there is something gunky going on in the carburetor, and I think I’ll take it over to Felony Flyers and have them fix whatever it is.

January 21, 2010

I saw this and thought of Adam: a proposal to rebuild Haiti using cargo shipping containers.

The downside to ‘dogfooding’:

The idea that as a devel­oper, you should use your own products on a daily basis, even during development. This exposes you to all the weaknesses and flaws of the product, and makes you much better equipped to deliver a product that’s actually worth using.

But perhaps there’s a counter-argument that people seem to miss. If you use a lousy piece of software on a daily basis, you get used to it. You stop thinking about how it should be, and only consider how it is.

I’ve become less enthused about dogfooding over the years. At Real Software, doing as much of our work as possible in REALbasic seemed like a good idea, since it would give us all deep familiarity with our own product. In practice, though, the problems we faced while working on RB itself only sometimes resembled those our customers worried about. We were a small team with limited resources, and improving our efficiency was critical: so there was a constant temptation to prioritize the changes that we needed over the ones that would help our customers.

During my stint at Microsoft’s dev tools division, which has a long-established practice of dog-fooding, I met many people who were hired out of college and had never worked anywhere else. People referred to non-Microsoft tools and developer communities in ways that suggested they were foreign and little-understood. We collectively wasted countless hours dealing with buggy version control systems, antiquated test harnesses, byzantine scripting languages, unstable beta editors, endless system reinstalls, and the like, but the dogfooding policy was never questioned. I couldn’t stand it, but I think most people there were just used to it. They had learned each quirk one at a time, over years, and had developed work habits that insulated them from the pain.

Dogfooding may have short-term QA benefits, but it’s not worth the long-term cost. Productivity depends on concentration, and an unstable dev environment constantly knocks you off balance. The less frequently I have to stop thinking about my work and deal with some quirk of the toolset, the deeper I can get into the flow-state where the real work happens. Distract me too often and I simply won’t get anything done.

January 20, 2010

I’ve spent the evening finishing the top for Lesley. I made facings for the collar, front and back seams, and armholes using the red stretch knit fabric from the side panels, plus a layer of fusible interfacing. After topstitching the facings down and finishing the seams with bias tape, I had two halves of a top: time to join them. I put a row of eyelets down each side, front and back, then laced the halves together with elastic cord. The last time I made this top, I found that the lacing tended to shift around: the seam would pull close together around the middle, and spread apart top and bottom. I decided to help avoid that this time by running both cords through a bead at their intersection, hoping that the extra friction would keep the tension from shifting around. It’s all done now, save tying off the ends of the cords. It’s a simple design, but it was fun to put a lot of effort into the finish, and I am proud of the result.


A package from Sparkfun arrived today, containing a pair of three-axis accelerometers, a pair of mini Arduino boards, and a handful of RGB LEDs. These will become an LED glow-poi system for Ava; I’ll mount the electronics inside two pairs of acrylic hemispheres and attach a ball chain. I’m not exactly sure how I’m going to join the hemispheres to each other, but it’ll work out somehow.

January 14, 2010

Just ran across this essay, via Hacker News, and everything it says is true: “Poor, poor child. You have no idea – the letter I wish I could write to my former self, and have beamed at light-speed through some kind of vacuum tube and delivered at the precise moment when I finally decided to learn to program.”

The problem is that while you’ve uncovered a wonderful world that makes coding seem so approachable and fun, you’re unknowingly making a giant leap by thinking it’s somehow also easy.

This might not seem like a big deal, but it’s huge. Every single time (and this will happen constantly) you come across a concept that seems foreign or difficult or even just unintuitive, instead of thinking “It’s OK. Programming is hard.” you’re going to be thinking “This is supposed to be easy. What’s wrong with me? I must be stupid.” These feelings will keep you from seeking help or pushing through to discover why things work the way they do, and that is what’s stupid.

If I had to quibble with anything, it would be the comment about first languages. The first language you learn will influence the way you learn your next, of course, but every time you pick up a new tool, it stretches your overall model of computation. You’re not just learning a new language, but learning how to develop and reconcile models. It is hard to learn new ways of thinking about things, but that’s part of what you do as a programmer, and you aren’t going to get very far until you learn how to grasp and create abstractions.

A related essay I came across earlier today elaborates on the idea of time investment as the route to achievement. I Have No Talent:

It is true. I have no talent. What I do have is a lot of practice. And I am not talking about occasionally dabbling in Ruby on the weekends. I am talking about the kind of practice where I beat code that isn’t working into submission (though often times the code wins).

January 13, 2010

I’ve been jammed up against what feels like the same Radian problem for the last two weeks, but I’m finally making some headway. I’ve been going round in circles thinking about some of the central data structures, and the consequences ripple so far through the project that it’s hard to actually make any decisions. The slow pace is frustrating; I have to keep reminding myself that it’s OK if it doesn’t always come together quickly, as long as I keep pecking away at it.

Tonight I took a break from the computer and spent a few hours with Lesley. She came over after work with a sushi dinner, and then we chatted and caught up on life while I started my next sewing project. It’s a variation of something I made for myself a few years ago, and I think this rendition will look great on her. It’s a sleeveless, black velvet top, with stretch-knit side panels, which laces all the way up the front and down the back. The original was all black; this version has red side-panels and facings, and I’m using elastic cord for the lacing. I cut out and assembled the main panels tonight; there are many details left, but I’m happy to have the fit and general structure done.

January 10, 2010

Bummer. Bike won’t start. Probably the carbs are gummed up from sitting around for months. That was more work than I felt like dealing with today, so I’m back home intending to do some work on Radian.

« Previous PageNext Page »