suppressing repeating buttons

jgowen

2012-07-23 14:59:18

to:MidiTranslator forum
re:suppressing repeating buttons
Mon 7/23/2012 8:50 am

I successfully got MidiTranslator to control the Miditzer PC virtual organ combination buttons from a Nord C2's stop buttons, and it works fairly well.

One problem I'd like to fix is, if I press the Nord button too long or twice etc., Miditzer "gets" the thing two or more times, and sometimes this makes it unhappy.

I tried putting a 500 ms delay on "outgoing"; that delays the outgoing MIDI for half a second, but if there were multiple Nord button presses, they'll just follow -- that is, a bunch quickly just as before, except now initially delayed by half a second.

Ideally what I want is logic like:

1. Detect Nord MIDI.

2. Send outgoing to Miditzer.

3. Delay for half a second, while throwing-away *all* incoming MIDI, so any subsequent button presses, key presses, etc. are discarded.

How do I do that?

-- best wishes,

j.g.owen * owenlabs.org

DvlsAdvct

2012-07-23 21:02:00

Hi jgowen.

What you want to do is totally possible, and without the need for a 500ms delay. Now, this is pending the type of messages that the Nord seems to be sending, but my guess is this should work.

The idea is you want to have no messages go out until after you release the currently held button. So you press a button and nothing will happen AFTER that signal until AFTER you release it. Make sense? I'm going to put it together so it's all tied to one button, but we can expand that to a group of buttons if need be, or even all buttons.

Code: Select all

Translator 1: Button Press
Incoming Message: 90 00 7F
Rules: if g0!=0 then exit rules, skip outgoing action
g0=1
Outgoing Message: 90 00 pp

Translator 2: Button Release
Incoming Message: 90 00 00
Rules: g0=0
Outgoing Message: None

Translator 3: Lockout
Incoming Message: pp qq rr
Rules: if g0!=0 then exit rules, skip outgoing action
Outgoing Message: pp qq rr
That make sense?

jgowen

2012-07-23 21:47:38

//Mon 7/23/2012 3:41 pm. But I *will* need the delay, I think; it's not a Nord button up/down thing; I think Nord auto-repeats if you hold a button down too long, or I just accidentally hit 'em a few times. It's like

0. A Nord button is pressed. Nord MIDI is emitted.

1. Detect Nord MIDI.

2. Send outgoing to Miditzer.

3. Delay for half a second, while throwing-away *all* incoming MIDI, so any subsequent button presses, key presses, etc. are discarded. I.e., any additional #0s.

You understand, once I got something working, I'd finesse it down to 200 ms or whatever....

DvlsAdvct

2012-07-23 22:17:09

Oh, okay, I misunderstood. So the problem is also that messages are being sent after you hit the button whether or not you release it?

What we'll do is reverse the logic a little. When the button is pressed a lockout will occur, preventing any MIDI signal from getting sent for 500ms, then the trigger gets sent, but OTHER messages still won't be sent until the button in released. The question still remains, does this have to apply to every button and key, or just specific ones?

Code: Select all

Translator 1: Key Press
Incoming Message: 90 00 7F
Rules: if g0!=0 then exit rules, skip outgoing action
g0=1
Outgoing Message: Key lock Timer 500ms

Translator 2: Locked Messages
Incoming Message: pp qq rr
Rules: if g0!=0 then exit rules, skip outgoing action
Outgoing Message: pp qq rr

Translator 3: Key Message
Incoming Message: Key Lock Timer
Outgoing Message: 90 00 7F

Translator 4: Unlock Keys
Incoming Message: 90 00 00
Rules: g0=0
Outgoing Message: 90 00 00

jgowen

2012-07-24 20:04:32

Tue 7/24/2012 1:40 pm. I think we're still on the wrong page. There *is no* button release.

Let me communicate a little. This is what's in my nordmitz2.bmtp:

Name0=nord #1 ON to lower 1 (pp)
Incoming0=MID1B0107F
Outgoing0=MID1C00A
Options0=Actv01Stop01OutO00

Name1=nord #2 ON to lower 2
Incoming1=MID1B0117F
Outgoing1=MID1C00B
Options1=Actv01Stop01OutO00

and onwards up to Name25. "B0107F" is what the Nord sends when I press a stop "on" key (in the Nord C2 pipe organ emulation). When I press the stop key once and release it immediately, MIDIox sees

00000B88 2 1 B0 10 7F 1 --- Control Change

If I continue pressing it, as I am wont to do in the fog of music, MIDIox sees:


00000B88 2 1 B0 10 7F 1 --- Control Change
00000C6A 2 1 B0 10 7F 1 --- Control Change
00000CCD 2 1 B0 10 7F 1 --- Control Change
00000D30 2 1 B0 10 7F 1 --- Control Change
00000D92 2 1 B0 10 7F 1 --- Control Change
00000DF5 2 1 B0 10 7F 1 --- Control Change
00000E58 2 1 B0 10 7F 1 --- Control Change
00000EBA 2 1 B0 10 7F 1 --- Control Change
00000F1D 2 1 B0 10 7F 1 --- Control Change

(This no doubt Nord implementing the B3 functionality or who knows.) So that's what I want to intercept. Also I probably accidentally hit one of the adjoining buttons sometimes accidentally.

This current arrangement does not routinely malfunction; it's just *sometimes* it obviously malfunctions when I hold down a button too long or, probably, press another accidentally. I know these things happen because Miditzer makes a very satisfying "clonking" noise whenever a combination is activated.

So is this possible? --

0. The Nord stop button is pressed, emitting B0107F.

1. MT detects B0107F.

2. MT sends C00A to Miditzer.

3. THEN somehow MT *stops* all other MIDI input/output, in this entry and all others, for a specified time.

That do-able? I won't commit hari-kari if it isn't; but my ignorance of MidiTranslator is even greater than that of most things, so....

DvlsAdvct

2012-07-24 20:16:53

Yes it's doable. Did either solution I provide works? If you don't need the 500ms delay it's as simple as setting a global variable on pressing down B0 10 7F and not allowing any other command to go through until it is released. That was my first provided solution.

Code: Select all

Translator 1: Stop Button
Incoming Message: B0 10 7F
Rules:if g0!=0 then exit rules, skip outgoing action
g0=1
Outgoing Message: c0 0A 7F

Translator 2: Unlock
Incoming Message: B0 10 00
Rules: g0=0
Outgoing Message: None

Translator 3: Lockout
Incoming Message: pp qq rr (this means any incoming message)
Rules: if g0!=0 then exit rules, skip outgoing action
Outgoing Message: pp qq rr

jgowen

2012-07-25 14:03:01

Wed 7/25/2012 7:49 am.

>> it's as simple as setting a global variable on pressing down B0 10 7F and not allowing any other command to go through until it is released. <<

>> Translator 1: Stop Button <<

*There is no stop button.* Each Nord stop has two buttons, one of which turns the Nord stop on and one off, but that's what the *Nord* does with 'em. They also emit different MIDI messages -- as you guessed correctly, the off button is a message with a 00 value. However I use those for *other* Miditzer combinations; I wouldn't abandon that functionality for the inconvenience of having to press another button just to prevent accidentally pressing another button!

Hence, the delay. ... So I will ponder this mystery; I suspect somewhere in the incoming and outgoing timers there is a solution....

-- best wishes,

j.g.owen * owenlabs.org