Translator Active and monitoring for a keystroke

Hi, I would like when I have a ‘rename’ translator triggered, for it to wait and listen for an Enter or Esc keystroke I will type in the name, then after I hit enter, it would trigger a translator with ‘Ctrl + L’ in it. But if I push Esc instead, it will cancel this monitoring, and Ctrl + L won’t be triggered. Otherwise I won’t need Enter or Esc to be monitored; only when the rename translator is triggered. Is this possible?

Hi, I’m really having a hard time following what you want.

Are you talking about the translator name and triggering an output when you change the name?
Or are you talking about editing key sequences, input or output?

Steve

It’s confusing me too. So much, I’m even struggling to explain it.
My first translator loads a plugin, then opens the rename dialog box for the plugin.
So when I’m done renaming it and I push Enter, I want it to trigger the Enter keystroke, then also ‘Ctrl + L’, to link to a mixer track for me. Or I can push ‘Esc’ and it will do nothing and exit out. But I don’t need the ‘Enter’ key to trigger ‘Ctrl + L’ any other time. Only after the first (load plugin) translator has been triggered.

I’m trying with variables or timers, but am struggling with it.

Can you show me the project file you have now to do this?

Steve Caldwell
Bome Customer Care


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

Ok here. I cut it out of the main project, because it’s huge.
I push and hold down the button and it loads a current group colour first, then opens the plugin picker.
Then I hover the mouse over a plugin, release the button and it double clicks for me, and then opens the rename dialog box and applies that saved colour.
But after that is where I have this problem. See my bad formulas that don’t work. I didn’t even attempt Esc key formulas yet.
Enter Key Test.bmtp (3.0 KB)

OK, try this.

I restructured the project a bit to use variables. Instead of hard coding the delay in each variable I use rules to calculate the delay for the next step

// time between actions
g0=5
// current action
g1=0

I also set a flag to determine whether we are in the sequence or not.

// time between actions
g0=5
// current action
g1=0

Finally I have a way to determine whether to just log the actions or execute them

// debug - For logging and suppressing outgoing actions
zz=1

I also changed so the incoming action trips a timer, that way if you want to change the MIDI event that triggers the action, you will only need to change it in 2 translators instead of 7 translators.

For the incoming return key if g1=0 the Control L is not sent… The return is always sent as there is no way to suppress the original incoming keystroke with Bome MIDI Translator.

If the outgoing action is triggered both the original Return Key (not suppressed) is sent followed by the Control L after the specified delay.

Here is what it looks like in the log with zz=1. Set zz=0 in translator 0-2 and then restart the project for normal operation.

3240266 - 1.0:4 Log g2=1
3240266 - 1.1:15 Log Middle Mouse Click delay=0
3240266 - 1.2:6 Log Key Return delay=5
3240266 - 1.3:6 Log mouse move x=0 y=0 delay=10
3240266 - 1.4:6 Log Key F8 delay=15
3240267 - 1.6:4 Log Left Mouse delay=0
3240267 - 1.7:6 Log Left Mouse Click 2 delay=5
3240267 - 1.8:8 Log Key F2 F3 delay=25
3244561 - 1.9:18 Log Key Control L delay=30

If I press return when not in sequence I issue this log message

3372992 - 1.9:10 Log Return for non sequence ignored

Good luck!
Enter Key Test-sjc.bmtp (4.8 KB)

Steve Caldwell
Bome Customer Care


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

Ok cool. There was some struggling.
Took me a while to find why it wasn’t working, but then found the older init preset from MIDI Buddy had its own ideas about zz, so I deleted it out to end up with zz=0 on start up.

Then it took a while to see that the MIDI Buddy mouse capture variable is qq, same as your new delays variable. Fixed that. Then my gn=1 was still there, deleted it.

The release button translator didn’t include an action to kill the ‘start timer’, so I added it. I’ve had lots of interesting results.
I had to do all these things for it to work, and now it is. It’s awesome, thank you so much! :smiley:

I’m glad you got it all working. However you did not need to change qq since it is a local variable. But whatever works for you is good.

Steve Caldwell
Bome Customer Care


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

Oh. Maybe qq wasn’t a problem then. Thought it was. Anyway, it’s good.
I’m almost done everything (again). Change my mind about things and get new ideas all the time, so it’s been a work in progress for the better part of a year.

I want to show the FL Studio guys a video on what I’ve done. Well, what we have done actually. I would have been dead in the water without your help. Thanks.
( ̄︶ ̄*))
I’ll post the link here to show you too.

Sounds good,

Steve

So I copied over the return translator somewhere else to use it on a similar macro.
It seems to me all I need to do is add gn=1 somewhere in the macro list and the global variable will be on 1, so when I hit enter, it will fire Ctrl + L, then the enter translator reverts it gn=0. I’ve been trying in several different ways, but it just refuses to work.
It looks like rules are processed immediately, so if gn=0 is in the Return rules, it won’t work, because the rules cancelled out the output before it happens. I can’t see the difference between the original that’s working, and this one.
If I do a second delayed translator for return and have that as gn=0, it doesn’t work either. If I get rid of gn=0, then the enter key is stuck on Ctrl + L.

