AutoHotkey Community

It is currently May 26th, 2012, 10:31 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject:
PostPosted: August 7th, 2008, 11:01 pm 
Offline

Joined: February 13th, 2008, 10:13 pm
Posts: 11
ribbet - correct - does that. Can also be made specific to a note velocity if you wish.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 8th, 2008, 4:10 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
stutter wrote:
ribbet - correct - does that. Can also be made specific to a note velocity if you wish.


This brings a whole new usefulness to those cheap MIDI piano keyboards maybe. Cheers! (I can't get around to this little project right now, but soon)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Combining MIDI output
PostPosted: August 12th, 2008, 5:30 am 
Offline

Joined: July 7th, 2008, 7:29 pm
Posts: 27
Hi

Has anyone tried combining this script with some sort of MIDI output. I've tried useing this with the library from http://www.autohotkey.com/forum/viewtop ... sc&start=0
but when ever I use MIDI input to trigger MIDI output I get an error.

Any suggestions?

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 11:58 am 
Offline

Joined: February 13th, 2008, 10:13 pm
Posts: 11
Midiox or Bomes Midi Translator - seems like you're trying to recreate applications which already exist (not that there'sanything wrong with that ... just wanted to make sure you are aware of them since they have been developed for some time, and Bomes continues to improve)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 2:51 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
stutter wrote:
Midiox or Bomes Midi Translator - seems like you're trying to recreate applications which already exist (not that there'sanything wrong with that ... just wanted to make sure you are aware of them since they have been developed for some time, and Bomes continues to improve)


Sweet! I've spent a lot of time looking for something like this Bomes. Funny that I never saw it before. Thanks for those links.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 4:30 pm 
Offline

Joined: February 13th, 2008, 10:13 pm
Posts: 11
s'ok.

MidiOx is entirely free, and the best midi monitor that I know of on a pc. Very useful tool to have. It can also translate midi messages.

Bomes has a special place in my heart. The Beta versions (at least of Pro nd Author) I believe now have multiple midi Ins and Outs, plus sending Win Messages (like Post Message), and mouse movements. It has a Mac beta too, so the only multi-platform midi translator I know of.
I know one guy that uses it to develop some very clever tools has created an editor for it in autohotkey (for his own use). It can be a little awkward sometimes, but search or ask on the forum and help is often forthcoming.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2008, 3:03 am 
Offline

Joined: July 7th, 2008, 7:29 pm
Posts: 27
Thanks for the advise.

I'm already useing MIDI ox to convert key strokes to MIDI but it's kind of annoying because I have to activate the MIDI OX window every time I wand to send a keystroke and I have to load a new profile every time I want to change MIDI Mapping.

I haven't used Bomes Midi Translator though so I'll check that out and so if its better for what I'm doing.

does anyone know why the following code doesn't work.
Code:
hModule := OpenMidiAPI()
mm6 := midiOutOpen(1)

