XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

MIDI message

Last post 6/9/2008 9:46 PM by DCProven. 2 replies.
  • 5/31/2008 5:51 PM

    MIDI message

    Hi everybody,

    I'm developping a game with a synthetiser with mmsystem.h ( in C), but i don't understand everything, I just want to change the instrument but my midi message only plays PIANO everytime !!
    Someone can help me ?

     for example look at my code, I use midiOutShortMsg.

    union {
    unsigned long word;
    unsigned char data[4];
    } message;

    message.data[0] = 0x90; // MIDI note-on message (requires to data bytes)
    message.data[1] = 60; // MIDI note-on message: Key number (60 = middle C)
    message.data[2] = 100; // MIDI note-on message: Key velocity (100 = loud)
    message.data[3] = 0; // Unused parameter

    midiOutOpen(&device, midiport, 0, 0, CALLBACK_NULL);

    midiOutShortMsg(device, message.word);

    Thanks !
    (Sorry for my english)

  • 5/31/2008 6:36 PM In reply to

    Re: MIDI message

    Your question has nothing to do with XNA Game Studio or DirectX. You might try asking your question over on GameDev.net.

     

  • 6/9/2008 9:46 PM In reply to

    Re: MIDI message

    Although wildly offtopic, you need to send a program change event.

     

    Check this out: http://commonmusic.sourceforge.net/doc/dict/midi-topic.html


    HTH


    David.

    DCProven
Page 1 of 1 (3 items) Previous Next