Midi Translator Pro and keystrokes - PowerMate to MIDI

lowrenzo

2007-01-02 17:49:40

Hello Florian,

is it possible to translate key strokes as:

[ALT]+[STRG]+[SHIFT]+ any key

to midi CC

??

greets lowrenzo

admin

2007-01-03 13:57:15

MT Pro allows Keystrokes as incoming trigger, though currently only the real "keys" are used, i.e. the Shift key is treated equally to, say, the A key. It's a good idea to have checkboxes for Shift,Ctrl, and Alt as convenience there.

For now, you can help yourself with the Rules and global variables: we define the global variable ga as a flag for Shift, gb for Ctrl and gc for Alt. If the respective variable is 1, the key is pressed, otherwise it's 0. The following Translators are needed to set this up:

Code: Select all

Translator 1: Shift down: set flag ga
Options: stop=true
Incoming: Key down: Shift
Rules: 
  ga=1
Outgoing: (none)

Translator 2: Shift up: reset flag ga
Options: stop=true
Incoming: Key up: Shift
Rules: 
  ga=0
Outgoing: (none)

Translator 3: Ctrl down: set flag gb
Options: stop=true
Incoming: Key down: Ctrl
Rules: 
  gb=1
Outgoing: (none)

Translator 4: Ctrl up: reset flag gb
Options: stop=true
Incoming: Key up: Ctrl
Rules: 
  gb=0
Outgoing: (none)

Translator 5: Alt down: set flag gc
Options: stop=true
Incoming: Key down: Alt
Rules: 
  gc=1
Outgoing: (none)

Translator 6: Alt up: reset flag gc
Options: stop=true
Incoming: Key up: Alt
Rules: 
  gc=0
Outgoing: (none)
Now, for example, we can define Ctrl-A as this:

Code: Select all

Translator 7: Ctrl-A to MIDI
Options: stop=true
Incoming: Keystroke: A
Rules: 
  if gb==0 then exit rules, skip Outgoing Action
Outgoing: MIDI 99 30 7F 30 00 
Combinations: this MIDI message will only be executed if you press Shift+Ctrl+Alt+B:

Code: Select all

Translator 8: Shift-Ctrl-Alt-B to MIDI
Options: stop=true
Incoming: Keystroke: B
Rules: 
  if ga==0 then exit rules, skip Outgoing Action
  if gb==0 then exit rules, skip Outgoing Action
  if gc==0 then exit rules, skip Outgoing Action
Outgoing: MIDI 99 31 7F 31 00
Note: since the current keystroke mechanism in MT Pro uses the hardware keys, your definitions are independent of the keyboard layout. This means that your definitions define the position of the key on the keyboard, not which letter they represent. E.g. a German keyboard layout has the Z key below the number key 6, while an English keyboard has a Y key there. MT will treat this key as the same, no matter which keyboard layout is selected. A future version of MT Pro will have a way to define typed characters (versus the key).

Florian

lowrenzo

2007-01-03 19:45:44

hello florian,
sorry for not understanding your programming code,
is it possible to send me a preset.. perhaps then i can understand.


that would be great, thx, rene

admin

2007-01-11 10:59:35

sorry for the late reply. For setting up translator entries to send a MIDI volume change message in response to cursor up/down keys, use these translators (in addition to the 6 translators above):

Code: Select all

Translator 7: Shift-Ctrl-Alt-Up to MIDI Volume+
Options: stop=true
Incoming: Keystroke: Up
Rules: 
  if ga==0 then exit rules, skip Outgoing Action
  if gb==0 then exit rules, skip Outgoing Action
  if gc==0 then exit rules, skip Outgoing Action
  gv=gv+10
  if gv>=127 then gv=127
Outgoing: MIDI B0 07 gv 

Translator 8: Shift-Ctrl-Alt-Down to MIDI Volume-
Options: stop=true
Incoming: Keystroke: Down
Rules: 
  if ga==0 then exit rules, skip Outgoing Action
  if gb==0 then exit rules, skip Outgoing Action
  if gc==0 then exit rules, skip Outgoing Action
  gv=gv-10
  if gv<0 then gv=0
Outgoing: MIDI B0 07 gv 
The translators use the variable gv to remember the current volume level. Pressing the Down key will enter Translator 7. IF the first 3 rules determine that Shift, Ctrl, and Alt are all pressed, the value of gv is increased by 10. In order to satisfy the MIDI standard, the value is capped at 127. Translator 8 does the same thing vice versa for keystroke down and decreasing volume.

Of course you need to make sure that the MIDI device or MIDI software that you want to control using the keystrokes is selected as the MIDI OUT port in Midi Translator. For the case of software, you'll most likely need to install a virtual MIDI port like Yoke (more virtual port alternatives can be found here). Then select one virtual port as MIDI OUT in Midi Translator, and select the same virtual port in the software to be controlled as MIDI IN.

You can download the entire Midi Translator Pro project file here (right-click+"Save Link As" on the link below to save it to your disk):
http://www.bome.com/midi/translator/sol ... fiers.bmtp

Florian

lowrenzo

2007-01-13 00:12:30

hello florian,

thx for your reply, i have tested it with normal keystrokes and it is working very well..
:==))

