How to play a MIDI file from resource file. 
Author Message
 How to play a MIDI file from resource file.

See http://www.*-*-*.com/

Quote:

>       I have a MIDI file and want to play it in my program.
>I know how to play the MIDI file from disk. But when I
>put the MIDI file into my resource file. I can't load it and
>play it anymore.

>       Does anyone know the method to play a MIDI file
>which store at resource file ?

>        Thanks in advanced.

>Regards,
>      Richie Chen.
>----------------------------------------------------
>[e?? The Phantom of the Opera]

>----------------------------------------------------



Sat, 26 Aug 2000 03:00:00 GMT  
 How to play a MIDI file from resource file.

       I have a MIDI file and want to play it in my program.
I know how to play the MIDI file from disk. But when I
put the MIDI file into my resource file. I can't load it and
play it anymore.

       Does anyone know the method to play a MIDI file
which store at resource file ?

        Thanks in advanced.

Regards,
      Richie Chen.
----------------------------------------------------
[ The Phantom of the Opera]
[ The Pentium of the Overclock]
----------------------------------------------------



Sun, 27 Aug 2000 03:00:00 GMT  
 How to play a MIDI file from resource file.

Quote:

>        I have a MIDI file and want to play it in my program.
> I know how to play the MIDI file from disk. But when I
> put the MIDI file into my resource file. I can't load it and
> play it anymore.

>        Does anyone know the method to play a MIDI file
> which store at resource file ?

>         Thanks in advanced.

> Regards,
>       Richie Chen.
> ----------------------------------------------------
> [e?? The Phantom of the Opera]

> ----------------------------------------------------

Hi,

I would like to know how to play MIDI at all.
I've searched at the 'code guru' web site and didn't find any thing
related
Can u please email me a sample code or exact URL which contains a sample
?

Thanks

Yariv



Sat, 09 Sep 2000 03:00:00 GMT  
 How to play a MIDI file from resource file.

Quote:
> Hi,

> I would like to know how to play MIDI at all.
> I've searched at the 'code guru' web site and didn't find any thing
> related
> Can u please email me a sample code or exact URL which contains a sample
> ?

> Thanks

> Yariv


I'd like to learn how to play a midi file from disk as well, will
someone please post where to look for some sample code and/or
directions?

Thanks, Erik




Sat, 09 Sep 2000 03:00:00 GMT  
 How to play a MIDI file from resource file.

have a look at this sample  MIDIplyr: Sample MIDI Player
an also the following code
-------------------------------------------------------
Rajesh Parikh
Microsoft Certified Solution Developer

-------------------------------------------------------

Playing a MIDI File
The following example opens a MIDI sequencer device, verifies that the MIDI mapper was selected as the output port, plays the MIDI file specified by the lpszMIDIFileName parameter, and closes the device after playback is complete.

// Plays a specified MIDI file by using MCI_OPEN and MCI_PLAY. Returns
// as soon as playback begins. The window procedure function for the
// specified window will be notified when playback is complete.
// Returns 0L on success; otherwise, it returns an MCI error code.
DWORD playMIDIFile(HWND hWndNotify, LPSTR lpszMIDIFileName)
{
    UINT wDeviceID;
    DWORD dwReturn;
    MCI_OPEN_PARMS mciOpenParms;
    MCI_PLAY_PARMS mciPlayParms;
    MCI_STATUS_PARMS mciStatusParms;
    MCI_SEQ_SET_PARMS mciSeqSetParms;

    // Open the device by specifying the device and filename.
    // MCI will attempt to choose the MIDI mapper as the output port.
    mciOpenParms.lpstrDeviceType = "sequencer";
    mciOpenParms.lpstrElementName = lpszMIDIFileName;
    if (dwReturn = mciSendCommand(NULL, MCI_OPEN,
        MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,
        (DWORD)(LPVOID) &mciOpenParms))
    {
        // Failed to open device. Don't close it; just return error.
        return (dwReturn);
    }

    // The device opened successfully; get the device ID.
    wDeviceID = mciOpenParms.wDeviceID;

    // Check if the output port is the MIDI mapper.
    mciStatusParms.dwItem = MCI_SEQ_STATUS_PORT;
    if (dwReturn = mciSendCommand(wDeviceID, MCI_STATUS,
        MCI_STATUS_ITEM, (DWORD)(LPVOID) &mciStatusParms))
    {
        mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
        return (dwReturn);
    }

    // The output port is not the MIDI mapper.
    // Ask if the user wants to continue.
    if (LOWORD(mciStatusParms.dwReturn) != MIDI_MAPPER)
    {
        if (MessageBox(hMainWnd,
            "The MIDI mapper is not available. Continue?",
            "", MB_YESNO) == IDNO)
        {
            // User does not want to continue. Not an error;
            // just close the device and return.
            mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
            return (0L);
        }
    }

    // Begin playback. The window procedure function for the parent
    // window will be notified with an MM_MCINOTIFY message when
    // playback is complete. At this time, the window procedure closes
    // the device.
    mciPlayParms.dwCallback = (DWORD) hWndNotify;
    if (dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY,
        (DWORD)(LPVOID) &mciPlayParms))
    {
        mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
        return (dwReturn);
    }

    return (0L);

Quote:
}

--
Quote:

>> Hi,

>> I would like to know how to play MIDI at all.
>> I've searched at the 'code guru' web site and didn't find any thing
>> related



Sun, 10 Sep 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Playing Midi File from Resource.

2. Play MIDI file as a resource

3. How to play a MIDI RESOURCE FILE?

4. Playing midi resources/files

5. Play WAV File From Resource File

6. Routines that play MIDI files...

7. Playing a midi file

8. Playing MIDI File

9. play a wav/midi file

10. playing a midi file

11. Playing and repeating a MIDI file

12. How to play a midi file???

 

 
Powered by phpBB® Forum Software