
G-Force
Extras



G-Force As A Standalone Application

	G-Force for Macintosh includes a standalone application that visualizes 
from sound-input.  Because I still have to learn DirectSound and I know nothing 
about QuickTime in windows, there's currently no Windows standalone application.


Background

-	There's 4 main elements that affect what you see in the G-Force window, 
and they correspond to each of the 4 configs folders:  Waveshapes, DeltaFields, 
ColorMaps, and Particles.
-	A waveshape is something that turns a short sound clip into lines and 
dots to be drawn (ie, something graphical).  
-	Next, imagine a chalk drawing on a chalkboard.  Someone hands you a big 
list, and it's a list of commands that all resemble, "find the point (a, b) on 
the chalkboard, erase what's there, and in its place draw what you have drawn 
at point (c, d)."  If you follow every command on the list in order, you're 
left with a different picture on your chalkboard than when you started.  In 
effect, you've transformed  your initial image into a new one.  In G-Force, 
something I call a DeltaField acts like this list of commands, except that 
instead of chalkboards, it's meant for the G-Force window.  A DeltaField is a 
recipe that makes a new image or "frame" from an existing one.  Like a recipe, 
it's meant to be used over and over.  If you open one up, you'll just see it 
contains two equations that express a `source' coordinate as that depends on a 
destination (within the next frame)
-	Whenever G-Force is running, it has one waveshape loaded and one 
deltafield loaded at any given time.  It's constantly repeats 4 steps: 
1) 	Use the current deltafield on the current frame to get a new image/frame
2)	Sample some sound and give it to the current waveshape
3)	Draw the output from that waveshape on top of the new frame supplied 
from step 1
4)	Show the frame on the screen
-	G-Force will randomly shuffles though waveshapes, deltafields, and 
colormaps (see the WInt, DInt, and CInt prefs)
-	A ColorMap a list of 256 RGB colors.  G-Force does it's work on an 
"8-bit" image offscreen that you never see, meaning that each pixel within 
G-Force has has a value from 0 to 255.  When G-Force needs to draw a pixel, it 
uses the current ColorMap to lookup the RGB color for each pixel value.  In 
other words, a ColorMap is a one-way translator that turns pixel index values 
into RGB colors able to be drawn.
-	Particles are the things that randomly appear and disappear every few 
seconds in G-Force.  They're the extra things you see flying around in the 
G-Force window now and then.  They're the same thing as waveshapes except that 
G-Force treats particles a little differently: Only one waveshape (or a morph 
of two) is ever being drawn at a time, while there can be one or more particles 
flying around at any given time in addition  to the current waveshape.  
Particles are just waveshapes that appear when G-Force rolls some dice and the 
dice happen to come up a certain way (see the PPrb pref below). 


Customizing G-Force

	You can customize G-Force in many ways by editing variables stored its 
preferences file.  Find and open the "G-Force Prefs" text file in your Winamp's 
plugin folder, and you can edit various flags and values that affect how 
G-Force runs.  The following list describes what each parameter does.  It's 
recommended you become comfortable with how G-Force runs before editing your 
preferences file.  Finally, if you find G-Force acting strange after you edited 
its preferences file, just throw it out and it will make a new, "factory", one.

SSvr - (Screen Saver) Number of minutes GF waits before switching to full 
screen once your PC has been left idle.  If you set this to -1, GF will never 
go full screen from being idle.  This parameter is basically used to make GF a 
screen saver.

MaxX, MaxY - (Max Dimensions/Letterbox Size) These set a limit on the pixel 
dimentions of GF.  For example, 800x600 may be too slow for your computer, but 
setting MaxY to 300 will double your framerate and you'll still have most of 
your sceen filled up.

FS_X, FS_Y - (Fullscreen Dimensions) This tells GF what fullscreen resolution 
you prefer.  When you tell GF to go fullscreen, it will use the dimentions 
specified here.  Be sure you only put sizes you know your screen can support, 
and if bad things start to happen, just stick with 640x480. 

FS_D - (Fullscreen Depth) This is the depth GF will choose when it goes 
fullscreen (choose only 8, 16, or 32).  8 and 32 bit will produce the same 
color-quality frames, but 32 will be slower because more data is moving around. 
 16 will be slightly faster than 32 but may show small decreases in color 
quality.  The only time you don't want to use 8 for FS_D is if your system is 
having problems using 8.  The 'F' key shows you the current frame rate and can 
help you discover which depth is fastest for your system.

ShwT - (Show Config Titles)  If this is 1, GF will tell you whenever its 
bringing on a new ColorMap, WaveShape, DeltaField, or Particle. 

CDur - (Console Duration) This is how many seconds GF's text console is 
displayed when GF outputs something to the console.  Remember that your frame 
rate will decrease whenever the console is visible, so it may get annoying if 
you set CDur really high (and don't have a really fast CPU) because the console 
will take such a long time to go away.

CLin - (Console Line Duration) This is how many seconds a line will remain in 
GF's console until its erased.  

TFnt - This is the text font GF will use when drawing track text.

TSze - This is the text size GF will use when drawing track text.

TPos - Tells GF how to draw track info text:
0 = Don't show track info, 
1 = Top-left corner, 
2 = Bottom-left corner, 
3 = Centered in the screen, 
5 = Random position

T? - (Track Text Start?) Each frame, GF calculates what number you have 
expressed in T?.  If it's greater than 0, GF will draw the track text, and if 
it's less than 0, GF doesn't draw the draw the track text.  This expression can 
only access 't' and 'LAST_SONG_START' (both in seconds).  Here's some examples:
"3 + LAST_SONG_START - t"  // Draw the track text for 3 secs after new song 
starts
"rnd( 1 ) - .5"            // Strobes the track text (Set TPos to 5 and TDur to 
.001)
"1"                        // Track text always drawn
"-1"                       // Track text never drawn
"t % 10 - 8"               // Draws the track text for 2 secs, then off for 8 
secs


TStr - (Track Text String) This is the text GF will display.  You can put one 
or more of the following in this string:  #TITLE#, #ARTIST#.  You can place one 
or more "\r" in the text to signify you want a new line.  Here's some examples:
"#ARTIST# - #TITLE#"
"#TITLE#\rHappy Birthday Andy"
"--== #TITLE# ==--"

TDur - (Track Text Duration) This is how many seconds GF will display the track 
text once T? is evaluated to be greater than zero.  Once T? > 0, GF will draw 
whatever is in TStr for TDur number of seconds, no matter what T? is during 
this interval.   Here's some examples: "6", "2 + rnd( 4 )", ".001" (a really 
small number of seconds like .001 is a short enough such that the text will 
draw for on only one frame).

WInt - (Waveshape Interval) Number of seconds GF uses a waveshape before 
switching to a new waveshape.  For example, if you want to see a new waveshape 
every 15 seconds, set this to 15.  In another example, you can force GF to 
always be morphing between waveshapes by setting this to 0. 

CInt - (ColorMap Interval) Number of seconds GF uses a colormap before 
switching to a new colormap.  This pref is similar to WInt and DInt.

DInt - (DeltaField Interval) Number of seconds GF uses a deltafield before 
switching to a new deltafield.  It takes a significant amount of CPU power to 
ready a deltafield for use, and GF chips away at this task each frame  (this is 
why you get a spinning cursor when you resize GF's window).  If you set DInt 
too low, GF will be unable to switch deltafields every DInt number of seconds 
because you're not giving GF enough time.  If this happens, GF will simply run 
normally until it's finished readying in oncoming deltafield.

TrHi. TrLo - (Transition Hi/Low) When GF switches waveshapes, it has to know 
how long to make the transition from one waveshape to the next waveshape.  It 
decides this length of time by picking a random number of seconds between TrLo 
and TrHi.  For example, setting TrLo to 5 and TrHi to 11 means every transition 
will never be shorter than 5 seconds or longer than 11 seconds.

NoBo - (No Border) If 1, GF will try to make its window borderless.

Kybd - If 0, GF will ignore all keystrokes.

KMap - (Key Map) This is how G-Force knows what to do when you press a certain 
key.  This param is a list of characters, and the following is a list of what 
character number does what (ex, since 'P' is the 4th character in "TLRY`SNF..", 
pressing 'Y' will trigger the 4th command, labeled below). 
01    Display Track Title
02    List the names of the currently loaded config
03    Calc the frame rate
04    Spawn New Particle
05    Toggle fullscreen
06    Toggle showing config name when loaded
07    Toggle Normalize
08    Start slideshow (all)
09    Stop/Freeze slideshow (all)
10-12 Prev/Next/Hold DeltaField
13-15 Prev/Next/Hold ColorMap
16-18 Prev/Next/Hold waveshape
19-20 Dec/Inc mag() scale
21-22 Dec/Inc Num S Steps
23    Toggle Particles
24-29 Unused
30-39 Set preset 0-9
40-49 Recall preset 0-9

