# First note priority 

**URL:** <https://forum.bome.com/t/first-note-priority/7454>\
**Category:** Translation Projects\
**Tags:** midi-translator\
**Created:** [July 26, 2025, 1:17pm UTC](https://forum.bome.com/t/first-note-priority/7454 "2025-07-26T13:17:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yamahaqs300](https://forum.bome.com/letter_avatar_proxy/v4/letter/y/71e660/32.png) [@yamahaqs300](https://forum.bome.com/u/yamahaqs300)\
**Post date:** [July 26, 2025, 1:17pm UTC](https://forum.bome.com/t/first-note-priority/7454/1 "2025-07-26T13:17:13Z")

</div>

Hello,after many years 🙂  
How I can script that processes only the first MIDI note played (note-on) ( On Ch1) and ignores all subsequent notes until the active note’s note-off message is received. Once the active note is released, the script should allow the next note to be processed.  
It should pass through the first note-on and its corresponding note-off, while blocking all other note-on messages until the active note is released.  
Ideally, it should have minimal latency for real-time performance 🤪  
Thanks in advance!

---

<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:** [July 26, 2025, 5:41pm UTC](https://forum.bome.com/t/first-note-priority/7454/2 "2025-07-26T17:41:57Z")

</div>

Hi,  
Please find the following example.

Here is the psuedo logic used.

```auto
Translator Note-on 

Is this the Same note?
    No
	 Is Note-Off Flag Set?
		Yes
			Yes
				Set new note number (ga)
				Clear Note Off flag (gb )	
				Send New Note-On
			No
			        Send nothing

		 No
		  Send nothing
    No (Same Note)
    	Send nothing

Translator Note-Off

Does it match current note number (ga)
	Yes
		Send Note-Off
		Set Note-Off Flag (gb)

```

[First-Note-Priority.bmtp](https://forum.bome.com/uploads/short-url/3IFuFH4cyni2x7SxIe27qLWDGv.bmtp) (2.8 KB)

Steve Caldwell  
Bome Customer Care

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

---

<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:** [July 26, 2025, 8:05pm UTC](https://forum.bome.com/t/first-note-priority/7454/4 "2025-07-26T20:05:59Z")

</div>

You might want to try this instead, the logic is much simpler. I think I over analyzed the logic on my previous post.

```auto
Translator - Note-ON
Is there a note playing? (global variable ga >=0)
    Yes 
        Do nothing
    No
        Capture note playing note number in global variable ga
        Send Note-ON

Translator - Note-OFF
Is the playing note different than the incoming note-off
      Yes
           Do nothing
       No
           Set Note Playing Off (Set global variable ga to -1)
           Send Note-OFF

```

[First-Note-Priority-a.bmtp](https://forum.bome.com/uploads/short-url/vwqPLLLSQ93DAn3ezbbbFp5g15n.bmtp) (2.4 KB)

Steve Caldwell  
Bome Customer Care

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

---

<div class="post-metadata">

**Author:** ![yamahaqs300](https://forum.bome.com/letter_avatar_proxy/v4/letter/y/71e660/32.png) [@yamahaqs300](https://forum.bome.com/u/yamahaqs300)\
**Post date:** [July 28, 2025, 5:53am UTC](https://forum.bome.com/t/first-note-priority/7454/6 "2025-07-28T05:53:41Z")

</div>

Thank you very much, I`ll try .Glad to see you again 🤗
