Hi,
I guess what you really need is a
clock. The timers in MT allow delayed and/or repeated execution of Translation actions, so they're not perfect what you are trying to do.
However, there is a way to do that right in MT Pro: use a high frequency timer (e.g. every 5 milliseconds) and as only action it increases a variable, e.g. "gt" by 5. Now gt is your clock, and you can query it in the drum Translators. The following is an example preset:
Code: Select all
Translator 1: Set Timer
Options: stop=false
Incoming: Project Opened
Outgoing: Periodic timer "Clock": 5 ms (initial delay: 5 ms)
Translator 2: Clock Timer
Options: stop=false
Incoming: On timer "Clock"
Rules: Increase gt
gt=gt+5
Outgoing: (none)
Translator 3: Change Drum Note if Fast
Options: stop=false
Incoming: MIDI 90 40 pp
Rules:
Label "Ignore if velocity=0"
if pp==0 then exit rules, skip Outgoing Action
Label "calculate time from last drum note"
tt=gt-ga
Label "Remember current time in ga"
ga=gt
Label "Calculate note to play"
qq=64
if tt<=200 then qq=65
Outgoing: MIDI 90 qq pp
Translator 3 will react on note 0x40 (hexadecimal), which is 64 decimal. It will calculate the time from the last time this note was played in the variable tt by subtracting ga (last time of note) from gt(current time). Then it will store the current time in ga. Last, it will inspect tt (the time it took from the last note to the current note). If it is smaller or equal than 200 milliseconds = 0.2 seconds, then the note is changed from 64 to 65. The Outgoing action will then play the note 64 or 65 stored in variable qq.
The timer is started when the project is loaded. You will probably want to add other ways to start the timer, too, because timers are sometimes reset (e.g. when pressing the panic button).
Also, note that the approach above is somewhat CPU intense, because the timer is called so often. You should check, e.g. with the task manager, how much CPU is taken by MT with the timer. My computer, however, shows "0%" CPU usage with the preset above... Anyway, if too bad, you may want to increase the repeat time of the timer to use less CPU, and change the gt add number from 5, too (at the expense of less resolution of the clock).
Regards,
Florian