While you may not be aware of it, most modern
*n?x systems come with a built-in
industrial music generator. This generator consists of three parts:
- The concept of devices as files
- Standard input/output redirection to/from files (implemented with > and < in Bash)
- /dev/audio
That's about all you need. The output of just about anything, most notably
cat, can be interpreted as raw
sound data and sent to the speakers instead of the monitor. Most of the time this will just give you weird
static. Try
cat /dev/urandom > /dev/audio (outputs literally
random sound). If you want something more meaningful, try simple
patterns of values; the most simple value, and a good place to start, would be
yes > /dev/audio, which outputs a high whining as the value 'y' is sent as audio over and over.
The trick is finding ways to get interesting patterns out of the speakers. One way to do this is to write simple programs:
int n=0, i=1;
for(;;) {
cout << char(n+=i);
if (n>255 || i<=0) {i++; n = n % 255;}
}
However your best bet is to try to find something large with a repetitive
structure but varying information-- large data files for example. And the two best examples of this, if you ask me, would be
cat /dev/hda1 > /dev/audio (or your equivalent) or
cat /proc/kcore > /dev/audio.
Core is more.. well, hardcore, but catting your hard drive into /dev/audio is uncontestedly the best. You get weird, vaguely looping
noise, shifting, completely unpredictable, infinitely varied but usually with a constant feel to it. Plus if there are any
sound files on your drive saved in a
lossless format they just play at random and then disappear back into the soup. Someday i'm going to tape 45 minutes worth of my
linuxppc partition, then drive down to
the local college radio station during the
ambient show and ask them to play it. I doubt they'd be disappointed.
> /dev/audio music can be surprisingly good, and the quality levels of hard drives tend to approach that of
coil.
If this particularly interests you, you may download a sampling of crud i have created (mostly with this method) at http://charon.sjs.org/~mcc/awk
Re asofel and otaconx: Any block of text interpreted by /dev/audio tends to have a rather uniform sound, kind of a feathery leaves rustling in the wind noise. This is because ASCII text is actually printing out a rather limited range of values; after all, a character value lives in the range 0-255, but only 96 of these are on a QWERTY keyboard.
Catting /dev/null to /dev/audio produces silence, because you are simply printing a stream of zeros. Printing ANY single repeating character value to /dev/audio, in fact, produces silence, be it zero or 255. In order for noise to happen there must be at least some variation. I am not quite sure why. (This does not apply to my example of the yes program given above, because yes is actually printing a simple two-value pattern; 'y' followed by '\n' (a linebreak))