home *** CD-ROM | disk | FTP | other *** search
-
- SOUND_C.ZIP
- (Borland) C Sound Generation
-
- Pascal version by.. C Translation by..
- Nels Anderson John Gallant
- 92 Bishop Drive 1249 Cedar Creek Circle
- Framingham, MA 01701 Dayton OH 45459
-
-
-
- These notes are supplimental to the text by Nels Anderson
- describing SOUNDPAS.ARC which should be read first. The
- translation was without modification wherever possible. The
- program was split into smaller files as follows:
-
- sounder.c -- The basic section of code you would include
- with your program. This section has the
- routines to initialize the driver, the
- interrupt driver itself, and the routine to
- remove the driver.
-
- sounder.h -- The header file associated with the above.
-
- demo_c.c -- A slightly embellished version of the
- DEMO2.PAS. This is the demo program to call
- and demonstrate the use of the routines above.
-
- sounds.c -- A data file with the sample songs and sounds.
-
- sounds.h -- The header file with the names of the songs
- and sounds in the above file.
-
- sndnotes.h -- A file containing the #define's for note
- names/values.
-
- The programs are set to compile under Borland C but a switch
- is available in sounder.h to convert to a C++ compatible syntax.
- Some modification will be required if you are not using a Borland
- C compiler but I hope those changes are minor.
-
- The noninterrupt version of the Pascal programs has not been
- translated at this time. It is left as "an exercise for the
- student". (I always wanted to be able to do that!)
-
-
- WARNING: The interrupt routine does not call the routine it
- replaces when it is done. If the original routine was critical to
- maintaining the system clock for example, you should add code to
- the end of the driver (TimerInt()) to call the original routine.
- Remember that the original vector address is an interrupt routine
- and appropriate steps must be taken to treat the stack
- accordingly. One possibility is to install the old vector at an
- unused "user" vector and then call it as an interrupt. Borland
- has appropriate routines for doing this.
-
- You should also note that if a program exits without
- replacing the original vector the system is likely to crash. When
- the timer interrupt occurs, the system will branch to a
- meaningless section of memory. Your guess is as good as mine as
- to what will happen then.
-
- It is not sufficient to count on your program exiting in a
- nice way. Control-break or critical-error interrupts can take
- control of your program and cause it to exit without cleaning up
- the vector table. If you are using this code in any serious
- program then you should take steps to deal with these
- possibilities.
-
- SECOND WARNING: Since you are dealing with low level
- functions of the PC you should take additional care with your
- work. Changing the wrong vector or not removing the vector at the
- end of the program can (and will) lead to system crashes. This
- code has been checked and found to be safe and operational but it
- has been kept simple (and not bullet proof) for instructional
- purposes. The user must assume all responsibility for its use.
-
-
- As Nels said, these routines are released to the public
- domain. If (on the C version) you have comments, suggestions,
- complaints, or a good recipe for brownies you can contact me via
- CompuServe at 76170,2251 or by mail at the above address, or by
- phone at (513)-436-0232. I will not have time to solve major
- problems but I would like to help if possible.
-
- John Gallant
-
-