1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| HMIDIOUT handle;
/* Open default MIDI Out device */
if (!midiOutOpen(&handle, 1, 0, 0, CALLBACK_NULL) )
{
fprintf(stderr,"OUVERT");
MMRESULT resultat;
/* Output the C note (ie, sound the note) */
resultat = midiOutShortMsg(handle, 0x00403C90);
switch(resultat)
{
case MMSYSERR_NOERROR:
fprintf(stderr,"ENVOYERRRRRRRRRRR");
break;
case MIDIERR_BADOPENMODE:
fprintf(stderr,"PAAAAAAASSS ENVOYER, BADOPENMODE");
break;
case MIDIERR_NOTREADY:
fprintf(stderr,"PAAAAAAASSS ENVOYER, NOTREADY");
break;
case MMSYSERR_INVALHANDLE:
fprintf(stderr,"PAAAAAAASSS ENVOYER, INVALHANDLE");
break;
default:
fprintf(stderr,"PAAAAAAASSS ENVOYER, REPONSE PAR DEFAUT");
break;
}
/* Close the MIDI device */
midiOutClose(handle);
}else
{
fprintf(stderr,"PAS OUVERT");
} |
Partager