Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

MIDI IN support in AutoHotkey


  • Please log in to reply
66 replies to this topic
Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I believe everything what is needed to add midi input is in the midimon.c program found at midiutilies.zip

Thanks for pointing that out. It looks a lot simpler than I'd feared. I guess it's a natural tendancy to fear the unknown. I had this same reluctance about adding joystick support, but Rajat helped demonstrate that it's not too difficult.

Therefore, I've added this to the to-do list and hope to get to it someday. If others who read this have an interest in midi support, please post here so that I can get an idea of how many would use it.

If someone is interested I could try to define exactly the midi part, so the developer who makes it someday (chris?) doesn't have to think about it much.

This might be of help to me and would probably result in it getting done sooner. One thing that might give you some ideas is to look at how joystick support is implemented in the code. Perhaps something similar could be done to support Midi hotkeys (or at least a command such as GetKeyState to query the status of a Midi dial or key).

One thing that can be tested in one minute is how much the exe size grows when adding this midi support, throwing in midimon.c inside and compiling the project.

It shouldn't grow that much as long as the code uses Windows API calls and nothing huge from the C library, which I suspect is the case.

Thanks for all the info and encouragement.

julian
  • Guests
  • Last active:
  • Joined: --
Hello Chris,

I would like to have midi support, too! Take a midified guitar and rock the render-farm.

Seriously, a lot of cool stuff would be possible with that. Which then very soon would also require MIDI output.

Cool soft you write!

Best,
Julian
Native Instruments - Berlin

hamoid
  • Members
  • 19 posts
  • Last active: Nov 06 2006 10:45 AM
  • Joined: 17 Mar 2005
Hi, I haven't forgotten about this MIDI idea, but didn't have time yet. In a few weeks? I have a friend who is a programmer and could help me do it.

By the way... this is funny... One time I did a party at my place in Graunstr. (Wedding) and there was someone from Native Instruments, maybe it was you Julian?

We live in a small planet :)

daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005
Here's some more info on MIDI:

Article on VB project

From the sources offered there, I discovered that the Windows dll winmm.dll (MCI API DLL) can be used for this (and more)...

MSDN Article

More info on the MIDI specification
Posted Image mirror 1mirror 2mirror 3ahk4.me • PM or Posted Image

Json44
  • Guests
  • Last active:
  • Joined: --
I would also love to see MIDI support in AHK. There are many people amongst the computer music community that NEED a program like this for use with MIDI controllers and VST instruments.

A feature that would be required would be to select a MIDI out port. This would be necessary so any MIDI data from the controller that isn't being interpreted by AHK could be passed on.

(It would be useless to have AHK reading from my MIDI keyboard to automate mouse clicks on panels/buttons, only to not able to actually play the instrument because all the other MIDI data isn't being sent back out.)

jtbalogh
  • Members
  • 35 posts
  • Last active: Oct 24 2006 06:57 PM
  • Joined: 05 Feb 2006
A midiin to keyboard script is interesting. A convenient approach is to avoid using a buffer which is complicated. Just run a midiin function to wait for each midi command and run a script. If there is too much data or the computer is slow and we loose some info while waiting for a script to finish running, then too bad. Unfortunately, if too many messages are lost though, then this feature looses its appeal.

Luckily, midi output is not crucial if a third-party midi program can remain the main program that receives midi in and sends midi out. Autohotkey could just share the midi in to detect some midi information. Scripts could then trigger the third-party program to add effects to the midi output or open files and templates that setup the program.

No big deal if the priority is low to make a midi output for midi thru / soft thru applications. I will continue to use my cheap midi thru hardware, or use soft thru in the third-party program.

hamoid
  • Members
  • 19 posts
  • Last active: Nov 06 2006 10:45 AM
  • Joined: 17 Mar 2005
New ideas:

1. daonlyfreez wrote about winmm.dll. One could use DllCall() to call that library, using http://msdn.microsoft.com/library/defau ... inopen.asp (winmm.dll manual) as a reference.

2. I've been learning Processing ( http://www.processing.org ). It's a small language that compiles into Java and has a MIDI library. Processing can create a server on any port / connect to local and remote servers. So one could do a small Processing program that listens to MIDI IN and communicates with AHK using a server (following the WinLIRC example found in the manual). Twisted but probably would work.

3. Someone who knows C can create and compile a tiny program with 3 text boxes (showing last midi channel, key and velocity) in 5 minutes. From AHK we could read those controls. Not the best approach (because AHK must ask at intervals if something arrived through MIDI) but at least quick to develop.

I got no time now, but maybe someone wants to try :)

Flip
  • Guests
  • Last active:
  • Joined: --
I've started using the program Midi Tranlator for this. You can get it at www.bome.com.
If you are using Midi you might also look into Midi OX. Very handy midi remaper/converter.

