Midi Buttons To Alternate Keystrokes

Hi All

I Cannot for the life of me work this out.

I am trying to use two different midi buttons to increase and decrease keystrokes respectively on each press.

I have managed to achieve this with 1 midi button keying 1, 2, 3, 4 and back to 1.

I have also got the second midi button going 4, 3, 2, 1, and back to 4.

The problem is they do not relate to each other, I want the next press up or down to follow the correct numerical order up and down.

Not sure I have explained this very well but hoping someone can help.

Regards

Jason

Hi and welcome to the Bome community!

Please find the attached project file. It has 6 translators

0.0 - Incoming MIDI Note 0 In - Increments the value of ga and wraps around
0.1 -Incoming MIDI note 1 In - Decrements the value of ga and wraps around
0.2 - Incoming MIDI Note 0 or 1 (See rules) Outputs 1 when ga==0
0.3 - Incoming MIDI Note 0 or 1 (See rules) Outputs 2 when ga==1
0.4 - Incoming MIDI Note 0 or 1 (See rules) Outputs 3 when ga==2
0.5 - Incoming MIDI Note 0 or 1 (See rules) Outputs 4 when ga==3

I have an alias setup as follows:
image

You can learn more about aliases from this tutorial.

Your target application needs to be focused.

MIDI-to-KeyStroke-2023-03-31.bmtp (2.2 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi Steve

Thanks very much for help.

I am obviously doing something wrong; I cannot get this to work.

Not getting any keystrokes output.

Checked port aliases and have activity input in midi monitor.

Regards

Jason

  1. Open Bome MIDI Translator Pro
  2. Open the Log Window in Bome MIDI Translator Pro
  3. Check "Incoming, Outgoing, and MIDI IN in the Log Window
  4. Open Notepad or another editor (make sure it stays selected)
  5. Push buttons

If you see no MIDI In then you will need to fix your alias as shown in the animation. If you see incoming MIDI but no Incoming Message, then you will need to fix the incoming MIDI messages that you are sending or change the incoming trigger for those messages in the translator.

Notepad (or anything besides Bome MIDI Translator Pro) must be focused in order for your target application to receive keystrokes. If it is not, you will see a message like ‘KeyStroke Suppressed’ in the Log Window.


Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thanks again Steve

I have done everything, checked and double checked. I clearly don’t understand this very well sorry.

I have incoming midi, messages and the translators showing in the log but no outgoing keystroke.

1: MIDI IN [Trigger Finger Pro MIDI]: 90 19 5D
2: IN 0.2 Note On on ch. 1 with any note set “pp” to note=25 with any velocity=93
3: IN 0.3 Note On on ch. 1 with any note set “pp” to note=25 with any velocity=93
4: IN 0.4 Note On on ch. 1 with any note set “pp” to note=25 with any velocity=93
5: IN 0.5 Note On on ch. 1 with any note set “pp” to note=25 with any velocity=93
6: MIDI IN [Trigger Finger Pro MIDI]: 80 19 00

When I try with my original pre-set I get an outgoing keystroke but as mentioned no relation with up and down.

1: MIDI IN [Trigger Finger Pro MIDI]: 90 18 3D
2: IN 0.0 Note On on ch. 1 with note:24 (0x18) and any velocity=61
3: IN 0.1 Note On on ch. 1 with note:24 (0x18) and any velocity=61
4: OUT 0.1 Text: 1 : keystroke suppressed (main window active)
5: MIDI IN [Trigger Finger Pro MIDI]: 80 18 00

As you said I will get the suppressed keystroke message unless my target application is focused, works ok in target application too.

Regards

Jason

OK, I had limited the input notes to note 0 and 1. Now I will look at all notes by commenting out this line on the key out translators.

//if pp>1 then exit rules, skip Outgoing Action

You might want to add rules like this if you only one notes 24 and 25 to output keystrokes.

if pp<24 then exit rules, skip outgoing action
if pp>25 then exit rules, skip outgoing action

I also added a translator to focus on the notepad translator, then set a key delay of 20ms on each keystroke output to give time for the notepad application to get focus.

MIDI-to-KeyStroke-2023-04-01.bmtp (2.6 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Awesome, thank you so much Steve.

Works perfectly :grinning:

Got rid of the focus notepad but will be testing this in future with application I want to use.

I altered inputs to work with Mackie buttons I will use and managed to add a couple more translators to extend keystrokes for when I need.

All the best.

Jason

1 Like