Sam Gentle.com

Womblin' 2: Electric Wombaloo

Every now and again while walking around, I stumble across some discarded hardware that deserves a second chance at life. Everything you find by the side of the road has a story, and one thing I've learned after 31 years is you never know what's gonna get thrown out the door.

On the refuse pile of history today, this lovely Westcott "iPoint Evolution Axis" electric pencil sharpener: Electric pencil sharpener

Due to the tragic circumstances of my birth, I've always had to sharpen my pencils by hand like some kind of manual labourer. But I never stopped dreaming of a better future. Could this be my ticket out of skid row? A train ready to depart to my rightful place among the stationery bourgeoisie? I was determined to find out. Sharpener on its side with sneaky screws exposed

I pulled a bunch of screws from the bottom, but the damn thing still wouldn't come apart. Remembering the total chassis destruction that ensued when I missed some screws last time, I persevered in my search for peaceful disassembly. In time, the answer became clear: more screws hiding under the adhesive rubber feet. In repair culture, this is considered a dick move. Guts of the sharpener

The pencil mincer part of the assembly looked very impressive. It connected via a little enclosed gear train to the motor, which yet again didn't have any useful markings but appeared to be a permanent magnet DC motor. I assumed it would be an AC motor on account of running off AC, but what I discovered next will shock you. Electric pencil sharpener control board

It's a circuit board. Surprise! The right hand side is a fairly standard rectifier to provide the DC that the motor so desperately craves. There's a transformer, but the number of coils on either side seems identical, so I think it's just for isolation. That would mean everything's running on around 300 volts DC, which seems like a lot. But, hey, I'm not a motor, what do I know?

What I couldn't figure out was what that relay on the left is for. There are two switches to detect that there's a pencil in the pencil hole and the pencil flakes container is inserted, and I'm pretty sure that switch visible in the middle is related to its "auto stop" feature. But what's the relay do?

I didn't ponder this for too long, because upon realising that it was, in fact, a DC motor, I figured I'd try to power it and see if it blew up. I gave it 12 volts and nothing interesting, then ramped up to 24 and finally 48. Somewhere around 24 it actually started working, albeit super slowly. To go any further really needed that sweet mains voltage. Sharpener with new wires attached

I checked the fuses and capacitors, and nothing seemed particularly exploded. Up until that point I assumed the cord had been cut off because the sharpener went bang or zapped someone's kid, but I (very nervously) gave it the wall juice and it seemed to work fine. Maybe the cord got cut off because it was damaged. Or maybe the owner hates cords. It's not my place to judge.

So I lopped off its little vestigial cord stub, grabbed the cord from an old blender I ruined earlier, and wired it up. Everything still seemed to work, so I put all the screws back in and sharpened a couple pencils that didn't really need sharpening just to experience 240 volts of raw mechanical fury. Sharpener reassembled

And there you have it. One broken-down electric sharpener that's given up on itself + one inspiring pep-talk and/or power cable = one working electric sharpener and a long-overdue sense of upward social mobility.

Shaders gonna shade

I've been messing around a bit with audio visualisation lately. It's a very strange sort of problem space. There's a lot – I mean, a lot – of existing software for VJing and other kinds of audiovisual mapping. It looks super complex, but in a sense the processing pipeline is quite simple: audio data → analysis/feature extraction → parametric rendering → visual data. Assuming you're happy to write the plumbing yourself, you just need a feature extraction library and a way to render visuals. So I thought I'd give that a shot and see if I could get something going in the browser.

The audio feature extraction part was easy, though on the browser there aren't a lot of options. The two I found that seemed good were Meyda and JS-Xtract. JS-Xtract supported more features, but in the end I used Meyda because its code was nicer and I'm a snob like that.

For parametric rendering, the obvious answer is graphics shaders: they run on the GPU so they're proper fast, and they can generate quite complex visuals with only a small amount of code. I found The Book of Shaders pretty helpful for the finer details of how to do that, though the possibility space of shaders is so huge it's kinda hard to get your head around.

Luckily, there's a lot of inspiration to draw from thanks to the prodigious shader community. The biggest gallery sites are Shadertoy, GLSL Sandbox, and Interactive Shader Format. This last one is particularly interesting because the Interactive Shader Format includes parameter definitions, so you can easily wire data up to ISF shaders. That said, you can do that with any shader by just picking some juicy-looking consts or magic numbers and turning them into parameters.

With those two ingredients, it's really just a matter of wiring up the feature extraction parameters to the shader parameters and away you go. By which I mean away you go into hour upon hour of parameter twiddling, endlessly nudging numbers slightly one direction or another, never sure if you're making them better or worse. With the benefit of hindsight, I now realise that the value of the off-the-shelf solutions isn't really the feature extraction and rendering, but the rapid feedback of the real-time parameter mapping between them.

That said, it was pretty fun to roll my own, and it's nice to know I'm only a real-time parameter mapping system away from a decent solution. The whole thing also gives me some ideas for a more intuitive way to build shaders, something where you take some simple animation and shape primitives and repeatedly combine them with higher-level operations until you get complex behaviour.

Meanwhile, the fruit of my efforts so far is the video at the top there. It's a fun little track called Cuisine by Nctrnm hooked up to a shader I mangled together out of this starfield from GLSL Sandbox.

Sunday womblin'

Every now and again while I'm out for a walk, I stumble across some discarded hardware that deserves a second chance at life. By which I mean deserves to be dissected into component parts to someday be recombined into a Frankensteinian horror with no regard for their original purpose. Well, nobody said mad science was glamorous.

On the slab today, this lovely 18V "Rowenta" battery-powered vacuum cleaner: Vacuum cleaner in 2 pieces

