home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.6
/
ffcollection-1-6-1993-02.iso
/
ff_disks
/
211-240
/
ff_228
/
glib
/
tx81z.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-26
|
8KB
|
237 lines
/*
* GLIB - a Generic LIBrarian and editor for synths
*
* TX81Z routines for Patch parameters
*/
#define OVERLAY1
#include "glib.h"
#include <ctype.h>
char *visnum(), *visonoff(), *vism3num(), *viswave(), *vismono();
char *visdx1a(), *vistxwave(), *vistxsft();
char *vistxf1(), *vistxf2(), *vistxf3(), *vistxf4();
char *visfx(), *visfix1(), *visfix2(), *visfix3(), *visfix4();
extern int Dopmap[];
/* This array contains arbitrary screen labels */
struct labelinfo Ltx81z[] = {
5,0," O Dcy Lev Dcy De Out Amp Eg Key Key EG",
6,0," P Atk 1 1 2 Rls Wav Freq tun Lvl Vel Mod Bia Rat Scl Sft Fix/Ratio",
7,0," - --- --- --- --- --- --- ----- --- --- --- --- --- --- --- --- ---------",
8,0," 1",
9,0," 2",
10,0," 3",
11,0," 4",
17,0,"-------------------------+",
18,0,"N = set name q = quit |",
19,0,"K = incr J = decr |",
20,0,"space = play auto-note |",
21,0," |",
22,0,"Auto-Note: |",
23,0," |",
-1,-1,NULL
};
/* This array defines all the editable parameters. */
struct paraminfo Ptx81z[] = {
"autopitch", "Pitch",22, 11, 22, 17, visnum, 0, 127, 60, 0,
"autovol", "Vol", 23, 0, 23, 4, visnum, 0, 127, 63, 0,
"autodur", "Dur", 23, 8, 23, 12, visnum, 1, 20, 5, 0,
"autochan", "Chan", 23, 16, 23, 21, visnum, 1, 16, 1, 0,
"op1attack", NULL, -1, -1, 8, 6, visnum, 0, 31, 0, 0,
"op1decay1", NULL, -1, -1, 8, 10, visnum, 0, 31, 0, 0,
"op1level1", NULL, -1, -1, 8, 14, visnum, 0, 15, 0, 0,
"op1decay2", NULL, -1, -1, 8, 18, visnum, 0, 31, 0, 0,
"op1release", NULL, -1, -1, 8, 22, visnum, 0, 31, 0, 0,
"op1wave", NULL, -1, -1, 8, 26, vistxwave, 0, 7, 0, 0,
"op1freq", NULL, -1, -1, 8, 30, vistxf1, 0, 878, 0, 0,
"op1detune", NULL, -1, -1, 8, 36, vism3num, 0, 6, 0, 0,
"op1outlevel", NULL, -1, -1, 8, 40, visnum, 0, 99, 0, 0,
"op1velocity", NULL, -1, -1, 8, 44, visnum, 0, 7, 0, 0,
"op1ampmod", NULL, -1, -1, 8, 47, visonoff, 0, 1, 0, 0,
"op1egbias", NULL, -1, -1, 8, 52, visnum, 0, 7, 0, 0,
"op1keyrate", NULL, -1, -1, 8, 56, visnum, 0, 3, 0, 0,
"op1keyscale", NULL, -1, -1, 8, 60, visnum, 0, 99, 0, 0,
"op1egsft", NULL, -1, -1, 8, 63, vistxsft, 0, 3, 0, 0,
"op1fix", NULL, -1, -1, 8, 69, visfix1, 0, 1, 0, 0,
"op2attack", NULL, -1, -1, 9, 6, visnum, 0, 31, 0, 0,
"op2decay1", NULL, -1, -1, 9, 10, visnum, 0, 31, 0, 0,
"op2level1", NULL, -1, -1, 9, 14, visnum, 0, 15, 0, 0,
"op2decay2", NULL, -1, -1, 9, 18, visnum, 0, 31, 0, 0,
"op2release", NULL, -1, -1, 9, 22, visnum, 0, 31, 0, 0,
"op2wave", NULL, -1, -1, 9, 26, vistxwave, 0, 7, 0, 0,
"op2freq", NULL, -1, -1, 9, 30, vistxf2, 0, 878, 0, 0,
"op2detune", NULL, -1, -1, 9, 36, vism3num, 0, 6, 0, 0,
"op2outlevel", NULL, -1, -1, 9, 40, visnum, 0, 99, 0, 0,
"op2velocity", NULL, -1, -1, 9, 44, visnum, 0, 7, 0, 0,
"op2ampmod", NULL, -1, -1, 9, 47, visonoff, 0, 1, 0, 0,
"op2egbias", NULL, -1, -1, 9, 52, visnum, 0, 7, 0, 0,
"op2keyrate", NULL, -1, -1, 9, 56, visnum, 0, 3, 0, 0,
"op2keyscale", NULL, -1, -1, 9, 60, visnum, 0, 99, 0, 0,
"op2egsft", NULL, -1, -1, 9, 63, vistxsft, 0, 3, 0, 0,
"op2fix", NULL, -1, -1, 9, 69, visfix2, 0, 1, 0, 0,
"op3attack", NULL, -1, -1, 10, 6, visnum, 0, 31, 0, 0,
"op3decay1", NULL, -1, -1, 10, 10, visnum, 0, 31, 0, 0,
"op3level1", NULL, -1, -1, 10, 14, visnum, 0, 15, 0, 0,
"op3decay2", NULL, -1, -1, 10, 18, visnum, 0, 31, 0, 0,
"op3release", NULL, -1, -1, 10, 22, visnum, 0, 31, 0, 0,
"op3wave", NULL, -1, -1, 10, 26, vistxwave, 0, 7, 0, 0,
"op3freq", NULL, -1, -1, 10, 30, vistxf3, 0, 878, 0, 0,
"op3detune", NULL, -1, -1, 10, 36, vism3num, 0, 6, 0, 0,
"op3outlevel", NULL, -1, -1, 10, 40, visnum, 0, 99, 0, 0,
"op3velocity", NULL, -1, -1, 10, 44, visnum, 0, 7, 0, 0,
"op3ampmod", NULL, -1, -1, 10, 47, visonoff, 0, 1, 0, 0,
"op3egbias", NULL, -1, -1, 10, 52, visnum, 0, 7, 0, 0,
"op3keyrate", NULL, -1, -1, 10, 56, visnum, 0, 3, 0, 0,
"op3keyscale", NULL, -1, -1, 10, 60, visnum, 0, 99, 0, 0,
"op3egsft", NULL, -1, -1, 10, 63, vistxsft, 0, 3, 0, 0,
"op3fix", NULL, -1, -1, 10, 69, visfix3, 0, 1, 0, 0,
"op4attack", NULL, -1, -1, 11, 6, visnum, 0, 31, 0, 0,
"op4decay1", NULL, -1, -1, 11, 10, visnum, 0, 31, 0, 0,
"op4level1", NULL, -1, -1, 11, 14, visnum, 0, 15, 0, 0,
"op4decay2", NULL, -1, -1, 11, 18, visnum, 0, 31, 0, 0,
"op4release", NULL, -1, -1, 11, 22, visnum, 0, 31, 0, 0,
"op4wave", NULL, -1, -1, 11, 26, vistxwave, 0, 7, 0, 0,
"op4freq", NULL, -1, -1, 11, 30, vistxf4, 0, 878, 0, 0,
"op4detune", NULL, -1, -1, 11, 36, vism3num, 0, 6, 0, 0,
"op4outlevel", NULL, -1, -1, 11, 40, visnum, 0, 99, 0, 0,
"op4velocity", NULL, -1, -1, 11, 44, visnum, 0, 7, 0, 0,
"op4ampmod", NULL, -1, -1, 11, 47, visonoff, 0, 1, 0, 0,
"op4egbias", NULL, -1, -1, 11, 52, visnum, 0, 7, 0, 0,
"op4keyrate", NULL, -1, -1, 11, 56, visnum, 0, 3, 0, 0,
"op4keyscale", NULL, -1, -1, 11, 60, visnum, 0, 99, 0, 0,
"op4egsft", NULL, -1, -1, 11, 63, vistxsft, 0, 3, 0, 0,
"op4fix", NULL, -1, -1, 11, 69, visfix4, 0, 1, 0, 0,
"algorithm", "Algorithm~l~l~l~l~l~l~l~l~l~d=============", 1, 49, 1, 61, visdx1a, 0, 7, 0, 0,
"feedback", "Feedback", 13, 33, 13, 45, visnum, 0, 7, 0, 0,
"transpose", "Transpose", 14, 33, 14, 45, visnum, 0, 45, 0, 0,
"lfospeed", "LFO Speed", 15, 33, 15, 45, visnum, 0, 99, 0, 0,
"lfodelay", "LFO Delay", 16, 33, 16, 45, visnum, 0, 99, 0, 0,
"lfowave", "LFO Wave", 17, 33, 17, 45, viswave, 0, 3, 0, 0,
"lfosync", "LFO Sync", 18, 33, 18, 45, visonoff, 0, 1, 0, 0,
"pitchbend", "Pitch Bend", 19, 33, 19, 45, visnum, 0, 12, 0, 0,
"portatime", "Port. Time", 20, 33, 20, 45, visnum, 0, 99, 0, 0,
"portmode", "Port. Mode", 21, 33, 21, 45, visnum, 0, 1, 0, 0,
"portfoot", "Port. Foot", 22, 33, 22, 45, visonoff, 0, 1, 0, 0,
"susfoot", "Sus. Foot", 23, 33, 23, 45, visonoff, 0, 1, 0, 0,
"playmode", "Mono/Poly", 13, 55, 13, 74, vismono, 0, 1, 0, 0,
"amoddepth", "Amp Mod Depth", 14, 55, 14, 74, visnum, 0, 99, 0, 0,
"amodsens", "Amp Mod Sense", 15, 55, 15, 74, visnum, 0, 3, 0, 0,
"pmoddepth", "Pitch Mod Depth", 16, 55, 16, 74, visnum, 0, 99, 0, 0,
"pmodsens", "Pitch Mod Sense", 17, 55, 17, 74, visnum, 0, 7, 0, 0,
"modprange", "Mod Pitch Range", 18, 55, 18, 74, visnum, 0, 99, 0, 0,
"modarange", "Mod Amp Range", 19, 55, 19, 74, visnum, 0, 99, 0, 0,
"breathprange", "Breath Pitch", 20, 55, 20, 74, visnum, 0, 99, 0, 0,
"breatharange", "Breath Amp", 21, 55, 21, 74, visnum, 0, 99, 0, 0,
"breathpbias", "Breath Pitch Bias", 22, 55, 22, 74, visnum, 0, 99, 0, 0,
"breathegbias", "Breath EG Bias", 23, 55, 23, 74, visnum, 0, 99, 0, 0,
"reverbrate", "Reverb Rate", 13, 11, 13, 24, visnum, 0, 7, 0, 0,
"fcpitch", "FC Pitch", 14, 11, 14, 24, visnum, 0, 99, 0, 0,
"fcamp", "FC Amp", 15, 11, 15, 24, visnum, 0, 99, 0, 0,
NULL, NULL, -1, -1, -1, -1, visnum, 0, 0, 0, 0
};
extern int *txindex;
extern int txleng;
char *
vistxwave(v)
{
static char txbuff[3] = "W ";
txbuff[1] = v + '1';
return(txbuff);
}
char *visfix1(v) { return(visfx(1,v)); }
char *visfix2(v) { return(visfx(2,v)); }
char *visfix3(v) { return(visfx(3,v)); }
char *visfix4(v) { return(visfx(4,v)); }
char *visfx(n,v)
{
static int lastfx[] = { 0, -1, -1, -1, -1 };
char buff2[8];
int fqindex;
if ( lastfx[n] != -1 && lastfx[n] == v )
goto nochange;
lastfx[n] = v;
sprintf(buff2,"op%dfreq",n);
fqindex = parmindex(buff2);
if ( v == 0 )
P[fqindex].p_max = txleng-1;
else
P[fqindex].p_max = 247;
if ( P[fqindex].p_val > P[fqindex].p_max )
P[fqindex].p_val = P[fqindex].p_max;
showparam(fqindex,0);
nochange:
if ( v == 0 )
return("ratio");
else
return("fixed");
}
char *
vistxsft(v)
{
switch(v){
case 0: return("off");
case 1: return("48");
case 2: return("24");
case 3: return("12");
}
return("??");
}
extern int txfreq[];
char *
vistxq(v)
{
static char fbuff[8];
int f, n1, n2;
txinit();
f = txfreq[txindex[v]];
n1 = f/100;
n2 = f%100;
sprintf(fbuff,n2<10?"%d.0%d":"%d.%d",n1,n2);
return(fbuff);
}
char *
visfq(v)
{
static char fixbuff[8];
sprintf(fixbuff,"%-5d",v+8);
return(fixbuff);
}
char *
visnfix(n,v)
{
char buff[8];
int fx;
sprintf(buff,"op%dfix",n);
fx = getval(buff);
if ( fx == 0 )
return(vistxq(v));
else
return(visfq(v));
}
char *vistxf1(v) { return(visnfix(1,v)); }
char *vistxf2(v) { return(visnfix(2,v)); }
char *vistxf3(v) { return(visnfix(3,v)); }
char *vistxf4(v) { return(visnfix(4,v)); }