Grrrrrrr... HID to MIDI frustration

Home :: Reviews of DJ equipment :: Grrrrrrr... HID to MIDI frustrationReply
Grrrrrrr... HID to MIDI frustration
Posted on: 30.06.2011 by Madeline Seneff
Ok I've been trying really really hard to try and not post something which is clearly a fairly common topic, but I really just can't find anything.

Truthfully, the underlying thing I've been trying to do is use a second QWERTY keyboard with Traktor Pro/ Traktor Pro 2. So what I've been trying to do is find an easy way to convert the HID signals to MIDI, so that way the keyboard commands between my laptops built in keyboard and the external keyboard. I also need keys that have the same command, like the shift keys, to send different signals, but actually if that cant happen thats ok.

Anyway I've tried a whole slue of programs, and none of them seem to work properly. Mjoy, joy to key, fergo, bomes, mousekeyboard200, etc. I have a plain old Logitech external keyboard, something I plan on ripping apart later and modding, and I run Windows 7 64-bit on a Dell XPS 17, and like I said I'm looking to convert the signals, or a similar alternative, to use for Traktor Pro / 2.

I'm sort of believeing this just isn't a possibility at this time, but thanks in advance for anyone who helps!
Madeline Seneff
17.07.2011
Originally Posted by scyn
Which a lot of people might be ok with. I just found (using the controller in ableton) that sometimes when I had a device control selected and I used the keyboard controller, that the keystrokes would be entered into the control's value field. It just got in the way a bit too often having keystrokes.

But to the OP...go for it. You might just find that it's not a bother having those keystrokes coming in alongside the midi data. You'll probably end up learning quite a bit in the process of setting it up.
ya that doesnt sound like it would be much of an issue. lemme make sure im clear on what your saying, if i were to set lets say "t" as an FX or something, the entire duration im holding t, if i also had a word document open and typing in it it would look like this: "ttttttttttttttttttttttttttttttttttttttttttttttttt ttttttttttttttttttttttttttttttt" or however long i hold the button? if so then that shouldnt be a problem with traktor at all. so how would i go about doing this though?
Chantelle Dellosso
13.07.2011
Originally Posted by zestoi
so seems that with glovepie and keyboards you can do either....

* treat input from each keyboard differently, convert to midi etc, but the actual keypress still gets sent out too (as a keypress)
Which a lot of people might be ok with. I just found (using the controller in ableton) that sometimes when I had a device control selected and I used the keyboard controller, that the keystrokes would be entered into the control's value field. It just got in the way a bit too often having keystrokes.

But to the OP...go for it. You might just find that it's not a bother having those keystrokes coming in alongside the midi data. You'll probably end up learning quite a bit in the process of setting it up.
Chasidy Heckenbach
12.07.2011
so seems that with glovepie and keyboards you can do either....

* treat input from each keyboard differently, convert to midi etc, but the actual keypress still gets sent out too (as a keypress)

* swallow the keyboard input and *only* send out midi - but then you can't differentiate between each keyboard
Chasidy Heckenbach
12.07.2011
Originally Posted by scyn
It has something to do with the way Windows integrates the keyboard, which is different from how it handles the mouse. I remember somewhere in the glovepie community s coming across a post discussing microsoft's lack of transparancy with regards to it's keyboard integration processes; and the maker of glovepie moving onto other projects before being able to crack it.

Buy a few gamepads, connect them to a usb hub and you'll have buttons aplenty. If you actually get it to work - I owe you a drink.
but gamepads and other HID devices do work tho... @derschaich actually does that in his custom controller - 2 gamepads connected via a usb hub.

i didnt know keyboards were different - that's a pain in the ass then. i've only tried a gamepad and my external touchpad thing.

having a quick search.... the problem seems to be when u want to swallow the input in glovepie rather than not being able to treat the two keyboards differently - so the OP's original issue is doable maybe? assuming no hotkeys are setup in traktor that would get triied when either kw is used ofc.
Chantelle Dellosso
12.07.2011
Originally Posted by derschaich
if it works same as with mouse.swallow this solution should work!
It has something to do with the way Windows integrates the keyboard, which is different from how it handles the mouse. I remember somewhere in the glovepie community s coming across a post discussing microsoft's lack of transparancy with regards to it's keyboard integration processes; and the maker of glovepie moving onto other projects before being able to crack it.