OnExit, sub_exit
if (midi_in_Open(Cool)
ExitApp

listenCC(64, "SustainIn", 2)

return

sub_exit:
midi_in_Close()
midiOutClose(mm6)
FreeMidiAPI(hModule)
ExitApp

a::
midiOutShortMsg(mm6, "CC", 2, 64, 127)
return

SustainIn(CCNum, Vel)
{
midiOutShortMsg(mm6, "CC", 2, 64, 127)
}

#Include midi_out_lib.ahk
#Include midi_in_lib.ahk


I got the MIDI out library from http://www.autohotkey.com/forum/viewtopic.php?t=18711&postdays=0&postorder=asc&start=0

When I trigger the output with "a" it works fine but when I trigger it with my sustain pedal I get message box that says "there was error sending the MIDI event".


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: MIDI input library
PostPosted: August 15th, 2008, 11:44 am 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
orbik wrote:
Thanks for sharing your work, unfortunately offering a zip/rar package to download would simplify the download process a lot (as we all know). But we also know compared to your done work the "download work" is nothing.

Back to the topic's content: To my understanding using your MIDI input library only makes "real sense" if you use the ahk capabilities as a channel in between your midi keyboard/controller input and your midi event target/synthesizer.
    midi events from midi keyboard/controller -> ahk actions based on midi events -> results of these ahk actions (optionally you can send the midi input parallelly also to another midi target, like a synthesizer, e.g. with the help of MIDI-OX, if you want to hear what you are playing)

? What kind of ahk actions could we have. See e.g. the actions supported by nDroid, which brings up the idea of why not to connect nDroid actions also to midi event inputs?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 15th, 2008, 12:43 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Hey Orbik, I've finally downloaded the test files etc. and the main test file midi_in_lib_test is working as it should. It looks pretty simple to convert this to send text on different note input. I think I'll attempt this this morning. I was going to try Bome but I'd rather just use AHK if possible. :)

One minor note, it appears that you cannot exit the script until you deselect your midi input device, or at least I cannot, and I'm using the midi input from my M-Audio 24-96 card. When I right-click on the icon however and select 'no input' then I can exit.

So are you a mountain bike enthusiast? I used to attend 24 hour races in the US, just as a spectator. Crazy stuff! Link: http://grannygear.com/index.shtml


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 15th, 2008, 1:24 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
OK, just to inform anybody else out there as inexperienced as myself.

I set up a midi controller keyboard, connected to my computer's midi in, and loaded a VST host with a midi monitoring program; in my case Asseca's asmidimon, so I could see what the note range was and what the pitch bend and mod wheels sent. One nice thing about Asseca's vst is you can save it's output as a text file. I'm sure you can do that with lots of programs. Now I'm seeing that the file you were kind enough to provide, orbik, the worms midi key test.ahk, is working, and can be modified easily enough to use my old Evolution MIDI keyboard for something other than music. Anybody need more detail, just ask. I'll present the script shortly, not that it's anything you couldn't do. And for other novices like myself, you do have to select your midi input device, by right-clicking on the ahk icon on your systray.

As for using the pitchbend and mod wheel, I'll have to try that on another day. Be back in a little while.

Cheers, ribbet


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 15th, 2008, 1:57 pm 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
ribbet.1 wrote:
... loaded a VST host with a midi monitoring program; in my case Asseca's asmidimon ...
Did you ever use MIDI-OX for midi monitoring and more? If not, you should try it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 15th, 2008, 6:15 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
OK, I may not go further today, I actually have some paying work to do. But here are a couple things. First, here is a template I've been playing with. My Evolution MK-149 has keys mapped 36-84, and so this is basically a template for a midi controller with those keys. It's incomplete but works as is for me, I might do more to it later. My hotkeys are mapped to the white keys only in this instance.

Code:
SendMode Input
SetWorkingDir %A_ScriptDir%

OnExit, sub_exit
if (midi_in_Open(0))
   ExitApp

;--------------------  Midi "hotkey" mappings  -----------------------
listenNote(55, "space")

listenNote(36, "note36")
listenNote(37, "note37")
listenNote(38, "note38")
listenNote(39, "note39")
listenNote(40, "note40")
listenNote(41, "note41")
listenNote(42, "note42")
listenNote(43, "note43")
listenNote(44, "note44")
listenNote(45, "note45")
listenNote(46, "note46")
listenNote(47, "note47")
listenNote(48, "note48")
listenNote(49, "note49")
listenNote(50, "note50")
listenNote(51, "note51")
listenNote(52, "note52")
listenNote(53, "note53")
listenNote(54, "note54")
listenNote(55, "note55")
listenNote(56, "note56")
listenNote(57, "note57")
listenNote(58, "note58")
listenNote(59, "note59")
listenNote(60, "note60")
listenNote(61, "note61")
listenNote(62, "note62")
listenNote(63, "note63")
listenNote(64, "note64")
listenNote(65, "note65")
listenNote(66, "note66")
listenNote(67, "note67")
listenNote(68, "note68")
listenNote(69, "note69")
listenNote(70, "note70")
listenNote(71, "note71")
listenNote(72, "note72")
listenNote(73, "note73")
listenNote(74, "note74")
listenNote(75, "note75")
listenNote(76, "note76")
listenNote(77, "note77")
listenNote(78, "note78")
listenNote(79, "note79")
listenNote(80, "note80")
listenNote(81, "note81")
listenNote(82, "note82")
listenNote(83, "note83")
listenNote(84, "note84")

return
;----------------------End of auto execute section--------------------

sub_exit:
   midi_in_Close()
ExitApp

;-------------------------Miscellaneous hotkeys-----------------------
Esc::ExitApp

;-------------------------Midi "hotkey" functions---------------------
space(note, vel)
{
   if (vel)
   Send {Space down}
   else
   Send {Space up}
}

note36(note, vel)
{
   if (vel)
   Send {Enter}{Tab 2}THE WITNESS:*.{Space 2}
   ;else
   ;Send {}
}

note38(note, vel)
{
if (vel)
Send {Enter}{Tab 2}THE COURT:*.{Space 2}
}


note40(note, vel)
{
   if (vel)
   Send {Enter}{Tab 2}ATTY A:*.{Space 2}
}


note41(note, vel)
{
   if (vel)
   Send {Enter}{Tab 2}ATTY B:*.{Space 2}
}


note43(note, vel)
{
   if (vel)
   Send {Enter}{Tab 2}ATTY C:*.{Space 2}
}

note45(note, vel)
{
   if (vel)
   Send {Enter}{Tab 2}ATTY D:*.{Space 2}
}

note47(note, vel)
{
   if (vel)
   Send {Enter} {Tab 2}BY ATTY A:*. 
}

note48(note, vel)
{
   if (vel)
   Send {Enter}{Tab 2}BY ATTY B:*.
}

note50(note, vel)
{
   if (vel)
   Send {Enter} {Tab 2}BY ATTY C:*.
}

note52(note, vel)
{
   if (vel)
   Send {Enter} {Tab 2}BY ATTY D:*.
}

note53(note, vel)
{
   if (vel)
   Send {Enter} {Tab 2} Q:*. 
}

note55(note, vel)
{
   if (vel)
   Send {Enter} {Tab 2} A:*.
}

note57(note, vel)
{
   if (vel)
   Send .  {Enter} {Tab 2}Q:*.
}

note59(note, vel)
{
   if (vel)
   Send ?  {Enter} {Tab 2}Q:*.
}


;-------------------------  Midi input library  ----------------------
#include midi_in_lib.ahk


And here is a little script with a couple shortcuts for editing the above script:

Code:
#^a:: ;;midi scriptlet send, creates the text send part

Send {Enter}
Sendraw note(note, vel)
Send {Enter}
Sendraw {
Send {Enter}{Tab}
Sendraw    if (vel)
Send {Enter}
Sendraw    Send
Send {Enter}{Backspace}
;Sendraw    else
;Send {Enter}
;Sendraw    Send {Space up}
;Send {Enter}{Backspace}
Sendraw }
Send {Enter}
Send {Up 6}
Send {Right 5}
Return

#^f::  ;;creates the part in the listennote, prompting for the midi note number
InputBox, Noteno, Enter Midi Note Number,, 120, 160
if ErrorLevel
    MsgBox, CANCEL was pressed.
else
   Sleep, 40
    Send listenNote(%Noteno%, `"note%Noteno%") {Enter}
Return



Many thanks to orbik and stutter and everybody else. I think those cheap roll-up midi keyboards may be especially useful for this.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2008, 1:03 pm 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
How easy or difficult would it be with this midi input library to accomplish something like this:

Code:
if (no midi events on a given midi port for longer than 1s)
{
    press some hotkey
}

For checking "midi events" from above for my purposes, midi-cc, note, pitchbend events would be enough already.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2008, 1:55 pm 
Offline

Joined: February 13th, 2008, 10:13 pm
Posts: 11
Is there any way to increase the response speed / lower latency of this?
I have a script which translates a knob turn into mouse movements, but it is a little sluggish. Any suggestions, or is this a limitation of this method?


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 2nd, 2008, 1:00 am 
Offline

Joined: August 16th, 2006, 9:53 pm
Posts: 16
Slightly modified quote :)

Quote:
Many thanks to orbik, stutter, ribbet.1, robcheese and everybody else. I think those cheap roll-up midi keyboards may be especially useful for this.


Apropos "listen":

Together with the standard synthesizer (Windows) and a cheap (touch-sensitive) Midi-KB, I guess, we are on the way to make a better PC-KB input device with sound-feedback (i.e. a touch- and timesensitive chord-input device)

This allows much more efficient and comfortable input than all those million standard PC-Keyboards. (Not only for the blind community).

However it is really necessary to extend the used DLL and its autohotkey wrapper to MidiOutput to make it a universally helpful device.

MayAllBeHappy

Fridemar
PS.:
Imagine how much more time and pleasure musiceans get for additional training their motoric skills, while simply doing their writing stuff on a piano-kb instead of on a PC-Keyboard. :-)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Stigg and 7 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group