Here are some sample "client" programs that utilize the
socket connection in RTcmix to schedule interactive events.
You must start the RTcmix instrument running before invoking
these, otherwise they won't find anything listening on socket
1102.  It's a good idea to kill these client apps before you kill
the RTcmix instrument, otherwise the socket lingers for a minute
or two (and you get that annoying "bind: socket already in use"
error message when you try to restart the RTcmix instrument).
You should also note that RTcmix intruments fork, so that
if they terminate abnormally you might wind up with a child process
that doesn't get killed -- be sure to kill all instances of
an instrument if it does dump core or some such nastiness.

If you look at the source for these, you will notice that
they all connect to a socket and then start shoving "sockdata"
structures into it.  "sockdata" is defined in ../Minc/sockdefs.h.
Here is the definition:

struct sockdata {
	char name[100];		/* the cmix command name */
	double p[MAXDISPARGS];	/* the p-fields */
	int n_args;		/* number of p-fields used */
	};

It's simple to fill -- just put the scorefile command in the "name"
field, put the p-field values in the "p" array and set "n_args"
appropriately.  Easy as pie!

These can connect to the localhost, or work across a network (I was
able to 'play' a machine at Princeton from Columbia -- wheeeeeeee!).


Here's what these guys do, and how to run them:

1.  arpeggiate -- looks up notes in an array and sends 'em out.
To run this, do the following from this directory:

	in one window, type

		../insts/STRUM/STRUM -i < ../insts/STRUM/SS8.sco

	in another, type

		arpeggiate

	after that and fill in the name of the host you started
	the STRUM process on.

You can modify the parameters in "../insts/STRUM/SS8.sco" to see
how it behaves differently.  Give it a few seconds to start up --
I put a pretty big lag time on it because I like to run this as
I do things like type this README file, etc.

2.  happykeys -- play STRUM notes from the ASCII keyboard, plus
demonstrate how the -n flag works with the socket.  To run this, do
the following from this directory:

	in one window, type

		../insts/STRUM/STRUM -i -n

	in another, type

		happykeys

	after that and fill in the name of the host you started
	the STRUM process on.  Then start typing away at the keyboard!

3.  crudeLooch -- quick mock-up of the good ole NeXT "Looching"
program.  To run this, do the following from this directory:

	in one window, type

		../insts/WAVETABLE/WAVETABLE -i < ../insts/WAVETABLE/WW6.sco

	in another, type

		crudeLooch

	after that and fill in the name of the host you started
	the WAVETABLE process on.  Go dog go!

4.  In the "motif" subdir, there is a goofy application that sends
data to the IIR program.  Start it as you did the others, and use
the "II5.sco" file in the IIR instrument directory.  Speak into
the microphone, and as you click in the window the center frequency
and bandwidth of a single IIR reson peak will get set depending
on the location of each mouse click.


Some of these programs will probably crash after awhile.  I have
run "crudeLooch" for hours, though.


have fun!

brad

PS -- the stuff in the "tests" subdir is just junk, I'll remove it
eventually.
