delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/19/22:31:21

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Playing Midi in allegro
Date: Wed, 19 Nov 1997 21:01:36 -0500
Organization: Cornell University http://www.cornell.edu
Lines: 47
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <347399FF.D9838B0E@cornell.edu>
References: <34738705 DOT 1F8CB3B4 AT primenet DOT com>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0037.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mike McLean wrote:
> 
> I'm using the WIP Nov 16th version of allegro and I am trying to play 
> a midi file, the source compiles fine, but I don't get the file to 
> play. I've never tried to play midi with any version of allegro 
> before. Please help me out, and tell me what mistake(s) I am making.  
> I'm trying to better myself at programming.
> Here is the code:
> 
> #include <allegro.h>
> #include <iostream.h>
> 
> int main(void)
> {
>   load_midi("mission.mid");
>   play_midi(load_midi("mission.mid"),1);
> }

it looks like you haven't read any of the documentation. i _never_
really programmed anything using allegro, but it doesn't take more than
5 seconds on an old dx4-75 to find the following info in allegro.txt:

int allegro_init();
   Initialises the Allegro library. It doesn't actually do very much 
   except setting up some global variables, locking some memory, and 
   installing allegro_exit() as an atexit() routine, but you must call 
   it before doing anything else. Returns zero for success (at the 
   moment it can't fail, so there is not much point checking the 
   return value).

int install_timer();
   Installs the Allegro timer interrupt handler. You must do this before 
   installing any user timer routines, and also before displaying a 
   mouse pointer, playing FLI animations or MIDI music, and using any of 
   the GUI routines.

and i thought i was lazy.


-- 
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA

mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/

- Raw text -


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