Reading The Encyclopedia

I’ve heard stories of people reading encyclopedias or dictionaries straight through, cover to cover. In everyone’s favorite existential-downer novel, Nausea, the “Self Taught Man” tries to read a whole library alphabetically. The basic spirit here – trying to swallow whole text that was meant to be referenced as needed – I guess I can get behind in some way. Trying to read totally general reference works is a bit too diffuse for me, but I do own some topical reference books (e.g. Oxford Companion to The Mind, A Dictionary of Marxist Thought) that I like the idea of reading all the way through despite being organized alphabetically, or otherwise non-thematically.

Realistically though, there is a good chance I’ll never read every last word of these, and even if I tried, I’d want to follow cross-references as I went, which would mean a lot of flipping around to avoid material read out of order. The thought of giving up after the letter C, and knowing a lot about cognitive science subtopics that start with certain letters, is pretty tragic.

What I’d really like to do is read a random sample of the book, then read a random sample of the pages left over, recursively. This way, if I quit at any point, I come away with a more or less unbiased sample, whereas if I stick with it, I can be certain I read the whole thing.

So last night I wrote this Python script to help me do that. I haven’t written much in Python, so it’s probably unidiomatic, but I think the implementation is pretty clean. You could probably implement this in about half the number of lines of code, albeit with hideous inefficiency, if you used Python’s set classes. Oh well.

Against Capitalism

Here is a really succinct summary of the most popular criticisms of capitalism, by G.A. Cohen, who identified as a analytical marxist (“marxism without the bullshit”) and had a really weird sense of humor.

Cube Sketch

Cube Animation

This is a preliminary version of an idea I had about a year and a half ago, which I wrote earlier this year and then forgot about. It’s an automated match cut between an orthogonal projection of a cube and two-dimensional polygons with simulated mass and solidity (thanks to box2d). You can see (occasionally kludgy) code and play with an interactive version here. I’ll be reimplementing this with support for perspective projection in C++/OpenFrameWorks soon.

The Bjorklund Algorithm

The following problem is considered by Bjorklund, in connection with the operation of certain components (such as high voltage power supplies) of spallation neutron source (SNS) accelerators used in nuclear physics.

Construct a binary sequence of n bits with k one’s, such that the k one’s are distributed as evenly as possible among the zero’s. For example, if n = 16 and k = 4, the solution is [1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0]. The problem of primary interest is when k and n are relatively prime numbers, i.e., when k and n are evenly divisible only by 1.

This is an excerpt from the somewhat melodramatically titled paper, The Euclidean Algorithm Generates Traditional Musical Rhythms. In short, sequences generated by the equal spacing algorithm described resemble various traditional rhythms, or otherwise sound pretty good. Create Digital Music did a post on various musical applications of it recently, like this neat little sequencer in flash.

Being a SuperCollider chauvinist I was happy to see Fredrik Olofsson had already written a pattern class to generate these sequences. It didn’t support embedding of patterns within it (which is what I really wanted to play with) but after a quick email to the list he patched it. Thanks Fredrik.

Anyway, here is a quick demo, with code after the jump.