MScl - (Magnitude Scale) Scales the amplitude of all music samples (x1000), so 
if most of the music you play is soft, try increasing this to 1500 or higher 
(1.5+).  See below to see how to change this in realtime using keystrokes.  You 
can increase/decrease this using the "[" and "]" keys.

Stps - (s Steps) Default number of samples in a waveshape.  This is how many 
samples are in a sound sample given to a waveshape (ie, the number of 
lines/dots in a typical waveshpe).  You can increase/decrease this using the 
"{" and "}" keys.

PPrb - (Particle Probability) Once per second, GF picks a random number from 0 
to 1 and evaluates the PPrb expression.  If this number is less than PPrb, a 
new particle is spawned/started.  NUM_PARTICLES is how many particles are 
currently running.  The PPrb must somehow use NUM_PARTICLES to decrease in 
value, or else GF will just keep spawning new particles indefinitely!  (Note 
how the default expression for PPrb has this property)

PDur - (Particle Duration) When GF spawns a new particle, it assigns it a 
lifetime/duration.  When that lifetime is up, the particle fades out.  GF uses 
PDur whenever a particle is spawned and uses the value returned as the lifetime 
(in seconds).

P_On - (Particles On)  If this is 0, GF will not automatically spawn any 
paticles on it's own (ie, this is a way to disable particles from automatically 
appearing if you don't want them to appear)

