LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Capabilities from MIDI devices in Labview

Hello, everyone, 

I was trying to queries a specified MIDI output device to determine its capabilities. 

I read about the WinAPI (Winmm.dll), and found a function, midiOutGetDevCaps.

https://msdn.microsoft.com/en-us/library/windows/desktop/dd798469(v=vs.85).aspx

MMRESULT midiOutGetDevCaps(
UINT_PTR uDeviceID,
LPMIDIOUTCAPS lpMidiOutCaps,
UINT cbMidiOutCaps
);

 

I didn't know how to implement it, anyone have any idea?

 

Sort

 

0 Kudos
Message 1 of 3
(2,551 Views)

You can use Call Library Function node in your program and call that particular dll and assign all the parameters as per the definition. Do a quick start and let us know if you get any error message. We will take it from there.

 

Mathan

0 Kudos
Message 2 of 3
(2,504 Views)

Hi, Mathan,

 

Thank you for your reply.

I use Call Library Function and call a function, midiOutGetNumDevs. It works, I can get a number of MIDI output devices present in my computer.

When I try to call midiOutGetDevCaps function to query a specified MIDI output device to determine its capabilities. I don't know how to give parameters of midiOutGetDevCaps function. Could your teach me how to give parameters for this function. Thank you.

The Syntax of C++ shows following,

 

MMRESULT midiOutGetDevCaps(
   UINT_PTR      uDeviceID,
   LPMIDIOUTCAPS lpMidiOutCaps,
   UINT          cbMidiOutCaps
);

 

Parameters

uDeviceID

Identifier of the MIDI output device. The device identifier specified by this parameter varies from zero to one less than the number of devices present. The MIDI_MAPPER constant is also a valid device identifier.

This parameter can also be a properly cast device handle.

lpMidiOutCaps

Pointer to a MIDIOUTCAPS structure. This structure is filled with information about the capabilities of the device.

cbMidiOutCaps

Size, in bytes, of the MIDIOUTCAPS structure. Only cbMidiOutCaps bytes (or less) of information is copied to the location pointed to by lpMidiOutCaps. If cbMidiOutCaps is zero, nothing is copied, and the function returns MMSYSERR_NOERROR.

0 Kudos
Message 3 of 3
(2,500 Views)