Results 1 to 3 of 3

Thread: midiOut API - change instrument

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Michigan
    Posts
    2

    Question

    I have created a program to simply playa single MIDI note, I will later add several to play songs. I have so far been able to play a note as well as a song and it works very well, however, I am stuck with the Grand Piano! I would like to know how to change the instrument as well as (if possible) get a list of instruments.

    ==

    ==Form1
    Dim hMIDI, MIDIMSG As Long Private Sub Command1_Click()
    midiOutOpen hMIDI, 0, 0, 0, 0
    MIDIMSG = 144 + (60 * 256) + (127 * 65536) + 0
    midiOutShortMsg hMIDI, MIDIMSG
    midiOutClose hMIDI
    End Sub

    ==The equation (I found this from Microsoft corp @ http://support.microsoft.com/support.../Q181/3/60.asp)
    MIDIMSG = &H90 + (intNote * &H100) + (intVolume * &H10000) + intChannel
    midiOutShortMsg hMIDI, MIDIMSG

    ==Module1
    Declare Function midiOutClose Lib "winmm.dll" (ByVal hMidiOut As Long) As Long
    Declare Function midiOutOpen Lib "winmm.dll" (lphMidiOut As Long, ByVal uDeviceID As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long
    Declare Function midiOutShortMsg Lib "winmm.dll" (ByVal hMidiOut As Long, ByVal dwMsg As Long) As Long

    ==

    Thank you for your time and help!
    Last edited by Dougs3761; Apr 2nd, 2001 at 10:20 AM.
    Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width