delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/18/18:15:23

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: MIDI Programming
Date: Sun, 18 Jan 1998 18:57:14 +0000
Organization: None
Distribution: world
Message-ID: <QQfHQIAKClw0Ew73@talula.demon.co.uk>
References: <34c23f1b DOT 0 AT news DOT thefree DOT net>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 30
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Charles Crawshaw writes:
>I am trying to write a program which plays a MIDI file. I have got the 
>MIDI file specifications and I know how to send and recieve values to 
>and from the MPU401 on the soundblaster card. However I'm not sure just 
>what I'm sposed to send from the midi file and what needs to be 
>ignored.

This subject is really offtopic for a djgpp newsgroup! But since you are
here...

To play a MIDI file on the MPU interface is very easy since you just
have to dump the contents of the file to the card at the appropriate
time. You do have to parse the file contents and interpret the MIDI
messages in order to know how long they are (otherwise there is no way
to distinguish between messages and time delay values) but apart from
that you don't need to do anything special to the data.

But, what sort of soundcard do you have? Although all SB16 or above
cards include an MPU interface, this is normally just a raw connection
to the MIDI output socket, which isn't much good unless you have an
external synth connected to that. If you want to use the internal synth
from your soundcard you will need to find some specs for the OPL2 and
OPL3 FM chips, which are a great deal more complex to program. The
midi.c and adlib.c files from Allegro might be a good place to start
with this...


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019