"wake up! 16b" (Outline Demoparty, May 2026, Ommen, NL) is a 16-byte MS-DOS production that uses video memory to calculate a Sierpinski fractal and play it as audio.
int 10h ; Init Video Mode 0
mov bh, 0xb8 ; Setup VRAM segment
mov ds, bx
L: lodsb ; Load [SI] to AL, inc SI
sub si, 57 ; Move pointer backward
xor [si], al ; Cellular Automaton
out 61h, al ; PC Speaker output
jmp short L ; Infinite loop
1. The Canvas: `int 10h` primes the 40x25 text grid uniformly with ASCII 0x20 and color 0x07. This stable, uniform void is necessary to prevent the cellular automaton from shattering into static.
2. The Fractal (Rule 60): If this loop used `add`, it would create a binomial prefix sum:
A^(p)[k] = 2 \* C(k+p, p-1) mod 256
But substituting `add` with `xor` discards the arithmetic carry, isolating the bit-planes. This turns the math into a pure cellular automaton mapping to Wolfram's Rule 60:
Cell^(p)[k] = Cell^(p-1)[k] XOR Cell^(p)[k-1]
Visualizing Bit 1 propagation over 5 passes (X = set):
P1: X X X X X X X X
P2: . X . X . X . X
P3: X . . X X . . X
P4: . . . X . . . X
P5: X X X . . . . X
P6: . X . . . . . X
P7: X . . . . . . X
3. The Audio: Port `61h` uses Bit 1 to physically move the PC speaker cone. The Sierpinski geometry acts directly as a square-wave audio instruction: alternating bits (like P2) yield high frequencies, while sparse rows (P4) create rhythmic rests.
4. The -56 Byte Step: The pointer's net movement is -56 bytes per loop.
- Visuals: On an 80-byte wide grid, this offset shears the fractal diagonally into 10 evenly spaced, ascending vertical pillars.
- Audio: 56 does not divide the 64KB segment evenly, requiring 8,192 steps (7 full wraps) to complete a cycle. Doubling the macro-cycle halves the fundamental frequency, dropping the audio exactly one octave.
5. Hardware Quirks: The theoretical math expects zeroed memory, but the XOR operation violently collides with the BIOS's 0x20/0x07 initialization. This mutates the pure triangles into a cascade of pseudo-random ASCII glyphs. Because it relies entirely on raw RAM states, the visual and auditory output is highly sensitive to the specific machine or emulator, turning a simple mathematical quirk into a unique audiovisual fingerprint.
I thought this was going to convert a matrix rain into sound but it does visual and sound. Amazing. And it is almost like a decent track, music is going round in my head now.
Is this a program or a secret key that unlocks a beast? Not sure!
Very cool!
Was super surprised the sound actually sounded coherent, versus something like static or noise.
Was it unexpected for you too or do you think there could be property of the computation that would suggest it?
Seems like this does the reverse of the C64 demo "A Mind Is Born" (https://linusakesson.net/scene/a-mind-is-born/): that one is making music first, and simultaneously interprets it as graphics. Of course that C64 demo is huge compared to this x86 one :)
Remarkably, sending this entire mixed-data byte directly to system port 61h, which historically manages various low-level motherboard controls, does not disrupt the system. In standard DOS environments and modern emulators, pushing these extra bits to the port is effectively harmless.
If anyone is curious what the other bits do and how the PC speaker really works:
I'd never seen that demo before, but from your description I had a suspicion it would be a C64 floppy drive, which has the same CPU as the C64 itself and runs embedded firmware acting more like a file server:
14 comments
[ 2.8 ms ] story [ 40.7 ms ] threadVideo: https://youtu.be/MvycyU-kLjg | Pouet: https://www.pouet.net/prod.php?which=106210
The 16-Byte Code:
1. The Canvas: `int 10h` primes the 40x25 text grid uniformly with ASCII 0x20 and color 0x07. This stable, uniform void is necessary to prevent the cellular automaton from shattering into static.2. The Fractal (Rule 60): If this loop used `add`, it would create a binomial prefix sum:
But substituting `add` with `xor` discards the arithmetic carry, isolating the bit-planes. This turns the math into a pure cellular automaton mapping to Wolfram's Rule 60: Visualizing Bit 1 propagation over 5 passes (X = set): 3. The Audio: Port `61h` uses Bit 1 to physically move the PC speaker cone. The Sierpinski geometry acts directly as a square-wave audio instruction: alternating bits (like P2) yield high frequencies, while sparse rows (P4) create rhythmic rests.4. The -56 Byte Step: The pointer's net movement is -56 bytes per loop. - Visuals: On an 80-byte wide grid, this offset shears the fractal diagonally into 10 evenly spaced, ascending vertical pillars. - Audio: 56 does not divide the 64KB segment evenly, requiring 8,192 steps (7 full wraps) to complete a cycle. Doubling the macro-cycle halves the fundamental frequency, dropping the audio exactly one octave.
5. Hardware Quirks: The theoretical math expects zeroed memory, but the XOR operation violently collides with the BIOS's 0x20/0x07 initialization. This mutates the pure triangles into a cascade of pseudo-random ASCII glyphs. Because it relies entirely on raw RAM states, the visual and auditory output is highly sensitive to the specific machine or emulator, turning a simple mathematical quirk into a unique audiovisual fingerprint.
Is this a program or a secret key that unlocks a beast? Not sure!
https://www.pouet.net/prod.php?which=86923
https://www.youtube.com/watch?v=iCgIQuPHb5w
Very impressive what people can craft in an order of magnitude fewer bytes than this comment!
If anyone is curious what the other bits do and how the PC speaker really works:
https://fd.lod.bz/rbil/ports/keyboard/p0060006f.html#table-P...
https://forum.vcfed.org/index.php?threads/pc-speak-technical...
...and I wouldn't be surprised if some chipset put more hazardous functionality in those reserved bits.
https://www.youtube.com/watch?v=zprSxCMlECA
https://en.wikipedia.org/wiki/Commodore_1541
https://en.wikipedia.org/wiki/Commodore_DOS