User Tools

Site Tools


listing_20the_20midi_20output_20devices

This is an old revision of the document!


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 for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
listing_20the_20midi_20output_20devices.1522502367.txt.gz · Last modified: 2018/03/31 13:19 by 127.0.0.1