[livecode] livecoding via the linux shell

From: AlgoMantra <algomantra_at_gmail.com>
Date: Tue, 6 May 2008 12:03:24 +0530

Um, I found this quite relevant:
http://everything2.com/e2node/catting%2520weird%2520things%2520to%2520%252Fdev%252Faudio
(copyasted below)

While you may not be aware of it, most modern
*n?x<http://everything2.com/title/%252An%253Fx>systems come with a
built-in industrial
music <http://everything2.com/title/industrial%2520music> generator. This
generator consists of three parts:

   1. The concept of devices <http://everything2.com/title/devices> as
files<http://everything2.com/title/files>
   2. Standard input
<http://everything2.com/title/input>/output<http://everything2.com/title/output>
   redirection <http://everything2.com/title/redirection> to/from files
   (implemented with > <http://everything2.com/title/%2526gt%253B> and
<<http://everything2.com/title/%2526lt%253B>in
   Bash <http://everything2.com/title/Bash>)
   3. /dev/audio <http://everything2.com/title/%252Fdev%252Faudio>

That's about all you need. The output of just about anything, most notably
cat <http://everything2.com/title/cat>, can be interpreted as raw
sound<http://everything2.com/title/sound>data and sent to the speakers
instead of the monitor. Most of the time this
will just give you weird static <http://everything2.com/title/static>. Try cat
/dev/urandom <http://everything2.com/title/%252Fdev%252Furandom> >
/dev/audio (outputs literally random
<http://everything2.com/title/random>sound). If you want something
more meaningful, try simple
patterns <http://everything2.com/title/patterns> of values; the most simple
value, and a good place to start, would be
yes<http://everything2.com/title/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 <http://everything2.com/title/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 <http://everything2.com/title/Core> is more..
well, hardcore, but catting your hard drive into /dev/audio is uncontestedly
the best. You get weird, vaguely looping
noise<http://everything2.com/title/noise>,
shifting, completely unpredictable, infinitely varied but usually with a
constant feel to it. Plus if there are any sound
files<http://everything2.com/title/sound%2520files>on your drive saved
in a
lossless <http://everything2.com/title/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
<http://everything2.com/title/linuxppc>partition, then drive down to
the
local college radio station <http://everything2.com/title/KTRU> during the
ambient <http://everything2.com/title/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<http://everything2.com/title/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
Received on Tue May 06 2008 - 06:39:15 BST

This archive was generated by hypermail 2.4.0 : Sun Aug 20 2023 - 16:02:23 BST