home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ Games Programming
/
CPPGAMES.ISO
/
mt
/
readme2
< prev
next >
Wrap
Text File
|
1990-04-01
|
6KB
|
242 lines
Source Code Disk
From 'MIDI Sequencing in C', Jim Conger, M&T Books, 1989.
PLEASE do not distribute copies of this disk.
Copies are available from M&T Books, 501 Galveston Dr., Redwood,
City, CA, 94063. Phone 800-533-4372, 800-356-2002 in California.
Terms:
You are free to use and modify the source code on this disk for
any and all purposes. The only restriction is that you are asked
to acknowledge the book 'MIDI Sequencing In C' in both the
software's display and in the documentation for any software that
is publicly or privately distributed and which contains program
code from the book.
Disclaimer:
The Author and Publisher make no warranty of any kind, expressed
or implied, with regard to these programs or the documentation
contained in the book. The Author and Publisher shall not be
liable in any event for incidental or consequential damages in
connection with, or arising out of, the furnishing, performance
or use of these programs.
Contents:
README2 This file.
MT.C C program source code files.
MTRC1.C
MTRC2.C
MTRC3.C
MTRC4.C
MTED1.C
MTED2.C
MTED3.C
MTSC1.C
MTSC2.C
MTSC3.C
MTSC4.C
MTUT1.C
MTUT2.C
FILEFUNC.C
INSTALL.C
MAKESONG.C
BULDMENU.C
MT_TO_MF.C
MF_TO_MT.C
MIO401.ASM Assembly language file for MPU-401 interfacing.
MIO401.OBJ Already assembled .OBJ file for MIO401, medium memory model.
SCREENF.H Header files.
STANDARD.H
MT.H
MTSCREEN.H
MTDECLAR.H
FILEFUNC.H
MPU401.H
MTSC.H
INSTALL.H
VIDEO.H
INPUTF.C C source code for screenf.lib video library functions.
VIDEOFNC.C
CHAIN.C
WRITSCRN.C
INSTALL.MK5 Microsoft 5.x MAKE files.
MT.MK5
SCREENF.MK5
MMAKEALL.BAT Batch file to compile all programs in one shot - Microsoft.
MT.TMK Turbo C 2.0 MAKE files.
SCREENF.TMK
INSTALL.TMK
TMAKEALL.BAT Batch file to compile all programs in one shot - Turbo C.
MTOBJ Response file for MT.TMK, lists all .OBJ files.
MT1.SCR Screen files.
MT2.SCR
MT3.SCR
MT4.SCR
MT5.SCR
MT6.SCR
INSTALL.SCR
MTHELP1.SCR
MTHELP2.SCR
MTHELP3.SCR
MTHELP4.SCR
MTHELP5.SCR
MTHELP6.SCR
MTHELP7.SCR
MTHELP8.SCR
Note that the Microsoft .MK5 files assume that the environment variables are
set to locate the compiler library files. Here is a typical set:
PATH C:\C\BIN;C:\DOS;C:\ASM\MAC
SET INCLUDE=C:\C\INCLUDE
SET LIB=C:\C\LIB
The Turbo C .TMK files assume that the DOS SUBST command has been used to
have the L: drive point to the compiler library area. An example of how to
do this is:
In CONFIG.SYS:
files=20
buffers=32
lastdrive=z
In a batch file run before compiling with Turbo C:
subst l: \turboc\lib
path \dos;\asm\mac
cd \turboc
--------------------------------------------------------------------------
Revisions 1, March 1990
Minor differences between the Roland MPU-401 MIDI interface and the
Music Quest interface have caused the MT sequencer to hang the computer at
the end of a record session. This problem can be avoided with a few
changes to the source code. As the modified source code works fine
on the Roland interface, these changes will be added to future distribution
disks sold by M&T books.
Here are the changes needed to use the MT sequencer with Music Quest's
MIDI interface boards:
1) In MIO401.ASM, line 8. Increase the size of the TRIES counter to give
the MIDI interface more time to respond:
---------- Original:
TRIES EQU 0FFH ;MAXIMUM TRIES ON GETTING RESPONSE FROM 401
---------- Change to:
TRIES EQU 0FFFH ;MAXIMUM TRIES ON GETTING RESPONSE FROM 401
2) In MTRC4.C, line 138, change the repeat_cmd() function so as to not
swollow ACK messages sent out late from the interface.
---------- Original:
int
repeat_cmd401(int n) /* determined command send - max tries = 10 */
{
int i, j, m;
char buf[SCRNWIDE], nbuf[10];
for (i = 0; i < 10; i++){
m = sendcmd401(n);
if (m != -1)
return(m);
else{
for (j = 0; j < 10; j++){
getdata(); /* clear any stray data from input */
}
}
}
strcpy(buf, "Error in sending command ");
itoa(n, nbuf, 16);
strcat(buf, nbuf);
strcat(buf, " hex. (repeat_cmd401)");
writeword(buf, 1, g_text_char_v, g_emph_attrib);
return(-1);
}
---------- Change to:
int
repeat_cmd401(int n) /* determined command send - max tries = 10 */
{
int i, j, m;
char buf[SCRNWIDE], nbuf[10];
for (i = 0; i < 10; i++){
m = sendcmd401(n);
if (m != -1)
return(m);
if ((m = getdata()) != -1) /* check for delayed ack */
return(m) ;
}
if (!g_trace_on)
{
strcpy(buf, "Error in sending command ");
itoa(n, nbuf, 16);
strcat(buf, nbuf);
strcat(buf, " hex. (repeat_cmd401)");
writeword(buf, 1, g_text_char_v, g_emph_attrib);
}
return(-1);
}
3) Modify MTRC2.C to force termination of the record process after a
keypress. This avoids the program hanging if an ALL_END (0xFC) message
is not detected.
---------- Line 157, orignial:
if (first == -1){ /* get401() returns -1 on keypress */
c = getch();
if (c == ESC || c == ' ')
repeat_cmd401(STOP_REC); /* tell MPU to stop recording */
first = get401(); /* cont. record until ALL_END rcvd */
}
---------- Change to:
if (first == -1){ /* get401() returns -1 on keypress */
c = getch();
if (c == ESC || c == ' '){
repeat_cmd401(STOP_REC); /* tell MPU to stop recording */
first = 0;
second = ALL_END;
goto forcedstop;
}
}
---------- Line 192, original:
store(nextnode, 2, first, second, 0, 0);
---------- change to:
forcedstop: store(nextnode, 2, first, second, 0, 0);
This just lables the line with the name "forcedstop".
Jim Conger