home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume6 / glib / part03 / tx81z.mnu < prev    next >
Encoding:
Text File  |  1989-05-14  |  6.1 KB  |  256 lines

  1. /* $Id: tx81z.mnu,v 1.6 89/05/06 17:13:45 lee Exp $
  2.  * GLIB - a Generic LIBrarian and editor for synths
  3.  *
  4.  * TX81Z routines for Patch parameters
  5.  * Tim Thompson
  6.  * modifications: Greg Lee
  7.  * $Log:    tx81z.mnu,v $
  8.  * Revision 1.6  89/05/06  17:13:45  lee
  9.  * rel. to comp.sources.misc
  10.  * 
  11.  */
  12.  
  13. #define OVERLAY1
  14.  
  15. #include "glib.h"
  16. #include <ctype.h>
  17.  
  18. char *visnum(), *visonoff(), *vism3num(), *viswave(), *vismono();
  19. char *visdx1a(), *vistxwave(), *vistxsft();
  20. char *vistf1(), *vistf2(), *vistf3(), *vistf4();
  21. char *visfx(), *visfx1(), *visfx2(), *visfx3(), *visfx4();
  22. extern int Dopmap[];
  23.  
  24. #define RESERVESIZE 0
  25.  
  26. /* This array contains arbitrary screen labels */
  27. struct labelinfo Ltx81z[] = {
  28. #MENU
  29.  
  30.                                                  Algorithm   %
  31.                                                  =============
  32.  
  33.  
  34.  O       Dcy Lev Dcy               De  Out     Amp Eg  Key Key EG
  35.  P   Atk  1   1   2  Rls Wav  Freq tun Lvl Vel Mod Bia Rat Scl Sft Fix/Ratio
  36.  -   --- --- --- --- --- --- ----- --- --- --- --- --- --- --- --- ---------
  37.  1    %   %   %   %   %   %   %     %   %   %  %    %   %   %  %     %
  38.  2    %   %   %   %   %   %   %     %   %   %  %    %   %   %  %     %
  39.  3    %   %   %   %   %   %   %     %   %   %  %    %   %   %  %     %
  40.  4    %   %   %   %   %   %   %     %   %   %  %    %   %   %  %     %
  41.  
  42.            Reverb Rate  %        Feedback    %         Mono/Poly          %
  43.            FC Pitch     %        Transpose   %         Amp Mod Depth      %
  44.            FC Amp       %        LFO Speed   %         Amp Mod Sense      %
  45.                                  LFO Delay   %         Pitch Mod Depth    %
  46. -------------------------+       LFO Wave    %         Pitch Mod Sense    %
  47. N = set name  q = quit   |       LFO Sync    %         Mod Pitch Range    %
  48. K = incr      J = decr   |       Pitch Bend  %         Mod Amp Range      %
  49. space = play auto-note   |       Port. Time  %         Breath Pitch       %
  50.                          |       Port. Mode  %         Breath Amp         %
  51. Auto-Note: Pitch %       |       Port. Foot  %         Breath Pitch Bias  %
  52. Vol %   Dur %   Chan %   |       Sus. Foot   %         Breath EG Bias     %
  53. #END
  54. -1,-1,NULL
  55. };
  56.  
  57. struct paraminfo  Ptx81z[] =  {
  58. /*
  59. NAME        TYPE    POS    MAX    OFFSET    MASK    SHIFT    ADHOC
  60.  */
  61. #O algorithm    dx1a    %%    7    0
  62. #O op1attack    num    %%    31    0
  63. #O op1decay1    num    %%    31    0
  64. #O op1level1    num    %%    15    0
  65. #O op1decay2    num    %%    31    0
  66. #O op1release    num    %%    31    0
  67. #O op1wave    txwave    %%    7    0
  68. #O op1freq    tf1    %%    878    0
  69. #O op1detune    m3num    %%    6    0
  70. #O op1outlevel    num    %%    99    0
  71. #O op1velocity    num    %%    7    0
  72. #O op1ampmod    onoff    %%    1    0
  73. #O op1egbias    num    %%    7    0
  74. #O op1keyrate    num    %%    3    0
  75. #O op1keyscale    num    %%    99    0
  76. #O op1egsft    txsft    %%    3    0
  77. #O op1fix    fx1    %%    1    0
  78. #O op2attack    num    %%    31    0
  79. #O op2decay1    num    %%    31    0
  80. #O op2level1    num    %%    15    0
  81. #O op2decay2    num    %%    31    0
  82. #O op2release    num    %%    31    0
  83. #O op2wave    txwave    %%    7    0
  84. #O op2freq    tf2    %%    878    0
  85. #O op2detune    m3num    %%    6    0
  86. #O op2outlevel    num    %%    99    0
  87. #O op2velocity    num    %%    7    0
  88. #O op2ampmod    onoff    %%    1    0
  89. #O op2egbias    num    %%    7    0
  90. #O op2keyrate    num    %%    3    0
  91. #O op2keyscale    num    %%    99    0
  92. #O op2egsft    txsft    %%    3    0
  93. #O op2fix    fx2    %%    1    0
  94. #O op3attack    num    %%    31    0
  95. #O op3decay1    num    %%    31    0
  96. #O op3level1    num    %%    15    0
  97. #O op3decay2    num    %%    31    0
  98. #O op3release    num    %%    31    0
  99. #O op3wave    txwave    %%    7    0
  100. #O op3freq    tf3    %%    878    0
  101. #O op3detune    m3num    %%    6    0
  102. #O op3outlevel    num    %%    99    0
  103. #O op3velocity    num    %%    7    0
  104. #O op3ampmod    onoff    %%    1    0
  105. #O op3egbias    num    %%    7    0
  106. #O op3keyrate    num    %%    3    0
  107. #O op3keyscale    num    %%    99    0
  108. #O op3egsft    txsft    %%    3    0
  109. #O op3fix    fx3    %%    1    0
  110. #O op4decay1    num    %%    31    0
  111. #O op4attack    num    %%    31    0
  112. #O op4level1    num    %%    15    0
  113. #O op4decay2    num    %%    31    0
  114. #O op4release    num    %%    31    0
  115. #O op4wave    txwave    %%    7    0
  116. #O op4freq    tf4    %%    878    0
  117. #O op4detune    m3num    %%    6    0
  118. #O op4outlevel    num    %%    99    0
  119. #O op4velocity    num    %%    7    0
  120. #O op4ampmod    onoff    %%    1    0
  121. #O op4egbias    num    %%    7    0
  122. #O op4keyrate    num    %%    3    0
  123. #O op4keyscale    num    %%    99    0
  124. #O op4egsft    txsft    %%    3    0
  125. #O op4fix    fx4    %%    1    0
  126. #O feedback    num    %%    7    0
  127. #O playmode    mono    %%    1    0
  128. #O reverbrate    num    %%    7    0
  129. #O transpose    num    %%    45    0
  130. #O amoddepth    num    %%    99    0
  131. #O fcpitch    num    %%    99    0
  132. #O lfospeed    num    %%    99    0
  133. #O amodsens    num    %%    3    0
  134. #O fcamp    num    %%    99    0
  135. #O lfodelay    num    %%    99    0
  136. #O pmoddepth    num    %%    99    0
  137. #O lfowave    wave    %%    3    0
  138. #O pmodsens    num    %%    7    0
  139. #O lfosync    onoff    %%    1    0
  140. #O modprange    num    %%    99    0
  141. #O pitchbend    num    %%    12    0
  142. #O modarange    num    %%    99    0
  143. #O portatime    num    %%    99    0
  144. #O breathprange    num    %%    99    0
  145. #O portmode    num    %%    1    0
  146. #O breatharange    num    %%    99    0
  147. #O autopitch    num    %%    127    -60
  148. #O portfoot    onoff    %%    1    0
  149. #O breathpbias    num    %%    99    0
  150. #O autochan    num    %%    16    -1    *5
  151. #O autodur    num    %%    20    -5    *5
  152. #O autovol    num    %%    127    -63
  153. #O susfoot    onoff    %%    1    0
  154. #O breathegbias    num    %%    99    0
  155. NULL,NULL,-1,-1,-1,-1,visnum,0,0,0,0
  156. };
  157.  
  158.  
  159. extern int *txindex;
  160. extern int txleng;
  161.  
  162. char *
  163. vistxwave(v)
  164. {
  165.     static char txbuff[3] = "W ";
  166.     txbuff[1] = v + '1';
  167.     return(txbuff);
  168. }
  169.  
  170. char *visfx1(v) { return(visfx(1,v)); }
  171. char *visfx2(v) { return(visfx(2,v)); }
  172. char *visfx3(v) { return(visfx(3,v)); }
  173. char *visfx4(v) { return(visfx(4,v)); }
  174.  
  175. char *visfx(n,v)
  176. {
  177.     static int lastfx[] = { 0, -1, -1, -1, -1 };
  178.     char buff2[8];
  179.     int fqindex;
  180.  
  181.     if ( lastfx[n] != -1 && lastfx[n] == v )
  182.         goto nochange;
  183.  
  184.     lastfx[n] = v;
  185.     sprintf(buff2,"op%dfreq",n);
  186.     fqindex = parmindex(buff2);
  187.     if ( v == 0 )
  188.         P[fqindex].p_max = txleng-1;
  189.     else
  190.         P[fqindex].p_max = 247;
  191.     if ( P[fqindex].p_val > P[fqindex].p_max )
  192.         P[fqindex].p_val = P[fqindex].p_max;
  193.     showparam(fqindex,0);
  194. nochange:
  195.     if ( v == 0 )
  196.         return("ratio");
  197.     else
  198.         return("fixed");
  199. }
  200.  
  201. char *
  202. vistxsft(v)
  203. {
  204.     switch(v){
  205.     case 0: return("off");
  206.     case 1: return("48");
  207.     case 2: return("24");
  208.     case 3: return("12");
  209.     }
  210.     return("??");
  211. }
  212.  
  213. extern int txfreq[];
  214.  
  215. char *
  216. vistxq(v)
  217. {
  218.     static char fbuff[8];
  219.     int f, n1, n2;
  220.  
  221.     txinit();
  222.     f = txfreq[txindex[v]];
  223.     n1 = f/100;
  224.     n2 = f%100;
  225.     sprintf(fbuff,n2<10?"%d.0%d":"%d.%d",n1,n2);
  226.     return(fbuff);
  227. }
  228.  
  229. char *
  230. visfq(v)
  231. {
  232.     static char fixbuff[8];
  233.  
  234.     sprintf(fixbuff,"%-5d",v+8);
  235.     return(fixbuff);
  236. }
  237.  
  238. char *
  239. visnfix(n,v)
  240. {
  241.     char buff[8];
  242.     int fx;
  243.  
  244.     sprintf(buff,"op%dfix",n);
  245.     fx = getval(buff);
  246.     if ( fx == 0 )
  247.         return(vistxq(v));
  248.     else
  249.         return(visfq(v));
  250. }
  251.  
  252. char *vistf1(v) { return(visnfix(1,v)); }
  253. char *vistf2(v) { return(visnfix(2,v)); }
  254. char *vistf3(v) { return(visnfix(3,v)); }
  255. char *vistf4(v) { return(visnfix(4,v)); }
  256.