Grrrrrrr... HID to MIDI frustration - Page 2
Page 2 of 6 FirstFirst 123456 LastLast
Results 11 to 20 of 54
  1. #11
    Tech Guru zestoi's Avatar
    Join Date
    Mar 2011
    Location
    UK, Ukraine, Romania
    Posts
    2,836

    Default

    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
    11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2
    maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
    Quote Originally Posted by derschaich
    "wohoo, i'm touched, turn on the FX"

  2. #12

    Default

    this scripting things doesnt seem as hard as i think 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!

  3. #13
    Tech Guru zestoi's Avatar
    Join Date
    Mar 2011
    Location
    UK, Ukraine, Romania
    Posts
    2,836

    Default

    Quote Originally Posted by chaomocha View Post
    this scripting things doesnt seem as hard as i think 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...
    11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2
    maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
    Quote Originally Posted by derschaich
    "wohoo, i'm touched, turn on the FX"

  4. #14
    Tech Wizard
    Join Date
    Apr 2011
    Posts
    25

    Default

    Quote Originally Posted by zestoi View Post
    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.

  5. #15
    Tech Guru zestoi's Avatar
    Join Date
    Mar 2011
    Location
    UK, Ukraine, Romania
    Posts
    2,836

    Default

    Quote Originally Posted by scyn View Post
    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.
    11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2
    maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
    Quote Originally Posted by derschaich
    "wohoo, i'm touched, turn on the FX"

  6. #16
    Tech Mentor derschaich's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    412

    Default

    if it works same as with mouse.swallow this solution should work!

  7. #17
    Tech Wizard
    Join Date
    Apr 2011
    Posts
    25

    Default

    Quote Originally Posted by derschaich View Post
    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 forums 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.
    Last edited by scyn; 07-12-2011 at 11:14 AM.

  8. #18
    Tech Guru zestoi's Avatar
    Join Date
    Mar 2011
    Location
    UK, Ukraine, Romania
    Posts
    2,836

    Default

    Quote Originally Posted by scyn View Post
    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 forums 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.
    11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2
    maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
    Quote Originally Posted by derschaich
    "wohoo, i'm touched, turn on the FX"

  9. #19
    Tech Guru zestoi's Avatar
    Join Date
    Mar 2011
    Location
    UK, Ukraine, Romania
    Posts
    2,836

    Default

    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
    11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2
    maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
    Quote Originally Posted by derschaich
    "wohoo, i'm touched, turn on the FX"

  10. #20
    Tech Wizard
    Join Date
    Apr 2011
    Posts
    25

    Default

    Quote Originally Posted by zestoi View Post
    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.

Page 2 of 6 FirstFirst 123456 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •