Red Echo

January 4, 2018

I went on a tear the other day, after finding out what wavetable synthesis actually does – I’d always vaguely assumed it was just another kind of sample playback, and wasn’t interested. A few hours of python later, I have a little program that goes mining through my music library, hunting for interesting waveforms; a little normalization and some spectral morphing later, and out come a bunch of wavetables, like you’d use in Serum or Massive.

The machine proceeds to use its wavetables, in a barely controlled sort of let’s-just-see-what-happens way, to generate anywhere from a few seconds to a few minutes of… well… let’s call it “sound”. It’s terrible, most of the time, admittedly – but it is a surprising kind of sound, too, and worth the exploration, for the compelling bits of alien music that sometimes come blurting out of that weird robot’s brain; dark throbbing rhythmic gritty off-kilter stuff that I would never have imagined making on purpose.

I had a few ideas for ways I might try to control this novel instrument – following the envelope or pitch of one sound to drive the generation of another, perhaps – so I went to look at the state of the music-analysis world, imagining I’d find some envelope-follower algorithm and do some stuff with FFTs.

Well, sure, tempo sync is old hat in the DJ world by now, and I’ve even gotten used to effortless key-matching, but the tools you can use now, and the kinds of information they can measure about music, are far beyond what I had imagined.

aubio, for example, is a Python library, and an unusually easy-to-use command line tool, which can find beats, follow the tempo, distinguish notes, follow the pitch of those notes, and also break the track up into its louder and quieter sections.

pyAudioAnalysis builds from there,, offering a generic toolkit for extracting, classifying, and measuring features in sound; you can use this library to train a custom segmentation engine, which will recognize and extract any particular pieces of an audio recording you might happen to be interested in.

Essentia, though, is the box of shiny toys that really made my head explode. Beat tracking, segmentation, feature classification, sure, we’ve seen that now; but how about… melody extraction? Mood detection? The list is amazing: dynamic complexity, spectral energy, dissonance, spectral complexity, beat loudness, and danceability!?

You’re not stuck on the command line, either – Sonic Visualizer will accept Essentia as a plug-in, along with a whole lot of others, and then there’s this Pure Data toolkit…

October 5, 2017

Thoughts about audio mixers

I’ve been spending a lot of time spinning music lately, and now that I’ve basically got the sound system I want, I’m thinking about mixers.

In a nightclub environment, it makes sense for the venue to provide the equipment, since they’re going to leave it set up all the time and use it night after night. Club DJs therefore expect to show up and take turns playing their sets on the same set of decks.

Those of us who play in a festival / rave / party context, as I do, have a much more DIY attitude: everything gets set up and torn down all the time, every event comes together a little differently, and you never know what you’re going to find. We all therefore tend to be self-sufficient, bringing our own controllers and expecting nothing more than a PA hookup. So, there’s always a little fuss around patching in and out of the mixer, and it can be a little messy and complicated. At a party I went to over the weekend, there were some pretty significant disruptions to the flow of the music because the PA mixer which happened to be present worked a little differently than most of us were used to, and we had to figure it out as we went.

Beyond that, I’ve been hosting music jams at my house for a while now, where we all get together and plug in to the big PA system downstairs and take turns slinging music back and forth at each other. Normally you’re just transitioning from one DJ to the next – but in this environment there could be half a dozen of us all interacting randomly.

So I’ve been thinking about mixers. Nobody, so far as I can tell, actually makes the mixer I wish I had, so I’ve been… well, fantasizing, I guess, about the idea of building one myself. I probably won’t actually do this, more likely I’ll find an existing product which is close enough, but… I want something which is neither a standard PA mixer nor a standard DJ mixer, but something in between.

I want a six channel stereo line mixer in console format. That is, I want a box that sits on a table, with all of its plugs on top, so it’s easy to plug in and see where you’re plugged into without having to poke around in the dark.

PA mixers always have a bunch of mono channels. I don’t want any. We’re not a band, there are no instruments, there are no microphones. Everyone using this device has a fully-formed stereo signal to contribute. Most mixers also have EQs on each channel. I’d rather omit them. We already have those knobs on our controllers.

All I want, on each channel, is a pair of stereo input jacks and a volume fader, maybe also a level meter or at least a single LED to indicate that signal is present.

