Jump to content

Recommended Posts

Posted

hi, i would like to use a Midi keyboard just like any other user imput (mouse, keyboard). is it possible? i just need the imput midi data (in a variable, or whatever) to use it.

i've found and read the MidiUdf, and i want to thank for that, but it has midi managment functions and i cant figure out how to get the data.

thanks for help

P.S.: yes, im a little noobish ;)

Posted

no replies? not even a read-the-helpfile reply? :)

my question is simple. where do i get the midi imput data, if its possible?

thanks again, and... help me please ;)

Posted

I'm sure someone who knows about this will respond eventually. I see you have waited nearly 24 hours already. Perhaps the members who have used this UDF have not been on line lately. Give it a bit more time and if nothing happens then try contacting the author of the UDF.

Posted

yes, i've tryed it, but i need the midi imput inside autoit, as an input (ex.: do something when C4 is pressed, or get change preset, and more), i need costant monitoring of the midi input witthin the scrip.

Posted

You might need to look into the windows API calls of "winmm.dll" to seek your answers mciGetDeviceID. After you place the multimedia control into your script, the first step is accessing the MCI device. To do this, you set a number of properties. On of these properties will no doubt be your DeviceType = "Sequencer".

At the moment I am getting ready for work, if I have any free time today, I will pop back in and add some code for you.

Posted

I have an electronic drumset that can plug into the pc via USB so I will be very interested in helping figure this one out.

I just don't know about dll's yet ;)

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Posted

Good I'm glad someone has some midi equipment to test on. I don't have a thing here or at home.

These are some of the midi functions inside the winmm.dll;

midiConnect
midiDisconnect
midiInAddBuffer
midiInClose
midiInGetDevCapsA
midiInGetDevCapsW
midiInGetErrorTextA
midiInGetErrorTextW
midiInGetID
midiInGetNumDevs
midiInOpen
midiInPrepareHeader
midiInReset
midiInStart
midiInStop
midiInUnprepareHeader
midiOutCacheDrumPatches
midiOutCachePatches
midiOutClose
midiOutGetDevCapsA
midiOutGetDevCapsW
midiOutGetErrorTextA
midiOutGetErrorTextW
midiOutGetID
midiOutGetNumDevs
midiOutGetVolume
midiOutLongMsg
midiOutOpen
midiOutPrepareHeader
midiOutReset
midiOutSetVolume
midiOutShortMsg
midiOutUnprepareHeader
midiStreamClose
midiStreamOpen
midiStreamOut
midiStreamPause
midiStreamPosition
midiStreamProperty
midiStreamRestart
midiStreamStop

I dug up some code on midi input, but most of it is written in VB, C++, or some other languages. But thankfully DLLCALL structure doesn't vary much. So the first code I am looking at is;

$x = DllCall ("winmm.dll", "int", "midiInGetNumDevs")
If $x > -1 Then
    ConsoleWrite ("Number of devices detected = " & $x & @crlf)
Else
    ConsoleWrite ("No devices are detected.")
Exit
EndIf

For $i = 1 to $x
    $port = DllCall("winmm.dll", "UInt", "midiInGetDevCapsA" ,"UInt","A_Index"-1, "UInt","MidiInCaps", "UInt",50)
    ConsoleWrite ( $port & @crlf)
Next

Hopefully this code will return the number of midi devices on your system, then list the ports. It shouldn't hurt to try since we are just reading information. If you can ID your port then the next step is to open it for reading using midiInOpen function. Once successfully opened you should be able to read from the device using midiInAddBuffer depending on the data.

  Quote

I just don't know about dll's yet

Dynamic Linked Libraries or DLL is just a collection of Windows functions we can access to send and receive data. Winmm.dll contains all the Multimedia function calls. I don't know much about midi or how the winmm.dll access works. A lot is based on researching the other languages such as C++ and VB to see how they access it then apply it here to AutoIt.
Posted

thank you very much. tomorrow i'll begin testing with all those stuffs. it will be my first time handling DLLs ;) , i hope i'll figure out. thanks again.

Posted

I did some digging around and found this script for both midi input and output posted on Autohotkey.com (another scripting tool) similar to, if not a branch of AutoIt.

REMINDER: This is not an AutoIt script but very close.

  Reveal hidden contents

It is very lengthy and complexed, so your choices at this point would be; study the code and convert only what you need into AutoIt format, convert the complete code, or download the other program and use it.

  • 2 months later...
Posted

Sorry to revive this topic but I was really wondering whether you actually succeeded to write some autoit code for midi interaction already that I could use as an example. If not, then I'll have to look into DLL stuff myself, that will also be my first time :graduated:

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...