rtmix is a cmix application which will play two soundfiles
simultaneously and put separate envelopes on each.  To make it
you need to have cmix.o and genlib.a made from the cmix distribution.
In the Makefile these are located in /musr/bin/cmix.o and 
/musr/lib/genlib.a, but you can just edit this to reflect
your local configuration.

the file rtmixdata explains how to write a script.
These are the basic commands

openfile1()	open first soundfile
openfile2()	open second soundfile	
setfile1()	position first file	
setfile2()	position second file	
pan1()		set pan position for first (mono) file
pan2()		set pan position for second (mono) file		
setline1()	draw envelope for first file		
setline2()	draw envelope for second file
stuff()		set number of lookahead buffers and gain for files
playmix()	play section of mix.

The rtmixdata file shows the arguments for each of these functions.		
The way I like to run this program is to create a data file,
read it into the pasteboard (either select/copy, or write a program
to do it), then invoke rtmix and paste the file into the
application.  This way you can fire up the mix and just
have repeated calls to playmix to play all or part of a file.
Under these conditions, however, you sometimes get a segmentation
error after a while.  I'm not sure why this happens but I will
figure it out when I grow up.

P.S. one of my students, Kent Dickey, wrote a similar program, 
which has a different logic.  His program is a lot more flexible
and I'll post it as soon as it is ready to go.

Both of these programs could benefit from a good GUI.  Perhaps
someone else can do this.

The maximum you seem to be able to get with this program is
two stereo 44k files at the same time.  If there is a lot of
network disk activity you will get interruptions, and it also
doesn't work too well from optical disk.  You need to be able
to sustain about 400k bytes per second from a hard disk.

Kents program is designed so that you can play lots of files
at the same time, given the 2-44k stereo limit (e.g. 8 22k mono).
My program only allows you to play two files at any given time.
He's much smarter than I am.


Paul Lansky