[

90’s Rave Piano

Last year I asked Metafilter where I could find more music like Doctor P’s Sweet Shop, a rave nostalgia track that seemed to be mandatory play during the months I’d been going to shows in England. Empath came through with this seemingly canonical but in any case brilliant playlist of early 90’s rave tunes with syncopated piano chords, though I only noticed last week. I recommend Rhythm Quest’s Closer to All Your Dreams (Piano Mix) and Jem 77’s Never Felt This Way in particular.

For more modern day imitators try Skream’s offering (gloriously shameless: TB303 and amen breaks) and the Where were you in ‘92? album by Zomby.

You are listening to Los Angeles

A stream of the Los Angeles police scanner feed and dramatic ambient music, via Metafilter Projects.

Reminds me of this KLF track. I’m impressed and confused by how evocative even prosaic spoken word recordings can sound with some music behind them.


Stills from Zbig Rybczynski's 'The Fourth Dimension'

Artist Golan Levin maintains “An Informal Catalogue of Slit-Scan Video Artworks and Research”.

Popular uses of the effect include the stargate sequence at the end of 2001: A Space Odyssey and (if you’re British) these Dr. Who titles. In many CMOS image sensors, the diachronic polling of pixels is considered a bug, leading smartphone owners to shoot unintentionally avant-garde images. What used to be a pretty involved in-camera effect can now be done in a few lines of code.

Syncopation Exercise

After two or three years of halfheartedly playing with SuperCollider every now and then, I finally bothered to read the documentation for it’s language-side (as oppose to server-side) sequencing features. This is what most SC users are, for good reason, most enthusiastic about. It’s a very flexible and (as far as I know) unusual approach to the basic musical problem of ordering sound in time.

What follows is a very simple example an algorithmically generated piece with some constrained randomness. This isn’t meant to be a tutorial really, but should give you an idea of SC’s general character, and convince you that it’s worth the trouble to work through the documentation.

[


Davidope produces animated gifs, often with an op-art feel, and curates pretty sweet examples of the same.


The Wobbulator

An implementation of an idea of Nam Jun Paik’s. If you’re in DC, you should really see the installations of his work at the American Art Museum. They’re intense.

Music Animation Machine

Youtube user smalin posts these great animations, the result of several decades of experimentation, that portray the structure western art music tunes. It’s hard to say what makes a mapping from one sense to another successful, but these are some of the best attempts I’ve seen. I wonder if someone with a better ear might disagree. The name “machine” is a bit misleading – not much about the process seems to be automated, that is to say there is clearly a lot of interpretation going into each of these.

Cyclical Animation

A few months ago I was living in Britain, working for a company that made engines for UAVs, writing some graphical interfaces for an engine test system in Processing.

In my spare time I worked on some code to generate animations, which I plan to post over the next few weeks.

This first “sketch” (script, application, etc.) is pretty simple, but I spent a long time tweaking it to get the effect I was after. I took the basic idea from the SomethingAwful-born Blue Ball Machine GIFs (see wikipedia for a bit on the tradition).

Here is a representative output gif, generated with the code below and the very helpful gifsicle utility.

It works like this: The script assigns locations to each circle on each letter’s curve in turn with the Geomerative library, then generates random bezier curve paths between those locations for them to follow. To make things interesting, the algorithm allows coordinates to wrap around from left to right and top to bottom – a toroidal topology, if you prefer math argot. To put that yet another way, adding any integer multiple of the gif tile’s dimension (height/width) to a circle’s target coordinate will make no difference in it’s rendered location, but could make a difference in the direction it goes to get there. So a circle’s target coordinates are generated by taking those produced by Geomerative and adding a random multiple of the tile size (with a random sign) to it’s x and y coordinates. This means a circle can pass through several adjacent tiles in it’s journey between letter forms.

[

Decimator Wobble Bass

In the first of what I hope will be many Supercollider posts, I’m dissecting a fairly straightforward wobble bass snippet.

var trig, numSmp, rate, freq, wobble,out,note,mod;
freq = (140/60)/3; // It's not dubstep if it's not at an integer multiple of 140bpm.
trig =; // Main tempo pulse
note =, 0, Dseq([40, 43, 47, 47, 40, 49-12, 43, 40-12], inf));
note =, 300, 20); // Pitch changes are slewed, faster up than down
numSmp = / freq;
rate = 2pi / numSmp;
rate = rate *, 0, Dseq([1/2, 6, 6, 6*2, 2, 8, 6, 6*2], inf)) / 2; // Choose random "wobble" tempo
wobble =, rate, pi, 2pi ).cos; // Phasor is used to index cosine. Just sweeps through a half of a full wave.
out =, width: wobble.range(0.45,0.55)) // Tone to be filtered. Notice modulation of width param.
    +, mul: wobble.range(0,1)).dup;  // Subbass.
out =, 20000, wobble.range(1.2,8)); // Sampling resolution is decreased in time with the wobble.
out =, wobble.range(note.midicps,25000), wobble.range(0.03,0.1)).dup; // Emulated Moog Low Pass.
out = out * 0.25; // Turn it down a bit to prevent clipping.
out = [, 1, wobble.range(0,0.0012)),, 1, wobble.range(0.0012,0))]; // Spatialization
out = out *, 0.01, 0.7, 1.3/freq, doneAction: 0); // Simple Envelope

[

Keeping a Diary

Through this post on MetaFilter Music I discovered the tale of Reverend Robert Shields, which seems too perfectly allegorical to have actually happened. Here is an interview with the man and his NYT Obituary.

He kept a written log of his life broken up into five minute intervals. He claimed his diary was complete, that every minute over the course of 20 years was carefully accounted for by thousands of words a day, a task that the interviewer characterized as having taken over his life. Buckminster Fuller’s Dymaxion Chronofile, the only similar effort I’m aware of, broke up the day into comparatively slipshod 15 minute chunks. I suppose you have to limit the temporal specificity of your log to avoid falling in to an recursive loop of logging one’s logging…

Reminds me of a very short story by Jorge Luis Borges: On Exactitude in Science.

← Before