I like battery-powered vacuums because they contain two very useful components: batteries and DC motors. Also, often they actually work just fine and the owner threw them out because they don't realise you have to empty them and clean the filters sometimes.

Anyway, this one came in two separate but equally important parts: the main body with the motor and fancy bagless chamber, and the holdy stalk thing with the battery and brains. The main body was surprisingly difficult to get apart. Initially I thought this was Big Vacuum using adhesives and proprietary fasteners as a boot pressed against the throat of the downtrodden genius home repairer. Turned out I missed some screws. The body may have sustained some minor damage during this process. Smashed up case + body innards

The motor looks like a fairly standard brushed motor, but I couldn't Google™ anything useful from the serial numbers. It was attached to a chunky 15 watt/1 ohm power resistor, presumably as a super inefficient way of doing speed control. The impeller assembly was actually pretty nice, though, the whole thing came apart pretty easily and connected to the motor with a threaded shaft and a little locking nut, making it a pretty decent candidate for repurposing. Motor

The holdy stalk yielded a couple of pretty basic circuit boards with nothing much interesting on them, except for some pretty blue 100-120 ohm resistors. There was another board that had a 3-position switch with a moderately satisfying switching action and a fairly bright blue LED, which I immediately blew up by accident. Circuit board

The real find was the 2000mAh 20-cell NiMH battery pack. Or, at least, I thought it was 20-cell, until I discovered 5 of the cells are fake! I mean, each cell is 1.2 volts, so 15 is the right number, but I never imagined that they'd just reuse a 20-cell housing and fill it with lies. I guess deep down I was hoping they'd accidentally given me 5 extra batteries. Battery pack

So that's the haul. One battery-powered vacuum cleaner equals a motor, battery pack, power resistor and a few odds and ends. All of the electronics from the vacuum cleaner

Urgency

I've found myself thinking a lot recently about the concept of urgency. Covey's 7 Habits famously divided tasks into important/not important and urgent/not urgent. His observation was that we do the important and urgent things first, but then tend to move on to the urgent and not important, rather than the important and not urgent.

This describes a particular kind of externally-imposed urgency, the urgency of deadlines, fire alarms or ringing phones. But what about tasks where the urgency is up to you? Nobody's telling you that you have to work on your novel right this second with a gun to your head, at least unless you're Stephen King.

You could argue that anything self-directed is necessarily not urgent. But if it's not urgent, and it's never going to become urgent, when do you do it? You could start your novel today, you could start it tomorrow, the day after... In the grand scheme of things it doesn't really matter which you choose. What pushes you to say "no, I need to start now"? That's urgency, but it's urgency you've constructed.

One way of getting there is arbitrary deadlines. You can just say "I want to finish my novel by next year, which means I need to start now". But you know you just made that deadline up, and there are no actual consequences for failing to meet it. And who knows if it's even meetable? Even experienced authors have difficulty predicting how long writing will take them, at least unless they're Stephen King. The arbitrary deadline is just a facade; you know it's not real, so it can't really give you anything beyond how much you believe in it.

To create some real basis for your urgency, you can create real consequences. Public embarrassment is a good one, but I've seen people use money or other punishments. I've even seen a system with a big jar full of as many marbles as you have weeks of life remaining, and each week you move one marble into another jar. It builds a sense of urgency by reminding you that your life is slipping away week by week. This stuff gets pretty masochistic.

To me it seems like this is all trying to simulate that external urgency rather than embracing its absence. Maybe what you're doing doesn't have to be finished soon. Maybe it doesn't have to be finished at all. Maybe nobody, up to and including you, will suffer any serious consequences if you just find something else to do instead.

But the point is you decided to do this thing, and you did that because of its importance to you. Not because it had to be done, but because you wanted it to be done. Its importance is defined purely in terms of your values, and so too can be its urgency.

Then the question goes from "what happens if I don't do this right now?" to "what happens if I do do this right now?" It's not urgency caused by a fear of consequences, but by a desire for them. Sure, you could do it any time, but now is sooner than later. It's a low-pressure kind of urgency, more impatience than crisis.

And which things bring you the best consequences? If you have your values screwed on right, none other than the ones that are most important. Covey's two scales are only needed when urgency is out of your control. If you get to decide, then there's only one scale, from unimportant stuff with no urgency to important stuff to do as soon as possible.

Manifesto

I need to create beautiful things.

Need is as I defined it previously: something beyond a want. Something that can't be satisfied by a decent attempt, a good try, or anything short of actual success. Something that's necessary for me to live, either because I wouldn't be alive without it, or because what's alive wouldn't be me.

Create means both creation and creativity. For something to be creation it has to involve bringing new things into existence, and for it to be creative it must involve that wonderful spark of ingenuity, that sense that it's opened up a new world or made the old one much simpler.

Beautiful is, in some sense, just my subjective sense of aesthetics. But I also believe in objective beauty. Something can be beautiful in function by achieving its purpose so well that it becomes an ode to the platonic ideal of that purpose. And something can be beautiful in concept by bringing together ideas and connections in such a profound way that experiencing it gives you a new understanding, even enlightenment.

A thing is an object that exists outside of myself, with some kind of tangible, reality-based nature. A balloon animal is a thing, but an idea for a new video game is not a thing. An idea for a new video game that you write down is a thing, but the thing is the writing, not the idea. And, of course, it's the plural: not one thing, but many things; enough that you don't think of them individually, but rather as an awesome mass of stuff rolling together and picking up speed as it goes.

I've been thinking about this for a while; different wordings, different concepts, different qualities that could make the cut. But I keep coming back to this one. I think if there's anything that's defined my work, not just over the last few years, but back as early as I can remember, it's this. I need to create beautiful things.