Create interesting sounds by shifting bits around.
For example, here is a simple C program that creates a repeating audio pattern when piped to /dev/audio:
#include <stdio.h>
int main() {
int i = 0;
while(1) {
i++;
putchar(i&i>>8);
}
}
First, brew install sox
in order to have a way to pipe data to the sound system.
Next, compile one of the .c files: gcc -o 42_melody 42_melody.c
.
Pipe the output of the program to sox: ./42_melody | sox -traw -r8000 -b8 -e unsigned-integer - -tcoreaudio
. Or, use the handy bash script: ./play squares
.
CTRL+C
to stop the music.
Experiment!
- Algorithmic symphonies from one line of code
- Deep analysis of one-line music programs
- (youtube) Experimental music from very short C programs
- (youtube) Experimental one-line algorithmic music (2nd iteration)
- (youtube) Music from very short programs (3rd iteration)
- Javascript Bytebeat Generator
- IBNIZ
- /r/bytebeat on reddit
- Bytebeat on canonical.org
- viznut-music on github
- Hacker News Discussion
- Collection of Interesting Bytebeat Formulae
Most of these programs are from @viznut's videos. All credit goes to him and the original authors.