Buy a few gamepads, connect them to a usb hub and you'll have buttons aplenty. If you actually get it to work - I owe you a drink.

Cool XY pad script zestoi.
Allene Manitta
12.07.2011
if it works same as with mouse.swallow this solution should work!
Chasidy Heckenbach
12.07.2011
Originally Posted by scyn
The problem with using:
Code:
keyboard.swallow=true
Is that all keyboard keystrokes get swallowed; there's no way to re-initialize the primary keyboard so that it outputs keystrokes. I'd like to be proved wrong here, but I'm pretty sure that the current release of glovepie won't allow for swallowing only certain keyboard keystrokes.
so this type of thing won't work at all?

Code:
Keyboard.Swallow = true
Keyboard.A = Keyboard1.A
Keyboard.B = Keyboard1.B
Keyboard.C = Keyboard1.C
only have the one keyboard here so have no way of testing.
Chantelle Dellosso
12.07.2011
Originally Posted by zestoi
yep - also works for keyboards with this...

Code:
keyboard.swallow=true
then u ofc need to add the code to make the main keyboard still work as a keyboard:
I've got multiple mouses to work as intended...but multiple keyboards I've yet to see work the way we're discussing here. The problem with using:
Code:
keyboard.swallow=true
Is that all keyboard keystrokes get swallowed; there's no way to re-initialize the primary keyboard so that it outputs keystrokes. I'd like to be proved wrong here, but I'm pretty sure that the current release of glovepie won't allow for swallowing only certain keyboard keystrokes.
Chasidy Heckenbach
11.07.2011
Originally Posted by chaomocha
this scripting things doesnt seem as hard as i believe im making it out to be haha. thank you so much for all of this, its gunna be a big help cuz i love controllerism and customs and using random usb stuff to try and map out, so this will hopefully be a big break through. its 1am though right now so ill give this all a try tomorrow and will report back hopefully with good news!
cool - sounds good. you really dont need to have any coding skills to script in glovepie as its 99% just what input becomes what midi output - with maybe a few if this then do that things if you need something a little extra...
Madeline Seneff
11.07.2011
this scripting things doesnt seem as hard as i believe im making it out to be haha. thank you so much for all of this, its gunna be a big help cuz i love controllerism and customs and using random usb stuff to try and map out, so this will hopefully be a big break through. its 1am though right now so ill give this all a try tomorrow and will report back hopefully with good news!
Chasidy Heckenbach
11.07.2011
this is my external touchpad xypad script just to show the type of stuff you can do - you can put in some pretty decent logic if you want/need it:

Code:
if (var.XYpadInit == 0) then
   midi.DeviceOut = 8 // device number to use
   debug = midi.OutDevName // show device name in use
   midi.GeneralMidi = False
   midi.DefaultChannel = 1
   var.XYpadXres = 500
   var.XYpadYres = 320
   var.XYpadXborder = 10
   var.XYpadYborder = 10
   var.XYpadXmax = var.XYpadXres + var.XYpadXborder * 2
   var.XYpadYmax = var.XYpadYres + var.XYpadYborder * 2
   var.XYpadXmidiMin = 0
   var.XYpadXmidiMax = 100
   var.XYpadYmidiMin = 0
   var.XYpadYmidiMax = 1
   var.XYpadMode1Time = 1.5
   var.XYpadInit = 1
endif

mouse.Swallow = true
fakemouse.DirectInputX = mouse1.DirectInputX
fakemouse.DirectInputY = mouse1.DirectInputY
mouse.LeftButton = mouse1.LeftButton
mouse.RightButton = mouse1.RightButton
mouse.MiddleButton = mouse1.MiddleButton
mouse.XButton1 = mouse1.XButton1
mouse.XButton2 = mouse1.XButton2