I've had success using midi keyboards for general functions, but havn't figured out how to make use of knobs and sliders yet. Any Ideas for how to make use of these controlers? I'm afriad my coding skills are shocking (AHK is really my first language and I've only had it for a a few days)

What Would be really swell is to get a midi learn function going on AHK GUIs
Sigh, so much to learn :wink:

I started getting in to this as a means of making better live music but have been utterly blown away by the potential here for any and all computer use.
:D

bitcloud
  • Guests
  • Last active:
  • Joined: --
So, from those midi utilities, has anyone managed to get "SendMidi" (from http://www.sreal.com...midi-utilities/)
to work?

I want to have AHK send a midi signal through to bomes, and I can concieve of doing this via one off "sendmidi.exe" program runs, but I really can't understand the correct syntax, and how to send the signal through to a specific device...

any clues? (or any other ways you can think of to get AHK to send a midi signal?)

Bitcloud
  • Guests
  • Last active:
  • Joined: --
By the way,
The way its going, I'm surprised this forum isn't abuzz.

AHK & Bome have the market sewn up for what is literally going to be the next boom in DJing/Live music the world over. Bome's got his eye on the prize, but AHK is frankly a better product in its scope and depth.

Midi support for AHK would be a god send...

fridemar
  • Guests
  • Last active:
  • Joined: --
Dear

* autohotkey community
* diigo social bookmark and annotation community
* furl, del.icio.us, yahoo myweb users

to maximize the benefit of the idea for all interested peers, I would like to put your attention on this simple, but powerful idea:

I guess there are millions of midi kb users, who could use their favorite kb (it's the piano keyboard!!) to do all their typing and controlling of their pc.

The piano kb (due to its touch- and time sensibility) is much more subtle than the ordinary pc kb, and what is more: allowing a better audio feedback.

Besides that, a midi piano kb allows chord inputs, a way to emulate steno machines, that cost more than a pc.

A touch sensitive midi piano kb costs under 100$ and not over 1000$ as some steno machines.
So even people, that currently don't have a midi piano kb would love to acquire some, as soon as a small (user modifiable) autohotkey script for midi input is available.

fridemar
Let's amplify each other's light

PS.: Did I mention, that this way there is less clutter on the desktop of musical active people and more piano skill training, while doing standard pc activities.

fridemar
  • Members
  • 16 posts
  • Last active: Oct 27 2008 12:27 AM
  • Joined: 16 Aug 2006
eagerly awaiting email notification ... for more amplification :-)

The idea is also brought to http://www.mail-arch... ... 07757.html .

The interested community aware programmer(s) for this marvel together with the environment, e.g. autohotkey or powerpro, etc., will get (at least) my PR support with pointing a dedicated www.metamidi.net to their download page, as soon as possible. We can dedicate this domain to the topic:

***Midi Kb as a PC keyboard replacement***.

I'll bookmark/annotate this to all resp. social bookmarking communities at hand.
http://aboutUs.org/fridemar
Let's amplify each other's light :-)

daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005
Anybody been working on this?

I am trying Midi Translator now, and liking it, but I would really like to be able to do this from within AutoHotkey directly.

A good example of the possibilities of Midi as a controlling 'language' can be viewed here:

Video with Kid Beyond (3:00+). Watch him controlling - in this case - his performance software with his footpedals. What he demonstrates is a one-man-looping-performance, nothing really special (you might have seen street artists doing similar things - usually guitarists - with hardware looping devices), but it shows off nicely what level of control many would like to accomplish (and is possible) with Midi.

Now, a footpedal is a nice example of an unobtrusive extra controller for your PC, but there are many - even exotic - midi controllers out there. Drumpads (just hit it), breath-controllers (just, well, breathe), slider boxes (slide them), knob boxes (turrrrrrrnnnn) and numerous midi-fied instruments (guitars, woodwinds, violins etcet.)...

Or, you might consider this exotic variant :p

Here's a nice list of links to controllers (dig deeper, and you might find very exotic variants, e.g. MIT did some very interesting experiments)
Posted Image mirror 1mirror 2mirror 3ahk4.me • PM or Posted Image

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Go try Cycling 74, MAX/MSP Sound programming language.

It is initialy designed to present graphical programming lang for MIDI but now you can use it for synthesis and graphics (see Jitter addon to MAX/MSP)

Preaty easy to do what you want. You have in tutorial just the way you want it
Posted Image

daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005
Hi majkinetor,

I know there are many work-arounds, and MAX is a longstanding DSP synthesizing etcet. language software, and - in fact - I'm glad you are mentioning it - it is good, but I'm looking for a way to capture MIDI data directly in AHK (probably by DLLCalls).
Posted Image mirror 1mirror 2mirror 3ahk4.me • PM or Posted Image