filter out all MIDI on a timer after single note message

mpvale

2015-09-17 11:37:07

Hi,
I've been playing around with translator a bit over the years for simple translations, but now I'm stuck with what I want to achieve!

I have a video media server that triggers video cues via midi notes or show control, I'd like the ability to hit a key/note that triggers the video clip and for a pre-determined time (the length of the clip) translator filters out all midi data so no other video clips can be triggered whilst the originally triggered clip is playing.

e.g.

midi note E1 triggers clip 1 (duration is 1min) all midi locked out for 1min,

I had a look at the filter double midi note that was on here but can't configure that to work.

DvlsAdvct

2015-09-17 15:53:12

Hi mpvale

Does your video software return any sort of message when a clip stops via MIDI or any other method? Are all of your clips the same length?

Thanks
Jared

mpvale

2015-09-17 16:12:01

No it doesn't, each clip would be a different length, so I would perhaps have to write a different rule for each note/video clip.

DvlsAdvct

2015-09-18 17:06:58

Yeah, each clip would need a different timer. That's not the problem, cause we can easily lock the device until the clips turn off. Each timer, however, would need to be different, and tied to a specific clip. Would the clips be locked to individual buttons? Like, E1 will always trigger the same clip?

mpvale

2015-09-18 19:54:01

Yes, each designated note is only attached to one clip.
So E1 only ever triggers one clip say 1:00min
F1 triggers clip of 1:23min
G1 triggers clip of 1:54min etc etc

DvlsAdvct

2015-09-18 21:36:39

Okay, so it's not that difficult.

You would create your standard translator to trigger the clip, but in the rules of every translator you need to place

Code: Select all

if g0!=0 then exit rules, skip outgoing action
g0=1
Then you create a second translator, with the same incoming message, except the outgoing message is a timer, with a delay the length of the clip. Then a third translator based on that timer, which resets g0 to 0. It would look something like:

Code: Select all

Translator 1: Video Clip 1
Incoming Message: Note On CH1 E1 127 Velocity
Rules: if g0!=0 then exit rules, skip outgoing action
g0=1
Outgoing Message: <whatever you need>

Translator 2: Video Clip 1 Lockout Timer
Incoming Message: Note On CH1 E1 127 Velocity
Rules: none
Outgoing Message: Lock Out 1 Timer, initial delay 1300ms [i]//or however long the clip is[/i]

Translator 3: Video Clip 1 Timer Trigger
Incoming Message: Lock Out 1 Timer
Rules: g0=0
Outgoing Message: None
Does that make sense?
Jared

mpvale

2015-09-19 00:18:41

Hi Jared,

That makes sense, thankyou, I'll try it out tomorrow and report back.

mpvale

2015-10-24 23:54:23

Thanks for this, tried it out, works a treat, the only additional feature I could do with is once the timer is activated I don't really want timer re-triggerd, in other words once the timer is counting its set time (say 1min) it will only lockout for 1min, at the moment if I hit the trigger note again during the lockout time it restarts the timer, effectivly extending the lockout beyond 1min.

hope this makes sense.

Also looking for a translation that from a single note input, outputs incremental notes on each re-trigger,
e.g E1 trigger - E1 out
E1 trigger - F1 out
E1 trigger - F# out etc

8 notes up and then subsequent triggers will only output the final note in the sequence, until the rule is reset (by another midi note) to run the sequence again

mpvale

2015-10-27 12:33:20

Anyone with any help on the above? Could do with something before next week.

DvlsAdvct

2015-10-27 17:10:42

Hi mpvale

Sorry for the delay, let's take a look at the second piece first cause it's the easiest.

You want to have one translator for this, with a global variable that counts up every time it gets pressed. It would look like this:

Code: Select all

Translator 1: Note Count
Incoming Message: Note On: Channel 1
Note E1
Velocity 127
Rules
h0=h0+1
if h0>8 then h0=8
qq=225+h0
Outgoing Message: Note On: Channel 1
Note: qq
Velocity: 127
And then you'd want a separate button that reads out

Code: Select all

Translator 2: Note Reset
Incoming Message: Note On: Channel 1
Note [ ] [i]just use whatever note your reset button uses[/i]
Velocity: 127
rules: h0=0
Outgoing Message: None
For the first piece I need to be in front of MT Pro to test something, which will be after I'm out of work, so in a few hours. I'll have an answer for you this evening, EST.

Thanks
Jared

DvlsAdvct

2015-10-30 02:38:21

Hi mpvale

So to do this you need to put your translators in a very specific order. The "reset" translator needs to come first for this to work.

Code: Select all

Translator 1: Lock Out Reset
Incoming: Note On
Channel: 0 - Channel 1
Note: 28 - E1
Velocity:  127
Rules:
if g0==0 then exit rules, skip outgoing action
Outgoing: Timer
Lock Out Timer
[i]Set whatever delay you want[/i]