gn=1 needs to be the first translator in a given sequence and gn=0 the last.

You should only need one translator for the return key to send control L when you hit return key.
If you have more than one, then only the first will fire because the rules will set gn back to 0

Pay close attention to the delays. If you have a rule , the rule is not delayed but if there is delayed outgoing action, the outgoing action will have that delay even if the state of gn has changed. The value of gn is only checked in the rules.

Steve Caldwell
Bome Customer Care


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

Ok. I copied the Return translator because the original one will be in a preset that’s deactivated at the time I’m using this new one.
Here is the translators that aren’t working right now. Seems straight forward, but it won’t work. It’s exactly the same as the original that is working. I just don’t get it.
Changed it to gn because g2 didn’t work. Tried gx. Tried taking g2=0 out of the Return translator and then the output is activating a timer, then the timer triggers g2=0. Didn’t work. I dunno.
New Return Test.bmtp (2.9 KB)

Hi translator 1 which has an outgoing action of Return will trigger translator 6 immediately (before the other translators) Is this what you want?

In the last iteration we did not have any translator that outgoing action was keystroke Return.

Steve Caldwell
Bome Customer Care


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

There was a keystroke return in the original. At the beginning I have to have an enter, because that’s what loads the most recent colour for me. I actually copied over that beginning part to make my new part, so they are the same.

I put the g2=1 on the very last translator for that one. But I see your point about it triggering. Although isn’t there a difference between receiving a keystroke from the keyboard and MTP outputting the keystroke?
If I put the g2=1 on the end of this new one, before the Return translator, it doesn’t work. At the beginning, doesn’t work. I’m at a loss. Something is telling the return key that g whatever =o before it has a chance to input. If I remove the gn=0 out of its own translator, it works, but gets stuck on Ctrl + L.
gn was actually a MIDI Buddy left/right screen position counter; that looked like a conflict, so I tried fresh variables (gx?), but still no. Sorry to be a bother, but it should be working but just isn’t. It actually did work a few times at first; I have no idea what changed since then.

I’m unclear of the sequence of mouse movements and key strokes you want to achieve in this one. Especially the extra Return.

Steve Caldwell
Bome Customer Care


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

I just thought to show you all of those as a bundle, to display for you the entire sequence, in this use case. None of them matter about the problem I’m having. Just the last part with F2, F3; that’s the rename dialog that pastes the last used colour favorite in for me. That’s where I rename it and want the Enter key to trigger Ctrl + L, just as the last one you helped me with. I could make a quick video to show what I mean, if you want.

If the variable number active (g2=1) matches the output (if g2=1, then Ctrl + L), which is demonstrated in my example project, I don’t see any reason it shouldn’t work. I guess there is more going on here that is beyond me.

I’ll keep trying, and thanks for all the extra help on this one.

Well g2 doesn’t do anything since you didn’t set it in the first translator. If you use gn in the first translator to flag the start of sequence, then you also need to use gn in the last translator to end the sequence.

I usually set a debug flag to test all of this. In this case I use zz in the first translator and then instead of executing the outgoing actions, I use a the Logging capabilities of MT Pro 1.9 to display what is going on. It makes it much less messy for testing. Once the log shows everything is good, then I simply set zz back to 0 and everything flows to the actual outgoing actions.

Here is an example of the log with zz=1

11703623 - 0.6:4 Log Return for non sequence ignored
11707473 - 0.0:14 Log Middle Mouse at 778 650
11707473 - 0.2:3 Log Left mouse click at 336,80 delay 10ms
11707473 - 0.3:2 Log Keystroke I 3 delay 15ms
11707473 - 0.4:3 Log Keystroke F2 F3 delay 20ms
11707473 - 0.5:3 Log Mouse move  0 0
11731147 - 0.6:10 Log Keystroke Ctl(L)
12062696 - 0.6:4 Log Return for non sequence ignored
12063137 - 0.6:4 Log Return for non sequence ignored
12141641 - 0.6:4 Log Return for non sequence ignored
12141995 - 0.6:4 Log Return for non sequence ignored

And here is the updated project file. I disable the one with outgoing action of return because as I said, it will trigger the last translator. If you don’t want it to trigger the last translator set gn=0 in the rules of the translator that generates return and then set it back to 1 in the rules of the next translator.

New Return Test-sjc.bmtp (3.7 KB)

Steve Caldwell
Bome Customer Care


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

Hmm… I need the return key in this sequence.
So I remembered you mentioned the variable has to be at the beginning of the sequence. Hmm…
I put the first translators, including the needed return key as input velocity 127. I still need to let go of the button, so the last translators as the note off 0 velocity, moved the gn=1 to that first 0 velocity, making that the new beginning sequence.
That did the trick. It’s working now. :grinning: so happy.

Think that is probably the last puzzle piece of this whole project. With the lights and this new plugin manager that I just made, it’s 3,889 translators, spread over 5 controllers now. oof
When I make a video about it, I will post the project here with it, so those with a valid MTP license can download it, if it’s ok with you.

Sounds good,