but::
i have another problem now,

as i use the griffin power mate, i want to translate keystrokes which i can generate with that knob.
so i decided to configure that knob as following:
rotate right: O
rotate left: L
i have done the same with the midi translator pro..
so when i push that keystrokes on my keyboard midi translator creates midi signal and the main channel of total mix is working great (volume up down)
when i use the power mate.. i can see a key input on the midi translator display and as you can see here: ooolllllooollloolllooolllooollooooolll it is also working in my internet application .. but midi translator is not recognice it as the keystroke o and l
perhaps the problem is, that midi translator is checking the peripherie and not the software for keystrokes..
so i send keystrokes now:
oooollllooollllooollllllllllllloooooolllllllooooooolllllooooollllooolllooolloollooolloo
but no midi signal is generated from the output of midi translator pro.

thx for your help rene

florian

2007-01-15 11:46:32

Hi Lowrenzo,

you may be right that the griffin sends its keystrokes in a way that MT will not recognize, or not as the letter O and P. But you say the incoming LED lights up when you turn the power mate, so MT must be able to get the power mate's keystrokes!

So you should try this: put the cursor in Midi Translator's Edit Translator window, where you enter the key for the incoming action. Then turn the power mate and see what gets entered into the box. You may see something strange, which should be fine then.

Let us know how it works!
Florian

lowrenzo

2007-01-15 15:05:49

hello flo!

i have tested this...
the letter O or P occur in the window..
and i think this is strage.. i have mailed griffin technologies about that problem a few days before but got no reply til now.

so that sounds bad, eh?

greets lowrenzo

florian

2007-01-15 18:25:38

as stupid as that may sound: have you tried creating a new Translator entry in MT by defining the incoming keystroke with the griffin rather than the keyboard?

Reason is, MT internally stores the hardware code for the keystroke. In the edit field it just displays what Windows defines as letter for this hardware key.

Can you check MT's log and copy/paste its contents when you turn the knob?

Regards,
Florian

lowrenzo

2007-01-17 14:49:28

i think i have tested it,
in mt it appears right, but when i try to use it, there is no translation,...
strange behaviour,
i have no clue, but i think that griffin power mate send keystrokes in a way that will not be recognized as that key from mt for translation,
is there any possibility to monitor the incomming keystrokes not only the keystrokes that would get translated..??

greets rene

ps.
florian, i would send you my power mate knob for testing if you need it...

admin

2007-01-17 15:05:58

can you see anything in the log window when turning the knob?

I should just purchase the powermate myself and see how to get it to work!

Florian

lowrenzo

2007-01-17 15:14:01

no..

MT - Options - Log Window
... shows nothing when i turn the knob.


but when i add a new translator and turn the knob for incoming keystoke the key which is configured in power mate software is shown there

you can get a griffin power mate on ebay for i think 23 euros..

greets rene

florian

2007-01-20 04:51:58

that's interesting! if MT can see the knob, then why wouldn't it translate it?

Note that there is an option so that MT Pro only translates keystroke input when MT is not active.

Anyway, I'll get the powermate and see what's happening.

Later,
Florian

lowrenzo

2007-01-20 09:50:11

sorry that i can not tell you better news.. but it is not working, the keys are recognized by the translator (indicated by the flashing input key light) but no translation happens..
thank you to investigate this griffin power mate thing, but i think that this could be a really useful weapon for midi output action...
thx rene

lowrenzo

2007-01-25 15:31:07

thx flo,
pleast tell me when you know more.
greets low

admin

2007-01-29 16:59:50

Hi Lowrenzo,

I was able to fix this issue.

As an owner of MT Pro, you can test a preview version with the bug fix. I'll send you an email with download instructions.

Thanks,
Florian

lowrenzo

2007-01-31 18:43:58

hello florian,
thats great, it is working.
thank you very much, you are my man.

thx rene

Kino Oko

2007-04-03 14:07:14

hi
can you please tell me step by step what to do to use powermate with miditranslator pro?as i see it is possible and i would buy both powermate and miditranslator when it meets my expectations.

so i want to use powermate as cc controler for live ableton (for ex loop position in clip or fx sends track dependently)

somebody who wants to help me please use my email for further talks

thanx!

grzegorz

florian

2007-04-03 22:50:51

Hi Kino Oko,

this is how you can use Midi Translator Pro to translate the PowerMate movements to MIDI:

1) set up PowerMate in its control panel to send keys when turning, e.g. key "R" when turning right, and key "L" when turning left.

2) in Midi Translator Pro, create a new Translator entry. As Incoming Trigger select "keystroke". In the keystroke field, turn the PowerMate to the right once so that an "R" appears in the field (or some other description). Note that just entering "R" from your computer keyboard will probably not work. As Outgoing Action, select MIDI and enter the MIDI message to send when turning right.

3) create another translator entry for the left direction.

4) In MT Pro, select "Yoke 1" or whichever virtual MIDI port you have installed as MIDI OUT.

5) in Ableton Live, set Yoke 1 as MIDI input and enable it for remote control.

Now in order to send continuous controllers with varying values, you'll need variables and rules, see this post how the opposite is done:
http://www.bome.com/forums/viewtopic.php?t=872

Regards,
Florian