But! – and here’s where I get to the part I can’t just buy already – I really do want an equalizer on the master output. PA systems don’t have a flat response and they don’t always respond the same way at different volume levels. There needs to be a way I can shape the output to suit the room and the equipment, which is *separate from* the EQ control the DJ is using for their artistic purposes. That is, I want to be able to set up the EQ for the PA once, at sound check, and then each DJ can ignore that problem and use their EQs however they want for mixing.

So, this is all I want, really: six stereo inputs with volume faders, an optional “signal present” LED for each, then a master section with a master volume, a master EQ, output level meters, and – this is important – *balanced* outputs, preferably XLR. In addition, there should be a second output of the same signal, with a separate volume control, for the booth monitors.

That’s it. That’s all I need. If I had this gadget, and used it as the master PA mixer, any DJ with a controller would easily be able to step up, see what was going on, patch in, and transition over with no confusion about which inputs do what, or how to route the sound, because it would only do the one thing that we really need a mixer to do. It would also give me a way to configure the sound without having to get in the way of each performer’s creative flow or have an individual conversation with each DJ about the characteristics of the sound system and how to compensate for them… without losing the nearly-idiot-proof simplicity of the active PA gear I’m using. That is… it would work even if I weren’t there to set it up.

Notes on the basic circuits involved in an audio mixer

A simple three channel mono mixer design

Some extremely simple passive mixer designs, no power input required

A comprehensive introduction to balanced audio signals, with an approximate sketch about some of the circuitry involved

Addendum: The venerable Numark CM100 looks like a fancier version of what I want. Except… it’d be easier to patch in and out if the input jacks were mounted on the faceplate, like a PA mixer.

Second addendum: there are lots of prefab circuit modules available for cheap on eBay: 5-band stereo EQ, 10-band stereo EQ, balanced output driver, same but preassembled with XLRs

Well. I should still probably just buy something instead.

January 21, 2017

I played at a masquerade party last night, which was themed on the “last days of the Weimar Republic”, as a dark joke against Inauguration Day. This obviously called for some retro-style escapism, so I spun up a non-stop electroswing set, which I’ve uploaded for you over on Mixcloud:

December 14, 2016

Programming is Forgetting: Toward a New Hacker Ethic

The ‘hacker ethic’ has been a significant influence on my philosophy of life; I’d feel pretentious actually calling myself a “hacker”, but I certainly identify with the ethos. I was all primed to cringe and react when I started reading this transcript of a talk which takes a critical view on the subject, but it turned out to be thoughtful, clearly articulated, and… important.

Programming is Forgetting: Toward a New Hacker Ethic

I often try to pull a representative quote that gets at the gist of an article, but this time I’m just going to say: go read it.

I do want to quote one bit, though. I’m five years older than the author, and my references are slightly different, but this is my story too:

Hackers the book relates most­ly events from the 1950s, 60s, and 70s. I was born in 1981, and as a young com­put­er enthu­si­ast I quick­ly became aware of my unfor­tu­nate place in the his­to­ry of com­put­ing. I thought I was born in the wrong time. I would think to myself I was born long after the glo­ry days of hack­ing and the com­put­er rev­o­lu­tion. So when I was grow­ing up I wished I’d been there dur­ing the events that Levy relates. Like I wish that I’d been been able to play Spacewar! in the MIT AI lab. I wished that I could’ve attend­ed the meet­ings of the Homebrew Computer Club with the Steves, Wozniak and Jobs. Or work at Bell Labs with Kernighan and Ritchie hack­ing on C in Unix. I remem­ber read­ing and reread­ing Eric S. Raymond’s Jargon File (Many of you have prob­a­bly seen this. I hope some of you have seen that list.) on the Web as a teenager and con­scious­ly adopt­ing it as my own cul­ture and tak­ing the lan­guage from the Jargon File and includ­ing it in my own lan­guage.

This feeling, this perception of myself as having just missed the part of the computing revolution I really admired and wished I could have participated in, has shaped the broad structure of my career. Up and up, the towers of abstraction have gone, while I have furiously dug deeper downward, trying to master these machines at the level my childhood heroes did. Well… I’ve gotten there, I suppose, but in the meantime the industry has gone elsewhere; the problem is that I have a hard time caring about most of what it’s busy doing. My basic model for the kind of computing work that is most important and most worthy of attention continues to be shaped by the example set in the ’70s and early ’80s.

August 16, 2016

Fabulous adventures in generating fantasy world maps, resulting in the Uncharted Atlas, a Twitter-bot sequence of imaginary places.

