Audio input seeded image processing. Hook up your CD player to the input of your sound card, or use your CD-ROM player (if you've got one). Run cthugha-L -- then play your coolest music. -- and wow, does your screen look like a 90's lava lamp or what?
Cthugha 'listens' to your music, and changes the display dynamically to the sound.
Ever looked at an oscilloscope of your voice or of music? -- Think of this as an oscilloscope on acid.
cthugha
svgalib
. Because svgalib
does not support new graphics
chipsets this version will slowly die.
xcthugha
glcthugha
cthugha-server
cthugha-server
you can use one sound card for a lot of other
machines to run Cthugha.
Simply start cthugha-server
on a machine with soundcard.
Then run Cthugha on any machine, but use the additional parameter
-N hostname
1.
To use Cthugha for the first time you will need just one parameter, describing what sound source it should use.
Here are some examples.
xcthugha -L 100
xcthugha -C 100 -c 1
xcthugha -x
This should be already quite nice, but the display is very small. To get a bigger window you need two more options described in the next section.
Cthugha uses two options to control the size of the screen.
-S
-S 2
or -S 374x234
.
Bigger buffers usually look better, but take more time to compute.
I suggest -S 1
or -S 2
, depending on what computer you
have.
-D
-S 2 -D 2
makes sense.
But maybe you would like to have a big window, but your computer has not
enough power to update the buffer fast enough. Then you can specify a
bigger display. For example -S 2 -D 3
2.
You can store up to 10 settings of the CoreOption (flame, display, palette, ...) to hotkeys.
To save the current setting press h
(a message will appear on the
bottom of the screen) and then a number key. When using xcthugha
you can also use Shift + Number instead.
To restore the settings from the hotkeys, just press 0
, 1
,
... 9
.
The values for the hotkeys are saved in
~/.cthugha.auto
when you press a
.
I have removed the "native" screen saver support of xcthugha
. So
you must use a program like xscreensaver
3.
You should specify the options --root
and --verbose=-1
.
The first will force xcthugha
to draw onto the root window, the
second will suppress most text displayed.
So an entry for the resource database for xcthugha
will look like
xscreensaver.programs: xcthugha --root --verbose=-1
Of course you can also add extra arguments to xcthugha
as you need them.
For example --zoom 1
to prevent xcthugha
from filling the
whole screen.
cthugha
and xcthugha
now always work as sound servers.
Because of that if you want to use cthugha-server
and
xcthugha
on one machine you must use the --srv-port
option
with one of the two.
Cthugha will search in the following directories for translation tables, palette files and pcx images:
./tab
, ./map
and ./pcx
/usr/local/lib/cthugha-L/tab/BUFF_WIDTHxBUFF_HEIGHT
for
translation tables
/usr/local/lib/cthugha-L/tab
, /usr/local/lib/cthugha-L/map
and /usr/local/lib/cthugha-L/pcx
LIB_DIR/tab
, LIB_DIR/map
and LIB_DIR/pcx
.
Where LIB_DIR
is specified by the parameter --path
and
BUFF_WIDTHxBUFF_HEIGHT is the size of the buffer in dezimal (e.g. 320x200).
You can find the other versions at the official Cthugha home page
http://www.afn.org/cthugha
.
xcthugha
should also work on non-Linux machines, but several
things will not work. Sound reading is probably the most important thing
that will not work (maybe something like --play /dev/audio --silent
works).
This version of Cthugha-L is based on cthugha V5.1 and V5.3 by Kevin Burfitt. Most things from the DOS-version work exactly the same way in the Linux-Version. Cthugha-L has a lot of additional features.
Rus Maxham (rus@interstice.com
) has done a port of Cthugha for the
PowerMac.
A special version of Cthugha-L supporting DGA
(Direct Graphics Access) with XFree86.
Mark Vojkovich (mvojkov@ucsd.edu
) has done this version. You
can also find it at ftp.afn.org
or via the WWW page.
I included DGA support in some version, but I dropped it - it only makes problems (especially with fonts) and is not even faster.
Kevin Burfitt (zaph@torps.apana.org.au
) is currently working on a
new version of Cthugha for Windows 95.
There will (soon) be a version of Cthugha for BeOS.
Raphael Moll (<raphael.moll@capway.com>
)
is working on this.
So you want to add/modify the source code, just follow this simple rules.
The following short quotes are about the original DOS Version of Cthugha. Cthugha-L can do everything the original can, and a lot of things more.
It gives credence to the phrase 'I can see music'...There is no real way to describe the patterns except as weird.Australian PC Review Oct '94
Wavy DataWIRED 3.03 (p. 156: Music to Your Eyes)
Upon first observation, oscilloscopes seems a bit ho-hum. After all, devices that graphically represent electrical waveforms on a display screen tend to fall a bit short on the sex appeal scale. But if you spend some time exploring the ways high-end oscilloscopes can visualize data, you may start to think the machines are on drugs . . . Cthugha 5.1, an oscilloscope program for PC sound cards, has tuned in, turned on, and decidedly dropped out from the humdrum world of scientific analog signal processing. The product of Australian code jock Kevin "Zaph" Burfitt, Cthugha takes your sound card's CD, line, or microphone input and displays it as a swirling, hypnotic, 256-color confection for your eyes. Although Cthugha currently requires MS-DOS, a VGA monitor, and a Sound Blaster or Gravis UltraSound sound card, the complete C source code is part of the package, so you can port it, if you're so inclined.
Cthugha is hard to pronounce (Kuth-ooo-Ga), and spell. The name is an ancient name from the occults. The following is an extract from the texts that describe him (it) the best.
Cthugha resembles an enormous burning mass continually varying in shape. It dwells at or near the star Fomalhaut, from whence it may be called. It is one of the most obscure and remote of all the Great Old Ones.Call of Cthulhu - Chaosium
When Cthugha is summoned he is always accompanied by Fire Vampires.
There appeared thousands of tiny points of light. ... The myriad points of light were living entities of flame! For wherever they touched, fire sprang up.The dweller in Darkness, by August Derleth
Some notes from the Debian maintainer (README.Debian).
At the time when the basic code for Cthugha-L was written, Linux
Read on for more info and potential windows, sound and OpenGL problems.
When cthugha seems to hang before it displays a window (eg. KDE 2.1),
use the --no-decorate
option.
You may also try --root
(nice!) with --text-on-term
or --panel
.
KDE 2.2s window manager is fine, but now kdesktop overlays --root
(you could simply kill it, loosing icons and the desktop menu).
Similarly, KDEs soundserver and others' might interfere with cthughas sound device handling, some soundcard drivers give problems too.
If you experience hangs when switching the sound read method from within cthugha, use the command line / config file way to change settings. The config file comes with dsp method set to 2, which seems appropriate for most cards.
Basically, cthugha records from the soundcard. The soundcard therefore has to be able to record from the sound source that you want to use!
With most soundcards this is no problem for CD, Mic and Line inputs. Using the cthugha mixer page to adjust volumes for any of these sources, switches recording to that source respectively, given that
With KDE for instance you can use the Mixer program directly. You can see which inputs are available for recording and the one actually used.
Today you may want to play eg. mp3's and have cthugha listen to them. The soundcard must be able to record its own output (or the wave channel) to support this (emu10k1 driven cards work fine, most ess have problems).
Cthugha provides the --play
option itself to play wavesamples, mp3s and
some tracker formats.
Plain samples (.wav files) should work just fine, depending only on the
cthugha sound format options (and correct soundcard driver installation).
For mp3 and other formats, cthugha calls external programs to convert
them to samples first. This once worked fine, when the number of those
programs was small. The current Debian package does not even care
which of these programs are available at compile time and so the
program may be compiled with no known player at all. This is because
some free replacements for eg. mpg123 pretend to replace them but don't
actually provide the same functionality.
I'm working on this issue and
any input of yours (preferred formats, programs etc.) is appreciated.
Short: if your card is full-duplex and able to record the wave channel, use your favorite external player program and let cthugha listen.
When you find that after cthugha starts you here only one channel,
any change to the input (recording) device volume on the Mixer page
will reinitialize both channels.
The 3D version glcthugha works best with MESA. You should really have hardware support or at least a 17GHz cpu and agp 23x available ;).
To try without 3D hardware, use the commandline:
glcthugha -D 0 -X --texture-quality low --mesh-size 16 --max-fps 11and use an external mixer program to set the recording device as you won't be able to read on screen. Also expect your system to be loaded.
XFree86-4 comes with xlibmesa. This is work in progress and changes
constantly. Different releases behave differently and, worse, provide
different extensions (more in TODO). Expect glcthugha to not be able
to set palettes on some releases, which lets it look quite boring.
Being a well behaved GL program, glcthugha quieries for the availability
of required extensions (EXT_paletted_texture
) on startup and exits when
they are not available. I disabled(!) the test for this(!) release,
so that it may work when run on a local X server. It may also crash.
A nice gfx chip to have would be NVidias TNT or later, if their GLX
drivers were FREE! or at least providing the necessary extension
(what, i believe, they must do on that too well known os hack anyway).
The current situation on Linux is 'sorry, no luck'. glcthugha crashes.
Bug them! NVidia-GLX ought to be FREE! and provide EXT_paletted_texture
.
UPDATE: Nvidia drivers still ought to be FREE! but current (4496) version provides necessary GL_EXTensions and plays nicely with glcthugha. Mesa and Mesa+ggi do up to 10 fps on an AMD 2400+. Xlibmesa still does not provide the necessary extensions ... I decided to stick with the 'disable test' hack, to avoid splitting the package and conflict with xlibmesa. For proper OpenGL use Mesa or vendor drivers!
cthugha.ini
comes with load-on-demand and load-late set to off
.
This avoids some empty process table entries to hang around until
cthugha exits. If you don't mind these, set both to on
or simply
delete the lines from the ini-file. This gives a faster startup.
Since cthugha already plays a little with itself even without music,
it's sometimes hard to say if it get's input at all. You can be sure
it doesn't when messages appear on the screen. When messages appear can
be set with the Time before silence msg
and MinimalNoise
options.
Take some time to play with cthugha until it does to your liking. You can stop automatic changing with <L> when the cursor is not on any option. When it is, you lock only that setting. Hitting <Enter> changes a randomly chosen setting, <SPACE> changes all settings.
Some of my own personal preferences (run from xterm):
nice -20 glcthugha \ -D 0 -X --max-fps 11 --texture-quality low --mesh-size 16 \ --min-time 400 --random-time 800 --quiet-time 50 --min-noise 5 \ --mixer rec:77 --mixer vol:89 --rate 22050 "$@"
ps x | grep '[k]deinit: kdesktop' | cut -d \ -f -1 | xargs -r kill nice -20 xcthugha \ -D 3 --max-fps 11 --little \ --mit-shm --root --text-on-term \ --min-time 400 --random-time 800 --quiet-time 50 --min-noise 5 \ --mixer rec:77 --mixer vol:89 --rate 22050 "$@"The status line (press <.>) helps in finding part of the numbers. T: shows time til change and S: time since silence. Adjust the options (<F3>)
Minimal time
, Extra random
, Quiet change
and Minimal Noise
.
I prefer little changes only
together with my other numbers for subtle
changes and no messages in short pauses.
Setting the max frames per second
helps to control cpu usage, watch
out for useless extensive buffer sizes. Reduce until it gets to coarse.
Pages and status line cost some extra cpu, switch them off when unused.
If you want to exclude certain displays or other settings, explore the possibilities to control them. <F8> gives control over displays to use, use the cursor keys to reach every other page.
To adjust the input level or similar: Lock the auto-changer. Go to the
core options
page (<F2>), from top down press <0> (Zero) on every
option up to palette (you may find other tables and palettes better).
This gives you an oscilloscope-like display. Adjust for no clipping.
deb-src http://home.t-online.de/home/eislink/debian unstable non-free
http://cthugha.de.tt
<- NEW (cthugha.debox.de no longer works).
Some plans I have with Cthugha for Linux:
xcthugha
should run on every unix system fast enough at least when using just
random data or a sound file as input.
svgalib
. To me it seems, that this library is slowly
dying. Newer chips are not longer supported. So in the future I will
probably only continue on the X11 version.
Several options control the way Cthugha displays the sound. In lack of a better name I use CoreOption for those (I you know a better name, please tell me about it).
As you already know Cthugha uses (multiple) buffers that are mapped to the screen. So all the CoreOptions (except the one controlling how the buffers are mapped to the screen) are defined for each buffer.
The CoreOptions are
You can lock each of these CoreOptions individually. You can do this
either when starting Cthugha for example with --display lock:up
or when Cthugha is running: Press o
to the a list of the current
CoreOptions, select the one you would like to lock and press l
.
You can use the function keys (starting from F5
) to get lists of
the possible values of all the CoreOptions.
You can set a lot of options for Cthugha. When starting Cthugha searches a lot of places for options (in the given order):
/usr/local/lib/cthugha-L/cthugha.ini
~/.cthugha.auto
This is the file created when you press the
a
key or if you specify the --save
option.
~/.cthugha.ini
./cthugha.ini
LIB_DIR/cthugha.ini
LIB_DIR is specified by the parameter --path
Cthugha reads all the ini files, but options in later files override option in more general files. The format of the entries is very much the same, as in the X11 resource database.
The general form is: cthugha.OPTION: VALUE
. Where OPTION
is the same as the long option name. For options you can only turn on or
off VALUE
should be one of on
, off
,
yes
, no
, 1
, 0
.
For some examples see cthugha.ini.eg
, or ~/.cthugha.auto
the file generated automatically if you press 'a' when Cthugha is running.
For a (short) list use cthugha --help
.
Mose of the options can also
be used in a negative form to disable the feature. This is simply done
by including a no-
in front of the options.
When giving the options at the command line, you can use abbreviations
(like --no-ins
as short for --no-install
).
If you don't specify a special input source, Cthugha uses the DSP device with the the current mixer settings. Cthugha does not change the settings back after exit. You have to do that manually if you want.
You should specify at least one source of input. Where you do that
(ini-file or command line) does not matter. But if no sound source is
given, it might happen that Cthugha does not get the sound even if you
specified a volume with programs like mixer
.
-x, --no-sound
-N, --network HOST[:PORT]
cthugha-server
running at HOST
. If the connection
should get lost you can reconnect by pressing n
.
You can specify the port number used by the server. You should not need
to specify that (only if you changed it with --srv-port
).
--play NAME
Cthugha can play .wav files directly and by using external programs also
MOD files and MPEG Layer 3 files. To play .mod and .mp3 files
xmp
, mpg123
and l3dec
are currently supported.
The type of the file is identified by the extension only.
If you don't want to use the programs supported the following is
possible: NAME
might be a fifo file, so you can so things like
mkfifo fifo.wav cat something.wav > fifo.wav & xcthugha --play fifo.wav
The old options --exec
, --mod
, ... are no longer needed.
--silent
--play
, but not to play it.
--once, --loop
-v, --rate N
N
. The default rate is set to 44000Hz.
-2, --stereo, -1, --mono
--snd-format FMT
8bit signed
, 8bit
unsigned
, 16bit signed le
, 16bit signed be
,
16bit unsigned le
or 16bit unsigned be
.
You usually don't need to change this option.
--snd-method M
M
is a number from 0 to 3. Lower
values correspond to more sophisticated sound reading methods. You can
try this method if Cthugha has problems with reading the sound.
--snd-sync
--snd-fragments N
--dev-dsp DEV
/dev/dsp
, but on
some systems it might be /dev/audio
.
--snd-buffer B
--dev-cd DEV
DEV
--cd-stop
--cd-random
--cd-loop
--cd-eject
-c, --track N
N
. This option does not
change the volume used for the CD. So you also also have to use the
--cd
parameter.
--dev-mixer DEV
DEV
--mixer DEV:VOL
DEV
to volume VOL
.
Note that things like "bass" or "treble" are also mixer "devices".
-L, --line VOL
VOL
. This is a shortcut for
--mixer line:VOL
.
-M, --mic VOL
VOL
. This is a shortcut
for --mixer mic:VOL
.
-C, --cd VOL
VOL
. This is a shortcut for
--mixer cd:VOL
.
Cthugha automatically changes the way the data is displayed to the screen after some time, and after special events. All of this features work independently from another.
Setting a timevalue to 0 disables the corresponding feature. You can
specify all the times in 1/100th of a second or in seconds. To specify a
time in seconds you have to appends sec
after the number. So the
following two are equivalent: --time 4.2sec
and --time 420
.
-l, --lock
--little
--time
and
--random
and enable this option. This way you get a constant
change, but no chaos.
-T, --min-time N
Cthugha will change the display after:
time + rand() % random.
Where time and random are given by this and the next option.
-R, --random-time N
--quite-time N
--msg-time N
-q, --quiet-file FILE
FILE
. These are messages are
display if for a long time no sound comes in.
If a line in FILE
starts with a @
then Cthugha runs
fortune
to get a message.
--min-noise N
--fire-level N
-S, --buff-size SIZE
--no-trans
--stretch
--load-on-demand
--load-late
-X, --no-use-pcx
-i, --no-ipal
-e, --no-epal
--no-object
-s, --no-flashlight
This feature was called FFT in version 0.8 of Cthugha-L.
Please use xcthugha --help
for a list of these options.
-D, --disp-mode MODE
--zoom N
--max-fps N
xcthugha
as a desktop
decoration.
-r, --sync
cthugha
to wait for a resync before the buffer
is displayed on the screen. So screen update and video refresh are
synchronized. --sync
causes a slight decrease in speed.
--disp-direct
--root
--install
--mit-shm
You should only deactivate it if
you have problems.
--full-screen
xcthugha
fill the whole screen. To do that xcthugha
fights with the window manager so I am not sure how reliable this really
is.
--panel
--position NN
--position +10+20
. The normal -geometry
option is not
working (it sets the position of the control panel).
--text-on-term
--no-decorate
--font F
--mesh-size S
--texture-quality Q
--hints H
glHints
for perspective correction and fog to fast
(better quality) or nice
(faster).
--dither
glcthugha
.
-window, --full-screen
glcthugha
in a window or full screen. This only has an effect
when using Mesa and a 3Dfx card. Running full screen is usually much
faster, while for debugging a window is very usefull.
-E, --path LIB_DIR
LIB_DIR/cthugha.ini
.
--keymap KEYMAP
KEYMAP
.
--dbl-load
--prt-file FILE
FILE.pcx
, the second is FILE.1.pcx
, the
third is FILE.2.pcx
and so on. When saving under xcthugha
the images are in Xpm format.
--no-esc
--save
${HOME}/.cthugha.auto
.
--verbose=LVL
LVL
, the
more information. The parameter is optional. Using only --verbose
sets a level of 3.
-?, --help
-W, --srv-wait
If you set a high value here cthugha-server
sends not so much data
of the network. But if the value is too high, not enough data is sent
(the clients have to wait - delays in the display). On the other hand if
you set a very low value very much data is sent - waste of resources.
--srv-port
cthugha-server
or
cthugha
/xcthugha
in server mode).
Default value is 5555. You should change this only if you have
problems. Don't forget to specify this port also for the clients
accessing the server (with --network
).
--clt-port
You can use this option to use more than one client on one machine
(e.g. xcthugha-saver
and xcthugha
at the same time).
Since version 1.4 of Cthugha-L you can define your own keyboard bindings.
#keymap name
marks the beginning of a new keymap.
There must be no white spaces after name
.
Then the keybindings are of the form key action1(param1) action2(param2) ...
.
Commenets start with an #
at the beginning of the line.
For an example of a keymap file see src/default.keymap
.
Key presses in Cthugha are handled by a series of keymaps. When one keymap can not handle the key, it is passed on to the next general one. The sequence of keymaps is depending on the current interface mode
setExtraKeymap
action)main
default
CoreOptionElement
(only for CoreOptions), OptionElement
CoreOption
for CoreOptions
Option
or Sound
, ...default
Option
for the yes/no value in each line, and to move the selectionScreen
or Flame
, ...List
default
An example keymap, that lets you select the flames by just one keypress.
#keymap main # turn on new flame keys f setExtraKeymap(flame) #keymap flame # go back to normal mode q setExtraKeymap() a flame(0) # or use the flame name: flame(clear) s flame(1) d flame(2) ...
I hear sometimes from people that Cthugha is getting no sound. I am not
sure why such things happen - I think the sound reading code (at least
when using --snd-method 1
) should work.
If there is a small audio cable (inside your computer) from your CD-ROM
to your Soundcard it should work. If there is no such connection the
only chance left is the program cdda2wav
(by Heiko
<heiko@colossus.escape.de
>). That program
reads the audio data from the CD and stores it to your
hard disk. You can then use that data with the --play
option.
The format is the same that fractint
uses. If not all color indexes
are specified then they default to black. The color values are
specified in RGB tuples (0-255), where 0 is black -- one line per color
index. Easy !
255 255 255 comments index 0 ... ... ... 255 255 255 comments color index 255
These tables (TAB files) are used to design just about any effect, without recompiling the source to Cthugha!!!
Since version 1.0 you can use the translation table in 2 different ways. Cthugha can generate the table when it is starting, or you can generate the tables in advance. The later is used for for which you don't have the source.
Some of the program to create the translation tables have quite a lot of options, experiment with them - if you create a new nice translation table send me the options you used (or the modifications to the code you made).
This is a bit technical. You need this part only if you want to write new translation-table-generation-programs (nice word, isn't it).
You generate a table, BUFF_WIDTH
xBUFF_HEIGHT
, of
integers.
The integer represents the source pixel
for this destination pixel.
In other words: The numbers specify where each pixel comes from.
e.g in a small 3x3 world, to rotate to the left.. 1, 2, 0, so pixel 1 is moved to position 0, and so on 4, 5, 3, 7, 8, 6
What kind of integers are used (short
or
long
) depends on the size of the buffer (If > 64k longs are
used). tint
and utint
are defined in cth_buffer.h
to give you the right kind of integer to use.
Read the source of some mk*.c
files to try to work out how it works, or
send me some email!
Since translation tables need quite a lot of disk space, take lots of time to load and need stretching to fit different buffer sizes, I included a new method to generate translation tables.
The generation program is activated when the translation table is
needed. It gets the desired size for the table as parameters and should
write the table to stdout. The output is just the table (always as
long
s without any header).
An additional file (.cmd
) defines the description and what
arguments are passed to the generation program. So one program can be
used to generate lots of different translation tables.
Since version 0.3 Cthugha uses an improved format for tab-files.
The new format starts
with a header (tab_header
defined in translate.h
).
You can convert (add the header) old tab-files to new ones by using
tabheader
. To display the header use tabinfo
.
Usage of tabheader
and tabinfo
:
tabheader [in-tab-file] [size-x size-y] [description] > [out-tab-file] tabinfo [tab-file]
PCX files are pictures uses by Cthugha. They are display from time to time when the display is changed. You can also force the next PCX to the screen by pressing <X>. Cthugha also uses the palette stored in a PCX file.
For information about the format of such an image, read a book about file formats. PCX is a very simple form of saving pictures, it is used mainly for historic reasons (the DOS version used it). Maybe in future versions also other file formats will be supported.
Deischinger Harald
Am Edhuegel 45
4115 Kleinzell
AUSTRIA
Please send me a postcard if you like Cthugha!
deischi@geocities.com
Please tell me also if you have problems with Cthugha, so I can (at least try to) fix them.
My private WWW address is
http://www.geocities.com/CapeCanaveral/Lab/6386
.
Sometimes you can find bug fixes under that address.
The official Cthugha home (for all operating systems) is
http://www.afn.org/~cthugha
.
You download Cthugha from both sites.
You can get Cthugha via FTP from ftp.afn.org
,
from the directory /cthugha
.
Or use (a mirror site of) sunsite.unc.edu
.
There you can Cthugha from the directory
/pub/Linux/apps/sound/lightshow
(or /pub/Linux/Incoming
just after release of a new version).
That two FTP sites and the two WWW sites are the only "official" sites of Cthugha-L.
alt.graphics.cthugha
There is not much traffic on that list - but it is not completely dead.
If you write your postcard or mail in German, please use Du (and not Sie).