MIDIBuddy->Multiple mice or trackballs->unique buttons and scrollwheels

Hi Steve,

What a nice surprise to see you've added unique button and scroll wheel support to MIDIBuddy.

I'm running the new code along with the included bmtp file, but I'm not seeing any output. The reason is that there aren't any output routines in the translators. You provided these for earlier versions. I'm hoping you intended to work these out for me for this version as well. Or maybe it's just a matter of combining some of the work in the previous version with work in this one. I'm hoping that's not it. As clever as I thought I was in using BMT, it's a stretch for me to work it out for myself. Please let me know. Thanks, Gabriel

 

Hi Gabriel,

Could you post your project file and show one or two translators you need adjusting? Or should I use the one we worked with a while back. I think the last one I have from you is dated November 5

I’m happy to put together a few examples for you along with how I did it.

 

Gabriel,

I took the file we worked with on the 5th and changed the 2 translators for mouse wheel scroll wheel to make it work with mouse 1.

I added 2 translators for mouse number 2 scroll wheels.

I will need to send you a new copy of MIDIBuddy because I found a bug in what the unique mouse messages were (which is why I asked you to test it before I release it). Coming shortly via email.

 


Attachments:
1510360098857_MIDIBuddy-Ableton-Test-Gabriel-2017-11-10..bmtp

Hi Steve,

For testing, I’m just using the bmtp files you’re sending me, so there’s not much sense in sending it back to you. Once I change input and output ports, MIDIBuddy and Midi Translator are linked as they should be.

