Here are two "packages" that bundle a lot of commonly-used operations
in RTcmix.  Most of the interfaces included in this hierarchy make
use of these.  To use them, just #include the appropriate .h file
and link the corresponding .o file with the final executable.

The files contain the following functions:

RTsockfuncs.c -------

int RTsock(char *ihost, int rtsno)
   RTsock takes an internet hostname and the number of an RTcmix socket
   (specified by "... -s n" when invoking an instrument -- 0 is the default)
   and returns an open socket connection.  The RTcmix sockets count up from
   MYPORT (1102), defined in sockdefs.h


int RTopensocket(int socket, char *binaryname)
   RTopensocket - starts up the relevant cmix binary with the relevant socket 
   number (again counted up from MYPORT) and returns the process id of the
   relevant cmix process


void RTkillsocket(int socket, int pid)
   RTkillsocket closes the relevant cmix socket and kills off the relevant
   cmix process and its pid+1 child


void RTsendsock(const char *cmd, int theSock, int nargs, ...)
   RTsendsock takes an RTcmix scorefile command as the first arg, then
   the socket (returned by RTsock), the number of p-fields, and then
   the p-fields themselves (as doubles)


void RTtimeit(float interval, void *func)
   RTtimeit takes a floating point number of seconds (interval) and a pointer
   to a void-returning function and sets up a timer to call that function
   every interval seconds.  Setting interval to 0.0 should disable the
   timer



randfuncs.c -------


void srrand(unsigned x)
   srrand() seeds the rrand() and brrand() random number generators


void tsrand()
   tsrand() calls srrand() with time of day as a seed


float rrand()
   rrand() -- modification of unix rand() to return floating point values 
   between + and - 1.0


float brrand()
   brrand() -- a modification of unix rand() to return floating point values
   between 0.0 and 1.0


float gaussian()
   gaussian - gaussian random distribution with fixed boundaries (0-1)
   (by luke)


float cauchy()
   cauchy - cauchy random distribution with fixed boundaries (0-1)
   (by luke)


float linlo()
   linlo() - lower -limit weighted random numbers
   (by luke)


float linhi()
   linhi() - upper-limit weighted random numbers
   (by luke)


float triangle()
   triangle -- triangle-curve of  random numbers between 0 and 1
   (by luke)
