Assign a keystroke to a variable

  • Forum
  • Assign a keystroke to a variable
0
0

Hi Steve!

I want to know how to assign a keystroke to a variable in the rules section. I know the slow way to do this (one by one) but I want to see if I can somehow consolidate it into a few translators instead of 64+.

For example, if I have a sysex I want to output:

F0 43 1F 3E 0C 02 03 01 03 qq 00 00 pp F7

qq= FX # (0-3)

pp=aux # (1-8)

I want to say that if  I press the number ‘1’, that equals ’00’ (qq)

and if I press ‘I’ that equals ’08’ (pp)

So that if I press them together ((1)I) it will output:

F0 43 1F 3E 0C 02 03 01 03 00 00 00 08 F7

Thanks!

 

 

Marked as spam
Posted by (Forum: 3, Answers: 4)
October 3, 2020 11:48 am
14 views
0
Private answer

I'l have to think on this a bit. Normally each incoming keystroke sequence is unique, but maybe I can do something like this

1) Caputre first keystroke (assuming all keystrokes are 0-9) and put it in to a global variable on press down.

2) Capture the second keystroke (but only if the first key is still held down) by the first variable.

3) Upon release of both keys, send the outgoing SysEX and set both variables back

So essentially we would need at least 20 translators (0-9 down and 0-9 up) and a set of rules to determine which keystroke we are so we can set the appropriate variable and then release the SysEx when both keys are released. (which would probably be a timer).  Releasing the SysEx would set the global variables back. Anyway, those are my current thoughts.

Steve Caldwell
Bome Customer Care


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

Marked as spam
Posted by (Forum: 50, Answers: 5335)
October 3, 2020 6:38 pm
0
Private answer

Something like this would work (I only programmed Keys 1,2 and 8).

The rub is that if both values are the same value (IE both 1) it won't work because you can press the same key after it is already held down.

In this example I'm using ga to hold the first keystroke and gb to hold the second. When they are both released, the timer is fired and the SysEx is sent.

 

 

Marked as spam
Posted by (Forum: 50, Answers: 5335)
October 3, 2020 6:55 pm