Some things I noticed in today’s bmtp file:

  1. Translators 1/9 and 1/10 seem to be relevant to an earlier version of MIDIBuddy. They output X Timer and Y Timer, which are not used as input to the translators that follow.
  2. Translators 1/11 and 1/12 output X Timer1 and Y Timer1 which is correct.
  3. Translators 1/13 and 1/14 output X Timer2 and Y Timer3 which is correct.
  4. So I get the outputs I need, though I would change Translators 22 and 23 so they output B0 02 and B0 03 rather than B0 03 and B0 04.
  5. And yet, MIDIBuddy seems to be outputting the following strings simultaneously: F0 7D 42 4F 4D 45 7F 02 00 pp qq rr ss F7 (which would be seen by Translators 1/9 and 1/10) as well as F0 7D 42 4F 4D 45 7F 02 08 01 pp qq rr ss F7 (which is seen by Translator 1/12 and 13 as it should be).
  6. Translator 1/15 does see output from MIDIBuddy in response to Scroll Wheel movement of mouse 1.
  7. But its output is X Timer1. This should probably be X Timer3 so that it is used as input for Translator 1/24, otherwise it would conflict with horizontal movement of mouse 1.
  8. I’m not sure what Translator 1/16 is supposed to do, since there’s only one Scroll Wheel per mouse. Maybe it’s meant to be used for Scroll Wheel press? Same for Translator 1/18.
  9. Translator 1/24 and 1/25 should probably be named X Timer3 and Y Timer3 – though, again, I don’t know what Translator 1/25 would be used for.
  10. So, what I’m missing is X Timer4, which would be used for Mouse 2 Scroll Wheel.
  11. Mouse 1 and 2 Left Button presses and releases are handled correctly by Translators 2/2 and 2/3
  12. Mouse 1 Middle Button press and release is handled correctly by Translator 2/4, though on my mouse it’s actually Scroll Wheel press and release.
  13. I’m not sure what 2/8 through 2/16 are meant to do.
  14. I don’t understand why Translator 2/17 responds to Middle Button press and release (Again, this is Scroll Wheel press and release on my mouse. I’m holding the mouse absolutely steady, so it’s not that there is some x or y axis movement of the mouse. For some reason, MIDIBuddy is sending F0 7D 42 4F 4D 45 7F 02 08 01 00 00 01 00 F7 for Scroll Wheel press and for release too.
  15. In response to Scroll Wheel Movement, you are sending the timers with a repeat count of 20. I think, since we’re using Relative (BinOffset) — I’m actually using Relative (lin BinOffset – not sure if that makes a difference — it might be possible to send, for example B0 00 48 for increment and B0 oo 38 for decrement (or something greater than 48 and smaller than 38) in order to avoid sending the output multiple times. If we find the correct values to send, I think wemight be able to avoid using timers entirely, and just send the outputs directly. I haven’t tried this yet in this project file, but have done so successfully in my actual project file. So…. there you have it. Hopefully this all makes sense. Gabriel

BTW I don’t know if you intended to create a bmtp file with actual outputs for mouse or trackball x and y movements and for button presses and scroll wheels. It seems like a good idea. Am I wrong to think that, though different users might be using the outputs for other actions than I’m doing, they would all need the same outputs, and that it would help everyone use MIDIBuddy without having to reinvent the wheel. There might be differences in scaling, but otherwise, the necessary outputs would be the same – only mapping would change, right?

Oh… one more thing. I previously asked if you could change global variables so that they wouldn’t interfere with the ones I already use in my project. That’s no longer necessary, since I’m going to merge the final bmtp file you provide (given that my comments do make sense and require a few adjustments) with my main project file. I think I can handle the changes without getting confused as I did the last time I tried to do it.

Gabriel,

Thanks so much for testing this! It looks like I will need to do a few tweaks before releasing this functionality.

 

Gabriel->
Translators 1/9 and 1/10 seem to be relevant to an earlier version of MIDIBuddy. They output X Timer and Y Timer, which are not used as input to the translators that follow.
Translators 1/11 and 1/12 output X Timer1 and Y Timer1 which is correct.<-Gabriel

Steve-> 1/9 and 1/10 can be disabled, however I keep sending these outputs to make it backward compatable with previous version. <-Steve

Gabriel->
Translators 1/13 and 1/14 output X Timer2 and Y Timer3 which is correct.
So I get the outputs I need, though I would change Translators 22 and 23 so they output B0 02 and B0 03 rather than B0 03 and B0 04.<-Gabriel

Steve -> You can modify the MT Pro file as needed. I just set these output up for testing <-Steve
Gabriel->
And yet, MIDIBuddy seems to be outputting the following strings simultaneously: F0 7D 42 4F 4D 45 7F 02 00 pp qq rr ss F7 (which would be seen by Translators 1/9 and 1/10) as well as F0 7D 42 4F 4D 45 7F 02 08 01 pp qq rr ss F7 (which is seen by Translator 1/12 and 13 as it should be).<-Gabriel

Steve -> I did not take away MIDIBuddy functionality. You can use either input but probably not both. It depends on what you want to do.<-Steve

Steve-> 1/9 and 1/10 should probably be labeled as absolute pointer mouse position as opposed to mouse movement. If the mouse is frozen then the cursor will not move so in essense. 1/9 and 1/0 report the actual absolute cursor position on the screen while 1/12 and 1/13 record relative mouse movements commands sent to MT Pro (even if the cursor does not move)<-Steve

Gabriel->
Translator 1/15 does see output from MIDIBuddy in response to Scroll Wheel movement of mouse 1.
But its output is X Timer1. This should probably be X Timer3 so that it is used as input for Translator 1/24, otherwise it would conflict with horizontal movement of mouse 1.
I’m not sure what Translator 1/16 is supposed to do, since there’s only one Scroll Wheel per mouse. Maybe it’s meant to be used for Scroll Wheel press? Same for Translator 1/18.<-Gabriel

Steve-> Yes, again I only used this for testing not for setting up a user project file. In my test I only enabled one at a time so global variables did not not matter.
On some mice, you can side click on the mouse wheel for horizontal mouse movement. This is what 1/16 and 1/18 are for.<-Steve

Gabriel->
Translator 1/24 and 1/25 should probably be named X Timer3 and Y Timer3 – though, again, I don’t know what Translator 1/25 would be used for.<-Gabriel

Steve-> Again the MT Pro file is just for testing. There are so many combinations of output available, I didn’t intend to use it as a user template but maybe I should create one with generic outputs. If I did, the likelihood that a user would change them is high which of course would effect the global variables I chose. I will probably provide a more advanced MT-Pro template in the future. Right now, my focus was on getting features added to MIDIBuddy.<-Steve

Gabriel->
So, what I’m missing is X Timer4, which would be used for Mouse 2 Scroll Wheel.
Mouse 1 and 2 Left Button presses and releases are handled correctly by Translators 2/2 and 2/3<-Gabriel

Steve-> Yes simply duplicate and modify any translators that you want, if you want additional timers.<-Steve
Gabriel->
Mouse 1 Middle Button press and release is handled correctly by Translator 2/4, though on my mouse it’s actually Scroll Wheel press and release.<-Gabriel

Steve->Yes the middle button on my mouse is also scroll wheel press. It also has scroll up, down, left and right functions. My guess is your’s is too if you give it a try.<-Steve

Gabriel->
I’m not sure what 2/8 through 2/16 are meant to do.<-Gabriel

Steve-> Another user asked me to handle this unique situation. He presses a key on his controller for mouse down only so he can drag a mouse pointer. However if he touches the real mouse, he didn’t want the pointer to continue to drag so this monitors for that and releases the mouse down button if he happens to touch his mouse.<-Steve
Gabriel->
I don’t understand why Translator 2/17 responds to Middle Button press and release (Again, this is Scroll Wheel press and release on my mouse. I’m holding the mouse absolutely steady, so it’s not that there is some x or y axis movement of the mouse. For some reason, MIDIBuddy is sending F0 7D 42 4F 4D 45 7F 02 08 01 00 00 01 00 F7 for Scroll Wheel press and for release too.
<-Gabriel

Steve-> I’ll check into this. This is for relative mouse movement but if the mouse is not trying to move it shouldn’t send. I think I will suppress any mouse move messages where the lsb of both axis is 0.

It should send this for middle press and release. (without the header and trailing F7. This is all for unique mouse reporting

Middle Mouse – 04 mm 02 03 01 – Down , 04 mm 02 03 00 – Up

For scroll it should send this:
Scroll wheel – 04 mm 02 02 01 – Up, 04 mm 02 02 02 – Down, 04 mm 02 02 03 – Left, 04 mm 02 02 04 – Right

In addition it will send the original (non unique mouse scroll commands)
Middle Mouse – 02 03 01 – Down , 02 03 00 – Up
Scroll wheel – 02 02 01 – Up, 02 02 02 – Down, 02 02 03 – Left, 02 02 04 – Right

Again you only use the messages you want but I don’t recommend using all messages due to possible conflicts. This is by design for backward compatibility <-Steve

Gabriel->
In response to Scroll Wheel Movement, you are sending the timers with a repeat count of 20. I think, since we’re using Relative (BinOffset) — I’m actually using Relative (lin BinOffset – not sure if that makes a difference — it might be possible to send, for example B0 00 48 for increment and B0 oo 38 for decrement (or something greater than 48 and smaller than 38) in order to avoid sending the output multiple times. If we find the correct values to send, I think wemight be able to avoid using timers entirely, and just send the outputs directly. I haven’t tried this yet in this project file, but have done so successfully in my actual project file. <-Gabriel

Steve-> Yep, each user will have their own application that has it’s own needs, which is the value of MT Pro. You can tweak the incoming messages to practically any outgoing message you want. <-Steve

Gabriel->
So…. there you have it. Hopefully this all makes sense. Gabriel

Thanks for the test and detailed report!