Mail Archives: djgpp/1998/06/18/23:46:38
Hello,
I was thinking of trying some stuff with real-time midi output, and I
made the following program to see how it works. This program
compiles, runs, installs sound, and does everything right except
actually play the note. (I got the info on the midi data from PCGPE).
Can somebody please help me out here? I'm using gcc 2.8.1, allegro
3.0, under win95.
#include <allegro.h>
main() {
unsigned char data1[] = {0xC0, 0x00}; //set piano
unsigned char data2[] = {0x90, 0x24, 0x40}; //note c3 on
unsigned char data3[] = {0x80, 0x24, 0x40}; //note c3 off
allegro_init();
install_keyboard();
if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, "") != 0)
{
printf("Error initialising sound system\n%s\n",
allegro_error);
return 1;
}
midi_out((unsigned char *) &data1, sizeof(data1));
midi_out((unsigned char *) &data2, sizeof(data2));
readkey();
midi_out((unsigned char *) &data3, sizeof(data3));
}
TIA
--
Michael Langton <langtons DOT NOTTHISBIT AT manawatu DOT gen DOT nz>
- Raw text -