1 keystroke sent from knob if turned before 2 seconds

dollanaire78

2012-12-19 10:53:29

Hi guys. I was wondering if anyone could help with this. I'm trying to have a knob send a keystroke only once while its being turned and if I stop turning it for 2 seconds it would send one keystroke again when turned and so on. Please help with the rules :-) Thanks

dollanaire78

2012-12-23 07:35:29

Please can someone answer this please... I've looked through the board and only can find posts kinda similar but not sure how to do this particular thing. Maybe I can explain it a little better.

I would like to have a knob send one keystroke while being turned and if not being turned for 2 seconds it restart the process again once turned. I would greatly appreciate any assistance with this. Thanks guys

Sakis

2012-12-23 13:01:34

Code: Select all

Preset 0: New Preset

Translator 0.0: New Translator
Options: stop=false
Incoming: MIDI B0 01 pp
Rules: 
  ga=ga+1
  if ga>1 then exit rules, skip Outgoing Action
Outgoing: Keystroke: Ctrl 

Translator 0.1: New Translator
Options: stop=false
Incoming: MIDI B0 01 pp
Rules: 
  if ga>1 then exit rules, skip Outgoing Action
Outgoing: One-shot timer "2sec": 2000 ms delay

Translator 0.2: New Translator
Options: stop=false
Incoming: On timer "2sec"
Rules: 
  ga=0
Outgoing: (none)
You can replace the "B0 01 pp" midi message to whatever you want ,same with Keystroke "Ctrl" :)

dollanaire78

2012-12-24 01:32:27

WOOOOW Thank you so much!! I really appreciate you solving this for me. Its funny how things are like magic tricks in that once you see the solution you see how simple it was all along :D I did however have to make one correction which I'm sure was just an over site.


The second translator rule should end with execute outgoing action instead of skipping.

Thanks again!

Sakis

2012-12-24 12:19:12

dollanaire78 wrote:WOOOOW Thank you so much!! I really appreciate you solving this for me. Its funny how things are like magic tricks in that once you see the solution you see how simple it was all along :D I did however have to make one correction which I'm sure was just an over site.
The second translator rule should end with execute outgoing action instead of skipping.
Thanks again!
No problem :) .It takes time to understand how MT works but the learning curve is the fastest (IMO) among other software.
If you mean the translator 0.1 as the "second translator" it should skip outgoing action.Else it would start the "2sec" timer too many times(actually "pp" times,even 127 times if you full rotate the knob from 0 to 127) ,but you need only once to get "ga=0" in a period of 2 sec.
The concept is simple:
start rotation->ga=1(ga=ga+1,meaning ga=0+1)->keystroke->ignore all actions (ga=ga+1,meaning ga>1) for a 2 second period(until ga=0 again).