home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / mt / readme2 < prev    next >
Text File  |  1990-04-01  |  6KB  |  242 lines

  1. Source Code Disk
  2.  
  3. From 'MIDI Sequencing in C', Jim Conger, M&T Books, 1989.
  4.  
  5. PLEASE do not distribute copies of this disk.
  6.  
  7. Copies are available from M&T Books, 501 Galveston Dr., Redwood, 
  8. City, CA, 94063.  Phone 800-533-4372, 800-356-2002 in California.
  9.  
  10. Terms:
  11.  
  12. You are free to use and modify the source code on this disk for 
  13. any and all purposes.  The only restriction is that you are asked 
  14. to acknowledge the book 'MIDI Sequencing In C' in both the 
  15. software's display and in the documentation for any software that 
  16. is publicly or privately distributed and which contains program 
  17. code from the book. 
  18.  
  19. Disclaimer:
  20.  
  21. The Author and Publisher make no warranty of any kind, expressed 
  22. or implied, with regard to these programs or the documentation 
  23. contained in the book.  The Author and Publisher shall not be 
  24. liable in any event for incidental or consequential damages in 
  25. connection with, or arising out of, the furnishing, performance 
  26. or use of these programs. 
  27.  
  28. Contents:
  29.  
  30. README2          This file.
  31. MT.C             C program source code files.
  32. MTRC1.C 
  33. MTRC2.C 
  34. MTRC3.C 
  35. MTRC4.C 
  36. MTED1.C 
  37. MTED2.C 
  38. MTED3.C 
  39. MTSC1.C 
  40. MTSC2.C 
  41. MTSC3.C 
  42. MTSC4.C 
  43. MTUT1.C 
  44. MTUT2.C 
  45. FILEFUNC.C 
  46. INSTALL.C 
  47. MAKESONG.C 
  48. BULDMENU.C 
  49. MT_TO_MF.C 
  50. MF_TO_MT.C 
  51. MIO401.ASM       Assembly language file for MPU-401 interfacing.
  52. MIO401.OBJ       Already assembled .OBJ file for MIO401, medium memory model.
  53. SCREENF.H        Header files. 
  54. STANDARD.H 
  55. MT.H 
  56. MTSCREEN.H 
  57. MTDECLAR.H 
  58. FILEFUNC.H 
  59. MPU401.H 
  60. MTSC.H 
  61. INSTALL.H 
  62. VIDEO.H 
  63. INPUTF.C        C source code for screenf.lib video library functions.
  64. VIDEOFNC.C 
  65. CHAIN.C 
  66. WRITSCRN.C 
  67. INSTALL.MK5     Microsoft 5.x MAKE files.
  68. MT.MK5 
  69. SCREENF.MK5 
  70. MMAKEALL.BAT    Batch file to compile all programs in one shot - Microsoft.
  71. MT.TMK          Turbo C 2.0 MAKE files.
  72. SCREENF.TMK 
  73. INSTALL.TMK 
  74. TMAKEALL.BAT    Batch file to compile all programs in one shot - Turbo C.
  75. MTOBJ           Response file for MT.TMK, lists all .OBJ files.
  76. MT1.SCR         Screen files.
  77. MT2.SCR 
  78. MT3.SCR 
  79. MT4.SCR 
  80. MT5.SCR 
  81. MT6.SCR 
  82. INSTALL.SCR 
  83. MTHELP1.SCR 
  84. MTHELP2.SCR 
  85. MTHELP3.SCR 
  86. MTHELP4.SCR 
  87. MTHELP5.SCR 
  88. MTHELP6.SCR 
  89. MTHELP7.SCR 
  90. MTHELP8.SCR 
  91.  
  92. Note that the Microsoft .MK5 files assume that the environment variables are
  93. set to locate the compiler library files.  Here is a typical set:
  94.  
  95. PATH C:\C\BIN;C:\DOS;C:\ASM\MAC
  96. SET INCLUDE=C:\C\INCLUDE
  97. SET LIB=C:\C\LIB
  98.  
  99. The Turbo C .TMK files assume that the DOS SUBST command has been used to 
  100. have the L: drive point to the compiler library area.  An example of how to
  101. do this is:
  102.  
  103. In CONFIG.SYS:
  104.  
  105. files=20
  106. buffers=32
  107. lastdrive=z
  108.  
  109. In a batch file run before compiling with Turbo C:
  110.  
  111. subst l: \turboc\lib
  112. path \dos;\asm\mac
  113. cd \turboc
  114.  
  115. --------------------------------------------------------------------------
  116.  
  117. Revisions 1, March 1990
  118.  
  119. Minor differences between the Roland MPU-401 MIDI interface and the
  120. Music Quest interface have caused the MT sequencer to hang the computer at
  121. the end of a record session.  This problem can be avoided with a few
  122. changes to the source code.  As the modified source code works fine
  123. on the Roland interface, these changes will be added to future distribution
  124. disks sold by M&T books.
  125.  
  126. Here are the changes needed to use the MT sequencer with Music Quest's
  127. MIDI interface boards:
  128.  
  129.  
  130.  
  131. 1) In MIO401.ASM, line 8.  Increase the size of the TRIES counter to give
  132. the MIDI interface more time to respond:
  133.  
  134. ---------- Original:
  135.  
  136. TRIES   EQU     0FFH    ;MAXIMUM TRIES ON GETTING RESPONSE FROM 401
  137.  
  138. ---------- Change to:
  139.  
  140. TRIES   EQU     0FFFH   ;MAXIMUM TRIES ON GETTING RESPONSE FROM 401
  141.  
  142.  
  143.  
  144.  
  145. 2) In MTRC4.C, line 138, change the repeat_cmd() function so as to not
  146. swollow ACK messages sent out late from the interface.
  147.  
  148. ---------- Original:
  149.  
  150. int
  151. repeat_cmd401(int n)    /* determined command send -  max tries = 10 */
  152. {
  153.     int i, j, m;
  154.     char buf[SCRNWIDE], nbuf[10];
  155.     
  156.     for (i = 0; i < 10; i++){
  157.         m = sendcmd401(n);
  158.         if (m != -1)
  159.             return(m);
  160.         else{
  161.             for (j = 0; j < 10; j++){
  162.                 getdata();      /* clear any stray data from input */
  163.             }
  164.         }
  165.     }
  166.     strcpy(buf, "Error in sending command ");
  167.     itoa(n, nbuf, 16);
  168.     strcat(buf, nbuf);
  169.     strcat(buf, " hex. (repeat_cmd401)");
  170.     writeword(buf, 1, g_text_char_v, g_emph_attrib);
  171.     return(-1);
  172. }
  173.  
  174. ---------- Change to:
  175.  
  176. int
  177. repeat_cmd401(int n)    /* determined command send -  max tries = 10 */
  178. {
  179.     int i, j, m;
  180.     char buf[SCRNWIDE], nbuf[10];
  181.     
  182.     for (i = 0; i < 10; i++){
  183.         m = sendcmd401(n);
  184.         if (m != -1)
  185.             return(m);
  186.         if ((m = getdata()) != -1)        /* check for delayed ack */
  187.             return(m) ;
  188.     }
  189.     if (!g_trace_on)
  190.     {
  191.         strcpy(buf, "Error in sending command ");
  192.         itoa(n, nbuf, 16);
  193.         strcat(buf, nbuf);
  194.         strcat(buf, " hex. (repeat_cmd401)");
  195.         writeword(buf, 1, g_text_char_v, g_emph_attrib);
  196.     }
  197.     return(-1);
  198. }
  199.  
  200.  
  201. 3) Modify MTRC2.C to force termination of the record process after a
  202. keypress.  This avoids the program hanging if an ALL_END (0xFC) message
  203. is not detected.
  204.  
  205.  
  206.  
  207. ---------- Line 157, orignial:
  208.  
  209.         if (first == -1){               /* get401() returns -1 on keypress */
  210.             c = getch();
  211.             if (c == ESC || c == ' ')
  212.                 repeat_cmd401(STOP_REC); /* tell MPU to stop recording */
  213.             first = get401();       /* cont. record until ALL_END rcvd */
  214.         }
  215.  
  216. ---------- Change to:
  217.  
  218.         if (first == -1){               /* get401() returns -1 on keypress */
  219.             c = getch();
  220.             if (c == ESC || c == ' '){
  221.                 repeat_cmd401(STOP_REC); /* tell MPU to stop recording */
  222.                 first = 0;
  223.                 second = ALL_END;
  224.                 goto forcedstop;
  225.             }
  226.         }
  227.  
  228.         
  229. ---------- Line 192, original:
  230.  
  231.                 store(nextnode, 2, first, second, 0, 0);
  232.  
  233. ---------- change to:
  234.  
  235. forcedstop:     store(nextnode, 2, first, second, 0, 0);    
  236.  
  237. This just lables the line with the name "forcedstop".
  238.  
  239.  
  240.  
  241.  
  242.             Jim Conger