June 8, 2016

Fury Road vehicle gallery

After production work, before they got all beat up in the desert – a gallery of photos of the Mad Max: Fury Road vehicles. Lovely craftsmanship. Using this as design inspiration for work on the Verhängniswagen, aka Doom Truck.

May 18, 2016

Bookslut was born in an era of internet freedom. Today’s web has killed it

I miss the internet. I know that, technically, the internet still exists. It’s the Facebook-, Twitter-filtered series of algorithms designed to put cat videos, think pieces, and advertisements in front of you. But I get nostalgic for the days before money invaded the internet – the early 2000s, in particular, when I created the literary blog and webzine Bookslut.com.

Back then, nothing you did mattered. And that gave you freedom.

May 11, 2016

Never heard of the XDG Base Directory spec before, and I have no idea how widely supported it might be, but it seems like it might be a helpful way to move unix apps more toward a bundle/package architecture than the traditional “splatter everything all over the machine” hopelessness.

May 3, 2016

How to Pick Music for People on LSD, From a Scientist Whose Job That Is

I know a fair number of practitioners in this field, but they generally call themselves “DJs” and not “scientists”.

April 23, 2016

This is the kind of detailed, hacker-friendly explanation of ELF for which I really wish I’d had a Mach-O equivalent when I was writing the Mach-O linker for REALbasic.

April 15, 2016

A convenient list of lightweight, embedded-friendly alternatives to common, elaborately developed unix libraries.

April 14, 2016

Copperhead is a new Android-based mobile operating system with an appealing design brief. They’ve implemented an array of sensible-sounding security improvements, and the technical explanations for these changes are reassuringly lucid. They’re also open-source focused and not tied to any proprietary cloud services, which is exactly what I want. I might have to give this thing a try; I might hate my phone less.

While there are hundreds of C compilers in existence – it’s even possible, though highly unlikely, that the terrible C compiler I wrote back in 1997 is still out there somewhere – there are only two (and a half) of them which actually matter. The maintainers of these compilers increasingly subscribe to a pedantic, user-hostile interpretation of the C language which, as a user of the language, has become rather troubling:

Recently we have seen spectacular advances in compiler optimisation. Spectacular in that large swathes of existing previously-working code have been discovered, by diligent compilers, to be contrary to the published C standard, and `optimised’ into non-working machine code.

In fact, it turns out that there is practically no existing C code which is correct according to said standards (including C compilers themselves).

Real existing code does not conform to the rules now being enforced by compilers. Indeed often it can be very hard to write new code which does conform to the rules, even if you know what the rules are and take great care.

It’s an interesting post by Ian Jackson of the Debian project which some additional links that are worth reading if you have an interest in this sort of thing.

March 23, 2016

Why Microservices:

Lately, some of these SCS turned out to be still too large, so we decomposed them by extracting several microservices. Because we are already running a distributed system, cutting applications into smaller pieces is now a rather easy exercise. One of the reasons, why I agree with Stephan Tilkov that you should not start with a monolith, when your goal is a microservices architecture.

This article is not about the pros and cons of microservice architectures. This article is mostly about the pros. Not because they do not have downsides, but because I’m biased and completely convinced that microservices are a great idea.

March 22, 2016

My response to this article is a resounding “well, yeah,” but it’s interesting to see someone saying it, and in a social-science research context, at that:
People Want Power Because They Want Autonomy:

All told, this research indicates that the desire for power may be somewhat misplaced: Generally, when people say they want power, what they really want is autonomy. And when they get that autonomy, they tend to stop wanting power.

March 15, 2016

Archive of Interesting Code is a long list of clean, readable, well-commented implementations of useful algorithms.

March 8, 2016

Notes about getting better power management out of Linux when running on a Thinkpad X300, like the one I have been so frustrated with recently that I gave it the hostname “aggravator”. I get maybe 90 minutes out of its battery, currently. I was thinking about replacing its DVD player with a second battery, but I’m reluctant to throw even more money at this thing when its reliability has been so underwhelming thus far.

March 4, 2016

Resources for Amateur Compiler Writers

February 1, 2016

Aluminum extrusion channels for LED strip lighting.

January 24, 2016

bookmark: useful notes on writing makefiles.

January 10, 2016

A straightforward and well-presented article about the hopelessness of the currently-dominant computing model with some sensible suggestions for a better way.

December 31, 2015

two projects:
– router sets up first VM, exposes libvirtd proxy, launches boot process; implements firewall policies between fleet VMs
– shell implementation (bash fork? just posix sh? something new?) uses DNS-SD to locate libvirtd proxy, implements process management in terms of VMs

then, port/compile the programs I want to use as unikernel VM images.

December 14, 2015

Useful information about electric bicycle commuting in Seattle, including links to relevant RCW statutes and recommendations for equipment.

December 9, 2015

I miss the web. I didn’t expect it to be over so quickly. What’s next, I wonder? Should we try to build another one, or is the concept fundamentally flawed?

November 25, 2015

Thanksgiving is a science-fiction story

The proper genre for Thanksgiving is science-fiction:

It has come to my attention that people are woefully uninformed about certain episodes in the Thanksgiving narrative. For example, almost no one mentions the part where Squanto threatens to release a bioweapon buried under Plymouth Rock that will bring about the apocalypse.

Mr. S, an ordinary American, is minding his own business outside his East Coast home when he is suddenly abducted by short large-headed creatures like none he has ever seen before. They bring him to their ship and voyage across unimaginable distances to an alien world both grander and more horrible than he could imagine. The aliens have godlike technologies, but their society is dystopian and hivelike. Enslaved at first, then displayed as a curiosity, he finally wins his freedom through pluck and intelligence. Despite the luxuries he enjoys in his new life, he longs for his homeworld.

November 13, 2015

ne, the nice editor:

ne is a free (GPL’d) text editor based on the POSIX standard that
runs (we hope) on almost any UN*X machine. ne is easy to use for
the beginner, but powerful and fully configurable for the wizard, and most
sparing in its resource usage. If you have the resources and the patience to
use emacs or the right mental twist to use vi then
probably ne is not for you. However, if you need an editor that:

  • compiles without effort everywhere (or almost everywhere), is packaged for
    all Linux distributions, and ported to other operating systems (such as Mac OS X);
  • is fast, small, powerful and simple to use;
  • has standard keystrokes (e.g., copy is CTRL-C);
  • uses little bandwidth, so it is ideal for email, editing through phone line (or
    slow GSM/GPRS/UMTS) connections;
  • has a very compact internal text
    representation, so you can easily load and modify very large
    files…

… then you should try ne.

November 12, 2015

From IEEE Spectrum, Bosch’s Giant Robot Can Punch Weeds To Death:

At IROS last month, researchers from a Bosch startup called Deepfield Robotics presented a paper on “Vision-Based High-Speed Manipulation for Robotic Ultra-Precise Weed Control,” which has like four distinct exciting-sounding phrases in it. We wanted to write about it immediately, but Deepfield asked us to hold off a bit until their fancy new website went live, which it now has. This means that we can show you video of their enormous agricultural robot that can autonomously detect and physically obliterate individual weeds in a tenth of a second.

November 6, 2015

Oh yeah, this project to marry unikernels with the Qubes system is pretty much exactly what I have been going for with Fleet.

October 15, 2015

According to The Death Clock, I have about a billion seconds left.

That… seems reasonable.

October 6, 2015

The hypervisor is the new kernel.
The virtual machine is the new process.
The process is the new thread.
Virtual PCI devices are the new POSIX.

Shared mutable state does not scale.

September 24, 2015

I did a little research and the pieces of this plan are becoming clear. Virtio appears to be a totally reasonable platform abstraction API, and KVM will do the job as a hypervisor. I’ll set up an x86_64-elf gcc crosscompiler and use newlib as the C library. Each executable will have its own disk image, and exec will function by spawning a new VM and booting it with the target executable.

The missing piece, so far as I can tell, is a proxy representation of the hypervisor’s management interface which can be provided to a guest OS, so that our VMs can virtualize themselves – and pass on a proxy for their own hypervisor proxy, so that subprocesses can virtualize themselves in turn, recursively. This would enable the construction of a guest-OS shell managing an array of processes which are themselves independent guest-OS machines. Current thought: define the ‘virsh’ terminal interface as a serial protocol, then write a linux-side launcher process that creates a pipe-based virtual serial device and hands it off when starting up the first guest process.

With the launcher and the multitasking shell in place, a toolchain targeting this baremetal environment, and an array of virtio device drivers in the form of static libs you can link in, the platform would be ready to go.

Next Page »