Hello!
I'm newly registered, but I have taken a look here before. More precisely, here, a thread which helped me a lot, as I were a total beginner in working with MIDI.
My problem is that, though I don't get any errors, I don't hear any sound. The funny thing is that it has worked all right, until I tried toying around with "midiOutGetDevCaps". From that point on, no matter what I've tried, no sound, no error.
My code is this:
#include<windows.h>
#pragma comment(lib, "Winmm.lib")
#include<stdio.h>
#include<conio.h>
int main(void){
HMIDIOUT x;
if(midiOutOpen(&x,-1,NULL,NULL,CALLBACK_NULL)==MMSYSERR_NOERROR ){
printf("No error\n");
}
switch(midiOutShortMsg(x,0x9062565)){
case MMSYSERR_NOERROR:
printf("No error");
break;
case MIDIERR_BADOPENMODE:
printf("Bad open mode");
break;
case MIDIERR_NOTREADY:
printf("Busy");
break;
case MMSYSERR_INVALHANDLE:
printf("Invalid handle");
break;
}
_getch();
return 1;
}
I wonder if anyone could tell me if I'm doing something wrong and I'm not able to see it. Maybe test the code on your computer... My supposition so far is that I've messed up something about the MIDI device. Maybe you know what could have caused this. Please help me...
Later Edit:
For avoiding questions like "What have you written exactly", I mention that in the moment I've noticed the problem, I have [CTRL]+[Z]-ed until the code was exactly as when it was working. Yet, no result.