This forum is read-only. Please post new topics in our Q&A forum.

Solution: Prevent double action/Filter out Note Off

General discussion about MIDI Translator

Moderators: florian, DvlsAdvct

Post Reply
User avatar
florian
Bome Software: Founder
Posts: 2435
Joined: Thu Apr 28, 2005 10:09 pm
Location: Munich, Germany
Contact:

Solution: Prevent double action/Filter out Note Off

Post by florian » Thu May 18, 2006 10:01 am

Hi,

a common problem with MT is this:
when you convert NOTE ON/NOTE OFF messages, pressing the key will produce a NOTE ON message (e.g. 90 40 pp) with variable velocity (pp). Releasing the key produces a NOTE ON message with velocity 0 (e.g. 90 40 00). That is, by MIDI spec, equivalent to a NOTE OFF message.

Now a translator with this scheme:

INCOMING ACTION: MIDI 90 40 qq
OUTGOING ACTION: "something useful"

will cause "something useful" to be triggered twice when you play key 0x40 on your keyboard: once for pressing it down, and another time for releasing the key.

One way to circumvent this is to only catch the NOTE OFF message, i.e.
INCOMING ACTION: MIDI 90 40 00
OUTGOING ACTION: "something useful"

but that's awkward in many cases, because "something useful" will only be triggered after releasing the note.

A better solution to exclude 0 from qq is to create a new Translator before your "real" translator and let it "eat" the message with 0 velocity. So, say you want to convert all key down messages to controller 7 messages, do it like this:

Translator 1:
GENERAL: Stop processing: yes
Incoming: 90 pp 00
Outgoing: nothing (or empty MIDI OUT field)

Translator 2:
GENERAL: Stop processing: yes
Incoming: 90 pp qq
Outgoing: B0 00 qq

Stop Processing means that Midi Translator will not continue with further Translators in the list, even if their Incoming Action matches (otherwise you have Translator 1 and Translator 2 executed).

However, you can create multiple actions for one incoming message by creating 2 Translators with the same input action and unchecking the first Translator's "Stop Processing" (see http://www.bome.com/forums/viewtopic.php?t=204 for more info on that)

Florian
Last edited by florian on Sun Nov 19, 2006 10:28 pm, edited 1 time in total.

User avatar
florian
Bome Software: Founder
Posts: 2435
Joined: Thu Apr 28, 2005 10:09 pm
Location: Munich, Germany
Contact:

Post by florian » Thu Nov 16, 2006 7:44 pm

With Midi Translator Pro, you can do all this much more elegant with Rules:

INCOMING ACTION: MIDI 90 40 qq
OUTGOING ACTION: "something useful"

can be executed only when qq is not 0 with this Rule:
IF qq==0 THEN exit Rules, skip Translator

Florian

Post Reply