| File | Date | Author | Commit |
|---|---|---|---|
| Makefile | 2025-04-25 |
|
[a52f9d] Latest |
| README.md | 2025-04-25 |
|
[2eaa3b] Latest |
| instruments.c | 2025-04-25 |
|
[490979] Latest |
| midiplayer.c | 2025-04-25 |
|
[490979] Latest |
| midiplayer.h | 2025-04-25 |
|
[490979] Latest |
A MIDI file player for DOS systems that uses OPL3 FM synthesis to play MIDI files through AdLib-compatible sound cards.
midiplayer [filename.mid]
The player uses OPL3 FM synthesis to generate sounds. Each MIDI instrument is mapped to a corresponding FM instrument definition with carrier and modulator settings.
Key technical aspects:
- Supports up to 18 simultaneous polyphonic notes (9 notes in OPL2 mode)
- Intelligent channel allocation for note priorities
- MIDI percussion channel (10) uses dedicated percussion instrument definitions
- Handles all standard MIDI events including pitch bend, modulation, etc.
This project includes a Makefile for easy compilation. The build process requires Docker:
# Build using the included Makefile
make
The Makefile handles all the necessary steps to create a DOS-compatible executable using the DJGPP compiler in a Docker environment, eliminating the need to install DJGPP directly on your system.
If you prefer to compile manually and have DJGPP installed, you can use:
gcc -o midiplayer midiplayer.c instruments.c -lm
This version is designed for DOS systems with OPL3-compatible sound hardware. It has several limitations:
midiplayer.c: Main program codeinstruments.c: FM instrument definitions for General MIDI instrumentsmidiplayer.h: Header file with declarations and constantsMakefile: Build configuration for Docker-based compilationMIT License
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This project is based on original QBasic/GWBasic code and adapted for C with DJGPP.