From: Mike McLean Newsgroups: comp.os.msdos.djgpp Subject: Re: Playing Midi in allegro Date: 19 Nov 1997 23:26:00 -0700 Organization: Primenet Services for the Internet Lines: 37 Message-ID: <3473D845.73E8B87E@primenet.com> References: <34738705 DOT 1F8CB3B4 AT primenet DOT com> <3473965C DOT 6DA9 AT nic DOT smsu DOT edu> <650h5h$q62$2 AT news DOT ox DOT ac DOT uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk George Foot wrote: > > Here are some small but significant corrections to what Tony O'Bryan wrote: > > #include > > int main(int argc, char *argv[]) > { > MIDI *MissionHandler; /* need to keep track of resources */ > > allegro_init(); /* must initialize Allegro first */ > install_timer(); /* must install the timer before using MIDIs */ > install_sound(DIGI_AUTODETECT /* or DIGI_NONE */, MIDI_AUTODETECT, argv[0]); > install_keyboard(); /* so that we can wait for a keypress later on */ > > MissionHandler = load_midi("mission.mid"); > play_midi(MissionHandler,1); > > while (!keypressed()); /* wait for a keypress, otherwise it will stop immediately! */ > > return 0; /* successful exit */ > } > > Can I refer you to ex16.c, which is a pretty minimal example of using > MIDI files? It also has frills like freeing up the MIDI file on exit, > and checking for errors when loading the file and installing the sound > drivers. > > Needless to say, all the functions used above are well documented in > the documentation -- look them up for more details. Especially, look > up install_timer() and learn which Allegro components need it before > they'll work! ;) > > -- > george DOT foot AT merton DOT oxford DOT ac DOT uk thanks for the help, it works now :)