if mouse2.present then

  if (mouse2.LeftButton) then
     var.XYpadMode = 0
  endif

  if (mouse2.RightButton) then
     var.XYpadMode = 1
  endif

  var.XYpadXdelta = Delta(mouse2.DirectInputX)
  var.XYpadYdelta = Delta(mouse2.DirectInputY)

  if (var.XYpadXdelta != 0 || var.XYpadYdelta != 0) then

     if (var.XYpadMode == 1) then
        var.XYpadTime = TimeStamp()
        var.XYpadReset = 0
     endif

     if (var.XYpadXdelta != 0) then
        var.XYpadX = var.XYpadX + var.XYpadXdelta

        if (var.XYpadX < 0) then
           var.XYpadX = 0
        elseif (var.XYpadX > var.XYpadXmax) then
           var.XYpadX = var.XYpadXmax
        elseif (var.XYpadX < var.XYpadXborder) then
           var.XYpadXmidiCC = var.XYpadXmidiMin
        elseif (var.XYpadX > var.XYpadXres + var.XYpadXborder) then
           var.XYpadXmidiCC = var.XYpadXmidiMax
        else
           var.XYpadXmidiCC = floor(MapRange(var.XYpadX, 0, var.XYpadXmax, var.XYpadXmidiMin, var.XYpadXmidiMax))
        endif

        midi.Control0Coarse = var.XYpadXmidiCC%
     endif

     if (var.XYpadYdelta != 0) then
        var.XYpadY = var.XYpadY - var.XYpadYdelta

        if (var.XYpadY < 0) then
           var.XYpadY = 0
        elseif (var.XYpadY > var.XYpadYmax) then
           var.XYpadY = var.XYpadYmax
        elseif (var.XYpadY < var.XYpadYborder) then
           var.XYpadYmidiCC = var.XYpadYmidiMin
        elseif (var.XYpadY > var.XYpadYres + var.XYpadYborder) then
           var.XYpadYmidiCC = var.XYpadYmidiMax
        else
            var.XYpadYmidiCC = MapRange(var.XYpadY, 0, var.XYpadYmax, var.XYpadYmidiMin, var.XYpadYmidiMax)
        endif

        midi.Control1Coarse = var.XYpadYmidiCC%
     endif
  else
      if (var.XYpadMode == 1 && var.XYpadReset == 0) then
         if (var.XYpadTime < TimeStamp() - var.XYpadMode1Time) then
            var.XYpadX =  floor(var.XYpadXres / 2)
            var.XYpadY =  floor(var.XYpadYres / 2)
            var.XYpadReset = 1
         endif
      endif
  endif
endif
Chasidy Heckenbach
11.07.2011
Originally Posted by chaomocha
...I can't swallow the keystrokes completely. Can I convert both keyboards to midi instead, and have say for example the W key on one keyboard set to send a different midi signal than the other? Or will it not be able to differentiate between the two still? Maybe my question doesn't make sense, I don't really know what I'm doing as far as these new programs go lol.
yep u should be able to make the main kw work as a kw and the external one for midi.

and yep to the next question - you should be able to make both keyboards send out different midi data if you swallow them both.