Translator 2: Send MIDI Message
Incoming: Incoming: Note On
Channel: 0 - Channel 1
Note: 28 - E1
Velocity:  127
Rules:
if g0!=0 then exit rules, skip outgoing action
Outgoing: [i]Whatever MIDI Message you need[/i]

Translator 3: Launch Timer
Incoming: Note On
Channel: 0 - Channel 1
Note: 28 - E1
Velocity:  127
Rules:
if g0=1
Outgoing: Timer
Lock Out Timer
[i]Set whatever delay you want[/i]
Let me know if that works.
Jared

mpvale

2015-11-02 18:54:34

Hi Jared,

Thanks for this, I'm starting to understand better the 'if' function and rules a little better, I gave the new timer code a go, but seem to only get it to trigger once! maybe the reset doesn't reset?

Matt

DvlsAdvct

2015-11-02 20:03:17

Well that's not good.

Can you copy and paste the log window so i can see the timer go off successfully, and then with you restarting it?

Thanks
J

mpvale

2015-11-02 20:23:46

Screen Shot 2015-11-02 at 19.22.05.png
Screen Shot 2015-11-02 at 19.22.05.png (76.45 KiB) Viewed 10165 times
Here you are, 1st time with output to bome virtual out
2nd time without output

M

DvlsAdvct

2015-11-02 20:34:10

Do you have a translator for the timer? I don't see that going off to reset the variable.

mpvale

2015-11-02 20:47:42

Screen Shot 2015-11-02 at 19.46.46.png
Screen Shot 2015-11-02 at 19.46.46.png (19.45 KiB) Viewed 10148 times
I have the 3 translators as above

DvlsAdvct

2015-11-02 20:55:06

Oh, I guess I wasn't clear. You still need the fourth translator for the timer to go off and reset the variable.

Code: Select all

Translator 3: Video Clip 1 Timer Trigger
Incoming Message: Lock Out 1 Timer
Rules: g0=0
Outgoing Message: None

mpvale

2015-11-02 21:13:29

ahh, i've added the timer, 4th translator. I still seem to be able to trigger the timer with E1, rather than it carry on counting in background regardless of midi input:
Screen Shot 2015-11-02 at 20.10.25.png
Screen Shot 2015-11-02 at 20.10.25.png (108.7 KiB) Viewed 10138 times

mpvale

2015-11-02 21:13:56

apart from that it does work now!

DvlsAdvct

2015-11-02 21:18:07

I must have misunderstood what you were looking for. I thought you wanted to be able to reset the timer by pressing E1 again. Action would be something like

Press E1
MIDI Signal sends
No other MIDI signals will work
4000ms go by, then other MIDI signals can be sent.

Or

Press E1
MIDI Signal sends
No other MIDI signals send
Press E1 before 4000ms end and timer resets for another 4000ms.

Where is it going wrong?

mpvale

2015-11-02 22:26:45

It might also be my description!

Its:
Press E1
MIDI Signal sends
No other MIDI signals will work
4000ms go by, then other MIDI signals can be sent.

DvlsAdvct

2015-11-02 22:29:30

So other MIDI signals are still getting through?

J

mpvale

2015-11-02 22:39:25

I don't think they are, only the note I want (E1) is getting through which is great and being blocked during the timer (good), however if I hit E1 again during the timer time it restarts the timer for 4000ms, so I can end up with E1 being locked out for for longer than 4000ms. I want the lockout timer to run and lockout all midi only for the specified time (4000ms) regardless of either E1 retrigering (or other midi data) inside that time.

M

DvlsAdvct

2015-11-02 22:42:35

OH! I totally misunderstood. I thought you wanted to be able to continue the lockout if you keep pressing E1 (in this example).

Can you explain the step by step for this interaction? We are on the same page for the initial press

Press E1
E1 sends
All other MIDI data locked out for 4000ms
After 4000ms all MIDI data can pass.

How do you want it to react if you hit E1 a second time BEFORE 4000ms has passed?

mpvale

2015-11-02 22:57:13

Great, always tricky trying to decipher intentions!

I want it to ignore E1 if its triggered again before 4000ms has passed

mpvale

2015-11-27 00:23:02

hi Jared
did you have a chance to look the the above, basically i only want the timer to count once, regardless of hitting the midi note E1 again

DvlsAdvct

2015-11-30 16:37:29

Hi mpvale

Let me know if this works

Code: Select all

Translator 1: Video Clip 1
Incoming Message: Note On CH1 E1 127 Velocity
Rules: if g0!=0 then exit rules, skip outgoing action
g0=1
Outgoing Message: <whatever you need>

Translator 2: Video Clip 1 Lockout Timer
Incoming Message: Note On CH1 E1 127 Velocity
Rules: if g0!=1 then exit rules, skip outgoing action
g0=2
Outgoing Message: Lock Out 1 Timer, initial delay 4000ms

Translator 3: Video Clip 1 Timer Trigger
Incoming Message: Lock Out 1 Timer
Rules: g0=0
Outgoing Message: None