Skip to main content

Chip Fuzzing Synthesis

I'm unsure whether I read about this or dreamt it (this year has been a blur) but I recall someone fuzzing a retro sound chip, most likely the Yamaha OPL3, by sending it random bits for its synthesis parameters and recording the output. Drawing from this, we can explore "chip fuzzing synthesis," the art of feeding total digital randomness into a synthesis algorithm and seeing what comes out.

There is no specific need for a real retro sound chip or even an accurate emulation of one, but it helps to understand how some old sound chips operate to look for inspiration. As an example, we can look at the Commodore 64's SID. This chip is an analog subtractive synthesizer, providing three oscillators with frequency inputs, waveform selection (saw, pulse, triangle, noise), and ADSR envelope generators, all mixed into a filter with controllable cutoff and famously nonfunctioning resonance.

The parameters of the SID are controlled by an internal set of 32 8-bit registers, which are written to using a 5-bit parallel address bus and an 8-bit parallel data bus. In C-like pseudocode, communication with the SID can be emulated like so: 1

char sidRegisters[32];

// Parallel ports used to communicate with SID.
char addressBus = 0;
char dataBus = 0;

void writeSid(char address, char value)
{
    addressBus = address & 31;
    dataBus = value;
    sidRegisters[addressBus] = dataBus;
}

The SID interprets the sidRegisters array and maps various bits and bytes to analog synth parameters. For example, registers 0 and 1, taken as a 16-bit integer, control the frequency of an oscillator, and individual bits in register 4 select the waveform and enable ring modulation and hard sync.

Fuzzing the address and data buses is the equivalent of calling writeSid repeatedly with randomized address and value, writing random data to random registers. The exact rate at which random data is written is up to you. I find that slow randomization produces the most coherent results and has the least chance of turning the output into white noise. A few hundred times a second is a good start.

It also suffices to take a simpler route and feed high-frequency random noise (sample-and-hold, maybe) into every parameter of a synth. Again, we don't need a vintage emulation at all -- a minimal subtractive monosynth with waveform selection, ADSR envelope, and a few switchable filter types is adequate to get glitchy sounds. So here's a little patch:

This is sonically uncompromising (and hey, maybe that's your thing), but still makes a useful raw source for more polished sound design. Here's the same patch as above with some minor modifications and a lot of post-effects like granulators, distortion, and reverb:

The outcome of chip fuzzing synthesis is highly dependent on the choice of synthesis algorithm, the set of parameters, and the ranges for said parameters. I can imagine fuzzing FM, subtractive, additive, physical modelling, and parameters of an effects chain. The more inputs to fuzz, the better -- especially inputs that switch features on and off, exhibit complex interactions with other inputs, and/or unearth bugs and artifacts.

1

The above code may seem on the vacuous side, but writing it out this way allows for transformations that fall under the umbrella of bit bending. For example, performing a bitwise AND on the addressBus or dataBus is the equivalent of disconnecting pins of the chip. Similar bitwise operations permit shorting pins to 1, rewiring pins to other pins, downsampling individual pins, etc. Bit bending operations can be used in conjunction with chip fuzzing, or for glitching out "normal" musical input.