**************************************************************************
			 H A N D E D N E S S

		      This is important, folks!!

As far as I can remember, everything is always LEFT, RIGHT (instead of
right, left). This applies to buffers, data in general and formal
arguments to functions in the libraries. I've tried to be consistent
here, since it's very easy to screw things up in a difficult to
detach fashion (given the short latencies etc..)
**************************************************************************


ITD:	(itd < 0)  =>  left leads right

IID:	(iid < 0) => left louder than right
	abi = (l + r) / 2
	iid = r - l
	-> l = abi - (0.5 * iid)
	-> r = abi + (0.5 * iid)
	   where l and r are dbSPL
	Except for noise. For the moment, with noise waveforms, the
	abi/itd pair specifies attenuation values as follows:
	-> l = abi + (0.5 * iid)
	-> r = abi - (0.5 * iid)
	   where l and r and db attenuation, note the sign changes
	   because its db attenuation and not db spl.

stimulus duration etc:

	-------+++++++++.............................         -------+++ etc
	<-LAT-->  {aka "delay"}
	       <--DUR-->
	<-------------------EPOCH------------------->
	<-------------------------ISI------------------------>

about bits:
	Program currenly generates 12-bit stimuli, but this can easily be
	easily changed (up to a maximum of 16-bits) by changing the
	definion of RANGE at the stop of the itone.c and noise.c files.

	In general, RANGE should be defined as 2^(#bits-1), i.e. 2048 for
	12-bit waveforms. The rest of the program currently doesn't
	care.

about parameter files:
	~/.<app>config -> <app>`s last state information, don't edit
	~/.dlock_<app> -> lockfile for <app>

for INPUT and OUTPUT buffers:
	buffer[(2 * i) + 0] is the LEFT channel ith sample
	buffer[(2 * i) + 1] is the RIGHT channel ith sample

for RASTERS:
	buffer[0] = number of events in the raster
	buffer[(2 * i) + 1] = timestamp of ith event
	buffer[(2 * i) + 2] = channelstamp of the ith event

about Data files:
	all dowl datafiles (except xscope for now), must start with
	the token ";; dowl <pname>" on the first line, where <pname>
	is the id of the module that created it (e.g. itd, iid etc).
	If it's not there, misc:plotfile() won't read it, I promise!

	also, the depvar-value of -6666 ("SPONT" defined in misc.h)
	is special, and is currently used to demark a spontaneous
	activity measurment - this is a probably very bad way to do
	this, but for now it's ok.. or rather, as good as it gets.
	Whadya want for nothin'? A rubba-beeeskeeet ?

memory leaks
	There are some. Usually they are associated with stashing
	a filename away. Last time I checked they are pretty small,
	like on the order of 100-200 bytes per run.. not yet worth
	chasing down.


is_go		trip rig and stimulate via D/A and collect spikes on evt
is_goAD		trip rig and stimulate via D/A record A/D and collect spikes
is_goADonly	trip rig and record A/D only
is_rig		trip rig and collect spikes

/************************************************************************\
|*		A brief note about evt buffers				*|
|*									*|
|* short:  (2 * index + 0)   (2 * index + 1)	  			*|
|*  char:   LOW      HIGH     LOW      HIGH				*|
|*        cccccccc -------------------------------> channel stamp	*|
|*                 tttttttt tttttttt tttttttt ----> time stamp (24bits)	*|
\************************************************************************/


about db and scale factors:

	given:  s = multiplicative scale (i.e. MULT wave by this factor)
	       db = db attenuation, then,

	s = pow(10.0, -db/20.0), and,
	db = -20.0 * log10(s)

About memory usage and buffers:

	at 100khz, 2 channels of DAC, 2 channels of ADC:
	 (2bytes + 2bytes)/samples * 100K samples/sec = 400kbytes/sec
