05-24-2006 07:06 AM
05-24-2006 10:36 AM - edited 05-24-2006 10:36 AM
Message Edited by pallen on 05-24-2006 10:37 AM
05-24-2006 01:57 PM
The MIDI example library is using the right features of the WIN32 API. Sadly, there are only examples MIDI OUT included. I guess whoever wrote it was also aware of that getting MIDI in is a bit more complex since it requires the use of callbacks.
The USB sniffer could probably "wedge" into the stream and see data passing by, but this would only be true for a USB connected device such as yours, the M-Audio 25. MIDI however, can be received via any Windows registered interface such as a Gameport or a serial or parallel port connected MIDI interface. All of these are available using the API functionalities (you pass the dll a DeviceID associated with the specific MIDI in enabled device. To see if you have any MIDI in devices in your system you could try the API's midiInGetNumDevs which I included in the attached VI!)
/Stefan
05-29-2006 10:04 AM
Hello!
It is true that the examples that can be found on our website are MIDI Out only and that neither of them is set up to input
You can find information about calling these functions correctly from www.msdn.com, the Microsoft Developer Network. More specifically, you can refer to the following link for more information on these functions:
The toolbar on the left of the page above also contains links to the other MidiIn functions you might call.
There is no prebuilt example to do all this, but you can use the information above together with the output examples to build a VI which will accomplish what you want. For more information on calling DLL’s in LabVIEW using the Call Library Function Node, refer to the following links:
An Overview of Accessing DLLs or Shared Libraries from LabVIEW
http://zone.ni.com/devzone/conceptd.nsf/webmain/b26a875aca51c567862567ca0055ff24
Calling the Win32 SDK
http://zone.ni.com/devzone/conceptd.nsf/webmain/6ed4643f866a68f4862567ca007886d1
05-29-2006 11:23 AM - edited 05-29-2006 11:23 AM
Jimmie!
Thanks for your reply. I agree, there is good info to be found at MSDN and in the links you provided. Still, if you were to look into the description regarding calling MidiInOpen you will discover that it is returning incoming MIDI data by triggering a CALLBACK that is to be defined in the 3rd argument of the MidiInOpen-call. As far as I have learned, this callback cannot be recognized as a UserEvent by LV, hence LV is unable to capture MIDI in data from the API. What one needs to do is to create a wrapper dll that handles the API interfacing and then, upon receiving data, creates a LV UserEvent. Sadly, I am not the one to solve it because I don't do C. Anyone...HELP?! 😃
Here is some C code that does the actual API stuff. If it could be modified to also incorporate a PostLVUserEvent (right?) it would do the trick. http://www.borg.com/~jglatt/midi/software/dev/winapi/midiin.zip
/Vedeja
Message Edited by Vedeja on 05-29-2006 11:29 AM
05-30-2006 04:00 AM
Hello!
Here is some information about callbacks in DLLs and LabVIEW:
DLL CALLBACK EVENT IN LABVIEW
http://forums.ni.com/ni/board/message?board.id=170&message.id=99096&requireLogin=False
Callback from DLL file, back to Labview 6.1 event, How?
http://forums.ni.com/ni/board/message?board.id=170&message.id=24796&view=by_date_ascending&page=1
Howto pass a callback function to call library function node
http://forums.ni.com/ni/board/message?board.id=170&message.id=88974&view=by_date_ascending&page=1
They contain information that might be useful!
11-04-2006 02:54 PM
@Vedeja wrote:Dear LabViewers!I am stunned (and more importantly frustrated) over the fact that no one has, to my knowledge,ever come up with a solution to get MIDI signals into LV! Surely, there must be more than 3 or 4of us interested in the matter. So...a hero and the object for my lifelong adoration is the one whopresents me with a working solution! 😃 Obviously, I admit, I have failed in doing so myself./Stefan
11-05-2006 02:54 AM - edited 11-05-2006 02:54 AM
Larry Loga!
I will test your beta with pleasure. Just let me know where to pick it up.
/Vedeja
PS. My email is in my profile
Message Edited by Vedeja on 11-05-2006 02:57 AM
11-06-2006 06:18 PM
11-09-2006 12:09 PM