|
MIDI... AAAAAAARGH!!! |
merri mestie
Member #8,117
December 2006
|
hi all, i am an allegro(noob) and i'm trying to put some midi under my game. Now the problem is: this just doesn't work!! This is my code:
Now, this just DOESN't work. My pc just can play midi normaly (i think, with windows media player and other players), i even can make midifiles with a composer program (sybelius), but allegro... I mean the program runs normaly, but i can't hear anithing. Can someone plz help me? i ve been searching for days without any result |
Simon Parzer
Member #3,330
March 2003
|
You need install_timer() before install_sound(...), I think. Because the Allegro sound system depends on the Allegro timer. detect_midi_driver(MIDI_AUTODETECT); detect_digi_driver(DIGI_AUTODETECT); These are useless. Some error checking would also be good, like if (install_sound(DIGI_AUTODETECT,MIDI_AUTODETECT,NULL) != 0) { allegro_message("ERROR: Couldn't initialize sound hardware!"); }
And please leave the "AAAAAAARGH!!!" out if you start a thread again, even if you are frustrated. Instead you could write something like "can't get it to work", that would sound much better. |
merri mestie
Member #8,117
December 2006
|
i have put install_timer() in the file, but it still doesn't work. sorry for the aargh btw |
Simon Parzer
Member #3,330
March 2003
|
OK, then add some error checking! if (install_sound(DIGI_AUTODETECT,MIDI_AUTODETECT,NULL) != 0) { allegro_message("ERROR: Couldn't initialize sound hardware!"); }
midi = load_midi("ff1menu.mid"); if (!midi) { allegro_message("ERROR loading MIDI!"); } That way you see where it fails. And be sure to do install_timer() BEFORE install_sound(). |
merri mestie
Member #8,117
December 2006
|
I now have this code:
but i still can't hear nothing:-/. I just get a black window, like always, but i don't get any error messages.:o can plz someone help me |
Albin Engström
Member #8,110
December 2006
|
I tested your code and it worked, strange... post some information about the hardware/software you use. |
Jonatan Hedborg
Member #4,886
July 2004
|
try it with another midi file
|
Arthur Kalliokoski
Second in Command
February 2005
|
Do the allegro examples allegro/examples/exmidi.c and allegro/tests/testmidi.c work? They all watch too much MSNBC... they get ideas. |
|