Solution: Prevent double action/Filter out Note Off

florian

2006-05-18 11:01:46

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

florian

2006-11-16 19:44:07

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