# Strange behavior of MIDI encoder (sending two and three messages at the same time)

**URL:** <https://forum.bome.com/t/strange-behavior-of-midi-encoder-sending-two-and-three-messages-at-the-same-time/6419>\
**Category:** Bome Products\
**Tags:** midi-translator, xone-k2\
**Created:** [August 6, 2024, 9:55am UTC](https://forum.bome.com/t/strange-behavior-of-midi-encoder-sending-two-and-three-messages-at-the-same-time/6419 "2024-08-06T09:55:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adriangarciaselva](https://forum.bome.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@adriangarciaselva](https://forum.bome.com/u/adriangarciaselva)\
**Post date:** [August 6, 2024, 9:55am UTC](https://forum.bome.com/t/strange-behavior-of-midi-encoder-sending-two-and-three-messages-at-the-same-time/6419/1 "2024-08-06T09:55:14Z")

</div>

Hello everyone!  
First of all, thanks for this fantastic software and for the great support forum. I’ve been using Bome Midi Translator for a little while now, and it has helped me to detect what is probably a hardware problem with my controller (Xone K1).  
The problem is as follows. When I turn an encoder, occasionally and randomly up to two and three messages are sent at a time. Here below I write the log of the log window as an example. Each paragraph break corresponds to a physical manipulation of the encoder by me, or in other words, each paragraph break corresponds to a single right turn of the encoder (lines 0, 2, 6, 10, 12, 14, 17, 19, 21…). As you can see, sometimes, instead of a single message being sent, up to two and three messages are sent (for example, lines 3, 4, 5 or lines 15, 16), and sometimes this happens without even a millisecond between messages (three messages at a time, lines 7, 8, 9). This strange behavior (which I assume is due to a physical wear of the encoder) causes me a lot of problems to manipulate it accurately.

Log window:  
_0_  
_1 244425 - MIDI IN [XONE:K1]: BD 14 01_  
_2_  
_3 245236 - MIDI IN [XONE:K1]: BD 14 01_  
_4 245237 - MIDI IN [XONE:K1]: BD 14 7F_  
_5 245237 - MIDI IN [XONE:K1]: BD 14 01_  
_6_  
_7 247008 - MIDI IN [XONE:K1]: BD 14 01_  
_8 247008 - MIDI IN [XONE:K1]: BD 14 7F_  
_9 247008 - MIDI IN [XONE:K1]: BD 14 01_  
_10_  
_11 248513 - MIDI IN [XONE:K1]: BD 14 01_  
_12_  
_13 249039 - MIDI IN [XONE:K1]: BD 14 01_  
_14_  
_15 249576 - MIDI IN [XONE:K1]: BD 14 01_  
_16 249580 - MIDI IN [XONE:K1]: BD 14 01_  
_17_  
_18 251282 - MIDI IN [XONE:K1]: BD 14 01_  
_19_  
_20 251864 - MIDI IN [XONE:K1]: BD 14 01_  
_21_  
_22 252441 - MIDI IN [XONE:K1]: BD 14 01_  
_23_  
_24 253541 - MIDI IN [XONE:K1]: BD 14 01_  
_25_  
_26 254112 - MIDI IN [XONE:K1]: BD 14 01_  
_27_  
_28 254968 - MIDI IN [XONE:K1]: BD 14 01_  
_29_  
_30 255510 - MIDI IN [XONE:K1]: BD 14 01_  
_31_  
_32 256051 - MIDI IN [XONE:K1]: BD 14 01_  
_33_  
_34 256575 - MIDI IN [XONE:K1]: BD 14 7F_  
_35 256581 - MIDI IN [XONE:K1]: BD 14 01_  
_36_  
_37 258109 - MIDI IN [XONE:K1]: BD 14 01_  
_38_  
_39 258655 - MIDI IN [XONE:K1]: BD 14 01_  
_40 258661 - MIDI IN [XONE:K1]: BD 14 01_  
_41_  
_42 260350 - MIDI IN [XONE:K1]: BD 14 01_  
_43 260350 - MIDI IN [XONE:K1]: BD 14 7F_  
_44 260350 - MIDI IN [XONE:K1]: BD 14 01_

I have seen in the forum that similar questions raise the use of a timer to avoid that almost instantaneous messages are transmitted, but that would not be possible in my case, since, as you can see, some erroneous messages are sent exactly at the same time. In addition, I have tried the timer solutions indicated by some users and they do not solve the problem ([Minimum amount of time between two messages - Bome Forums Archive 2005 - 2016](https://www.bome.com/forums/3/12199/minimum-amount-of-time-between-two-messages/#)).

My question is: could I use some function of Bome Midi Translator to filter the wrong messages so that only the last message sent by the K1 encoder is processed? I think this would be the optimal solution for my problem.  
Of course, any help is welcome.

PS: I also attach a link to Google Drive to a video of the wrong behaviour of the encoder (it is the same from which I extract the log from the log window, so each paragraph break corresponds to a single right turn of the encoder): https://drive.google.com/file/d/1io7k3hx9POZJhCZBFw1xbsNAVfy-uXNK/view?usp=sharing

Thank you very much in advance!

Best regards!

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [August 6, 2024, 2:20pm UTC](https://forum.bome.com/t/strange-behavior-of-midi-encoder-sending-two-and-three-messages-at-the-same-time/6419/2 "2024-08-06T14:20:06Z")

</div>

Hi and welcome to the Bome community!

Well fortunately, since MIDI is a serial event and all coming from the same MIDI port, the messages are actually not happening at the same, time. The timestamp simply has a resolution of 1 millisecond and the messages are probably arriving within microseconds of each other which would explain the timestamp.

I’ve rigged up a project file that I believe should work.

The first translator triggers a one-shot timer ‘Suppress’ which will trigger in one ms after receiving the incoming message but only if the global variable ga is the default value of 0.

The second translator passes the MIDI message through but only if ga=0.

The third timer triggers after 1ms delay setting ga back to zero thereby allow MIDI messages to pass through again.

So in essence, if the are multiple incoming MIDI messages within the 1ms window, only the first one should get through.

Here I send multiple MIDI messages all within 1 ms and only the first one comes through.

```auto
bd 14 01
bd 14 7F
bd 14 01
bd 14 01
bd 14 7F
bd 14 01

```

Here is the log

```auto
2035343 - MIDI IN [XONEK1]: BD 14 01
2035343 - MIDI OUT [Bome MIDI Translator 1 Virtual Out]: BD 14 01
2035344 - MIDI IN [XONEK1]: BD 14 7F
2035344 - 0.1:1 Message Suppressed
2035344 - MIDI IN [XONEK1]: BD 14 01
2035344 - 0.1:1 Message Suppressed
2035344 - MIDI IN [XONEK1]: BD 14 01
2035344 - 0.1:1 Message Suppressed
2035344 - MIDI IN [XONEK1]: BD 14 7F
2035344 - 0.1:1 Message Suppressed
2035344 - MIDI IN [XONEK1]: BD 14 01
2035344 - 0.1:1 Message Suppressed
2035345 - 0.2:1 Log Suppress Timer Triggered - resetting ga to 0

```

I’ve set up my aliases as follows:

![image](https://forum.bome.com/uploads/default/original/2X/c/c3e0ba7204be813e4dbdaeccf414fa38c9f2c5b0.png)

You can learn more about aliases from [this tutorial](https://youtu.be/CrE391VJL0s).

And the project file.  
[Suppress-Dup-test-2024-08-06.bmtp](https://forum.bome.com/uploads/short-url/3oD65R6C8UDHURj4GlBkpCZtJUn.bmtp) (1.5 KB)

Good luck!

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![adriangarciaselva](https://forum.bome.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@adriangarciaselva](https://forum.bome.com/u/adriangarciaselva)\
**Post date:** [August 8, 2024, 8:46pm UTC](https://forum.bome.com/t/strange-behavior-of-midi-encoder-sending-two-and-three-messages-at-the-same-time/6419/3 "2024-08-08T20:46:10Z")

</div>

Wow Steve! Thank you so much for your quick response and for the project! With that translator the wrong behavior of the encoder has been fixed. Thank you very much!  
Without a doubt, Bome Midi Translator is fantastic and opens an infinite range of possibilities with our midi controllers.

Best regards!