not a big deal as when u click to stop glovepie then they'll both work as usual kb's again anyway.... tho keeping the main one (assuming glovepie can route that back to being a normal keyboard but i'm almost certain it would be able to) as a normal kb probably makes the most sense.
Chasidy Heckenbach
11.07.2011
yep - also works for keyboards with this...

Code:
keyboard.swallow=true
then u ofc need to add the code to make the main keyboard still work as a keyboard:
Chasidy Heckenbach
11.07.2011
Originally Posted by scyn
If I recall correctly: Glovepie is able to convert keystrokes into midi, but it cannot swallow the keystrokes from a particular keyboard when multiple keyboards are connected.
not tried multiple keyboards but this bit of code works for swallowing mouse input so my main one is used as a mouse and i use the external one for midi:

Code:
mouse.Swallow = true
fakemouse.DirectInputX = mouse1.DirectInputX
fakemouse.DirectInputY = mouse1.DirectInputY
mouse.LeftButton = mouse1.LeftButton
mouse.RightButton = mouse1.RightButton
mouse.MiddleButton = mouse1.MiddleButton
mouse.XButton1 = mouse1.XButton1
mouse.XButton2 = mouse1.XButton2
Madeline Seneff
11.07.2011
Originally Posted by scyn
If I recall correctly: Glovepie is able to convert keystrokes into midi, but it cannot swallow the keystrokes from a particular keyboard when multiple keyboards are connected.

So if keyboard1 is your regular keyboard & keyboard2 is your midi controller-to-be, then:
  • midi.channel1.asharp0 = Keyboard2.W
Will only make keyboard2 output a midi note when pressing the 'W' key. However (and this is why I ended up using gamepads instead) keyboard2 will still output a W keystroke...


This thread is where I started out:
http://www.djranking s.com/community /sho...?t=8868&page=2

Once you've got midi-yoke installed, the glovepie scripting is really simple. For example, to make the 'W' key output a midi note, this is all the code you'd need:

midi.DeviceOut = 2
midi.channel1.asharp0 = Keyboard2.W
Wow thank you for all this advice, this is gunna help alot. Maybe you could answer my next question now though too, and I'm just believeing of it now that you mentioned I can't swallow the keystrokes completely. Can I convert both keyboards to midi instead, and have say for example the W key on one keyboard set to send a different midi signal than the other? Or will it not be able to differentiate between the two still? Maybe my question doesn't make sense, I don't really know what I'm doing as far as these new programs go lol.
Chantelle Dellosso
11.07.2011
If I recall correctly: Glovepie is able to convert keystrokes into midi, but it cannot swallow the keystrokes from a particular keyboard when multiple keyboards are connected.

So if keyboard1 is your regular keyboard & keyboard2 is your midi controller-to-be, then:
  • midi.channel1.asharp0 = Keyboard2.W
Will only make keyboard2 output a midi note when pressing the 'W' key. However (and this is why I ended up using gamepads instead) keyboard2 will still output a W keystroke...

Originally Posted by chaomocha
I guess my next question is how do I script GlovePIE? Any tips or links or anything on how to do it, because I've never really scripted anything before really.
This thread is where I started out:
http://www.djranking s.com/community /sho...?t=8868&page=2

Once you've got midi-yoke installed, the glovepie scripting is really simple. For example, to make the 'W' key output a midi note, this is all the code you'd need:

midi.DeviceOut = 2
midi.channel1.asharp0 = Keyboard2.W
Madeline Seneff
12.07.2011
So there's a way to swallow one keyboard and keep another keyboard an actual keyboard? because that's exactly what I'm looking for. I guess my next question is how do I script GlovePIE? Any tips or links or anything on how to do it, because I've never really scripted anything before really.
Chasidy Heckenbach
10.07.2011
Originally Posted by chaomocha
Ya I remember reading about this on the community s, I guess I forgot to try it whoops. Thanks a bunch for the reminder haha. I'll report back once I try it and see how it goes. For now, off to a party.

Oh god this is going to a be confusing isn't it? Considering I've never done scripting that is...
i had a similar issue with wanting to use a usb touchpad as an X/Y type pad input. i wrote a glovepie script that swallows the mouse input so now only my laptops touchpad actually moves the cursor around and then wrote code to output midi from the usb touchpad.

glovepie is very cool - and the scripting is relatively simple.
Madeline Seneff
03.07.2011
Ya I remember reading about this on the community s, I guess I forgot to try it whoops. Thanks a bunch for the reminder haha. I'll report back once I try it and see how it goes. For now, off to a party.

Oh god this is going to a be confusing isn't it? Considering I've never done scripting that is...
Allene Manitta
02.07.2011
praise GlovePIE (free download) over an over again!

<< Back to Reviews of DJ equipment Reply

Copyright 2012-2023
DJRANKINGS.ORG n.g.o.
Chuo-ku, Osaka, Japan

Created by Ajaxel CMS

Terms & Privacy