/*   SPIKETRUM (Spiked Spectrum)
This config is my first attempt.  The idea is to break the spectrum up into five equal pieces (bins).  The low frequencies are displayed in blue, the high frequencies in red, and the ones in between roughly follow the color spectrum.  The rate of movement is also controlled by frequency.  The lower frequncies move and rotate slowly, while the high frequncies move and spin more rapidly.  The average magnitude for each bin controls the brighness.  Finally, the falloff is scaled in magnitude and linewidth giving rise to the "spike" shape.  I tried this config out on three machines.  It ran fine on my 500MHz PIII and my 200MHz Pentium.  However, it was very jerky on my POS (Piece of $#!+) 166MHz Cyrix.  In the comments below, I provide guidance for customizing some of the effects.

ArticFox Memories gives good descriptions of the functions used in this config, so I won't duplicate those descriptions here.

This first bit is standard setup stuff I got from some other config.
*/

Stps="47",


Durn="1.0",

widt=640,heig=480,

ConL=1,ConB=0,



/*
This is a 2-D config, so the camera and look angles are from the top looking down and are stationary.
*/

CamX="0",
CamY="0",
CamZ="30",

CmLX=".1",
CmLY="0",
CmLZ=".1",

CUpX="1",
CUpY="1",
CUpZ="0",

/*
These are the random numbers used to control movement.  The lower numbers correspond to lower froequencies implying slower movement.  The even numbers control X movement and rotation rate.  The odd numbers control Y movement.  These can be customized depending on how much movement you want.
*/

A0="rnd(.1)+.1",
A1="rnd(.1)+.1",
A2="rnd(.1)+.2",
A3="rnd(.1)+.2",
A4="rnd(.1)+.3",
A5="rnd(.1)+.3",
A6="rnd(.1)+.4",
A7="rnd(.1)+.4",
A8="rnd(.1)+.5",
A9="rnd(.1)+.5",

/*
These are the movement functions.  I chose cosines so the spike balls move quickly through the center and slow down near the edges for turnaround.
*/

B0="cos (a0 * t)",
B1="cos (a1 * t)",
B2="cos (a2 * t)",
B3="cos (a3 * t)",
B4="cos (a4 * t)",
B5="cos (a5 * t)",
B6="cos (a6 * t)",
B7="cos (a7 * t)",
B8="cos (a8 * t)",
B9="cos (a9 * t)",

/*
This is the magnitude falloff and line width scaling parameter.  Dimmer and thinner as time since the sample was taken increases.
*/

C0="1-dt",

/*
These compute the average magnitudes for the frequency bins.  The higher frequency bins are made larger than the average since these magnitudes are typically less than the lower frequencies.  Adjust these to control the relative brightness of the spike balls.
*/

C1="(fft(.05)+fft(.1)+fft(.15)+fft(.2))/4",
C2="(fft(.25)+fft(.3)+fft(.35)+fft(.4))/4",
C3="(fft(.45)+fft(.5)+fft(.55)+fft(.6))/4",
C4="(fft(.65)+fft(.7)+fft(.75)+fft(.8))/3",
C5="(fft(.85)+fft(.9)+fft(.95)+fft(1.))/2",

/*
Lines get thinner as they age.  They can be made fatter or thinner by increasing or decreasing the scaling (5).
*/

LWdt="5*c0",

/*
This parameter will control the position of the spikes around the ball.
*/

D0="s * 10 * PI",

/*
These are used to cut out the five parts of the spectrum.
D1 corresponds to 0 < s < .2, 
D2 corresponds to .2 < s < .4, 
and so on.  Pretty slick, huh!
*/

D1="sqwv(s*5)",
D2="sqwv(s*10-3)",
D3="sqwv(s*10-5)",
D4="sqwv(s*10-7)",
D5="sqwv(s*10-9)",

/*
This is where the colors are assigned to the center of the ball.  The blue ball corresponds to d1.  The next ball has the blue and green components controlled by d2.  The green ball corresponds to d3.  The yellow/orange/brown ball has green and red controlled by d4.  Finally the red ball corresponds to d5.  The square root function increases the value so that the center of the ball is brighter than the spikes.
*/

LvlB="d1*sqrt(c1)+d2*sqrt(c2)",
LvlG="d2*sqrt(c2)+d3*sqrt(c3)+d4*sqrt(c4)",
LvlR="d4*sqrt(c4)+d5*sqrt(c5)",

/*
Spike colors are assigned just like the ball centers.  The c0 parameter causes the spike to get dimmer as it gets farther from the center.
*/

B="(d1*c1+d2*c2)*c0",
G="(d2*c2+d3*c3+d4*c4)*c0",
R="(d4*c4+d5*c5)*c0",

/*
This is where the spikes are formed, moved, and rotated.  The d1*(dt*cos(d0+4*b0)+b0) term controls the blue ball.  The d1 parameter picks the low frequency bin.  The dt parameter dictates the distance from the center of the ball.  The cos(d0+4*b0) function determines the direction from the center of the ball with b0 being the spin function.  Finally, the last b0 controls the position of the center of the ball.  Similar control is provided for the other frequncy bins by the other terms being selected using d1, d2, d3, d4, and d5, respectively.
*/

X="75*(d1*(dt*cos(d0+4*b0)+b0)+d2*(dt*cos(d0+4*b2)+b1)+d3*(dt*cos(d0+4*b4)+b2)+d4*(dt*cos(d0+4*b6)+b3)+d5*(dt*cos(d0+4*b8)+b4))",
Y="75*(d1*(dt*sin(d0+4*b0)+b5)+d2*(dt*sin(d0+4*b2)+b6)+d3*(dt*sin(d0+4*b4)+b7)+d4*(dt*sin(d0+4*b6)+b8)+d5*(dt*sin(d0+4*b8)+b9))",
Z="0",

/*
Finally, just some other pameters I took from some of the other configs.
*/

Scal="600",
ScSz=1,

Pers="300",

Vers=40

/*
Enjoy,
Daak
*/
