User Tools

Site Tools


listing_20the_20midi_20output_20devices

Listing the MIDI output devices

by Richard Russell, May 2006

The code below will list to the screen all the available MIDI output devices:

        DIM  moc{ \
        \    wMid{l&,h&}, \ int16
        \    wPid{l&,h&}, \ int16
        \    vDriverVersion%, \ int32
        \    szPname&(31), \ string
        \    wTechnology{l&,h&}, \ int16
        \    wVoices{l&,h&}, \ int16
        \    wNotes{l&,h&}, \ int16
        \    wChannelMask{l&,h&}, \ int16
        \    dwSupport% \ int32
        \    }
 
        SYS "midiOutGetNumDevs" TO iNumDevs%
 
        FOR i% = 0 TO iNumDevs%-1
          SYS "midiOutGetDevCaps", i%, moc{}, DIM(moc{}) TO res%
          IF res%=0 THEN
            PRINT "Device ID #";i%;": "moc.szPname&()
          ENDIF
        NEXT i%

When more than one output device is available you could adapt the code to present a list to the user from which he can make a selection.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
listing_20the_20midi_20output_20devices.txt · Last modified: 2024/01/05 00:22 by 127.0.0.1