User Tools

Site Tools


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&()
        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 for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
listing_20the_20midi_20output_20devices.txt · Last modified: 2018/04/15 13:33 by richardrussell