# Send Midi Command \> Control Change: Channel Bug

**URL:** <https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357>\
**Category:** Bugs or Unexpected Behavior\
**Created:** [July 19, 2024, 1:02pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357 "2024-07-19T13:02:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordikt](https://community.folivora.ai/user_avatar/community.folivora.ai/jordikt/32/26021_2.png) [@jordikt](https://community.folivora.ai/u/jordikt)\
**Post date:** [July 19, 2024, 1:02pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/1 "2024-07-19T13:02:18Z")

</div>

BTT v4.643 macos ventura 13.6.7

"Send Midi Command" \> "Control Change" is sending the midi cc always through channel 1 (channel 0).

It doesn't matter what channel do I type in the field, it always use channel 1 (channel 0):

 ![Captura de pantalla 2024-07-19 a les 14.52.01](https://community.folivora.ai/uploads/default/original/3X/9/3/93ac9ecb0ed363dc54bf4d58dd0b74920ca70631.png)

Please take a look to this post also. There is a bug in the list of ports, all ports are duplicated:

> [@"Send Midi Command" Implementation](https://community.folivora.ai/t/send-midi-command-implementation/38196):
>
> I am very very happy to see that v4,616 can send midi commands!!!!! I have been testing it and works like a charm. Thanks a lot Andreas to implement this feature, this is a game changer to me (and sure for most of the BTT musicians). Some comments/ideas regarding this new action: Midi Channel Now Midi Channel accepts values from 0 to 15, but the majority of users prefers to use 1 to 16, so I would suggest to add a global setting where users can choose the desired range (0-15 or 1-16). Mi…

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [July 19, 2024, 3:17pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/2 "2024-07-19T15:17:44Z")

</div>

I‘ll have a look! Unfortunately I don’t know anything about midi, BTT just shows the ports it received from the system. Does it matter which one you select?

---

<div class="post-metadata">

**Author:** ![andreypetr](https://community.folivora.ai/user_avatar/community.folivora.ai/andreypetr/32/35519_2.png) [@andreypetr](https://community.folivora.ai/u/andreypetr)\
**Post date:** [July 19, 2024, 6:16pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/3 "2024-07-19T18:16:44Z")

</div>

How can we help you with clean implementation? Do you have any questions we can help you with so you don't waste time learning?

---

<div class="post-metadata">

**Author:** ![jordikt](https://community.folivora.ai/user_avatar/community.folivora.ai/jordikt/32/26021_2.png) [@jordikt](https://community.folivora.ai/u/jordikt)\
**Post date:** [July 19, 2024, 11:03pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/4 "2024-07-19T23:03:33Z")

</div>

Hi @Andreas_Hegenberg

If you don't know anything about midi, and you have implemented the midi triggers section and the send midi action, you are more than brilliant.

I don't know nothing about midi programming, but I am an experienced user in midi configurations.

I will try to tell you the midi basics, and how to test the current or future midi functions you develop for BTT.

**1 - MIDI basics**

There are different kinds of midi messages, like sysex messages (Sysex means System Exclusive) or NRPN (Non-Registered Parameter Number). These kind of midi messages could be implemented in the future, but not now (I assume that must be complex to implement them).  
IMHO with the current messages we have in BTT (note on, note off, control change(cc), program change(pc), pitchbend(pb), channel pressure(cp)) we can do a lot of things.

**CHANNELS AND PORTS**

Any midi message (note on, note off, cc, pc, pb, cp) need a midi channel and a midi port to be transmitted.  
There are 16 midi channels. There is no difference between them. They can be numbered from 0 to 15, or from 1 to 16. The midi channel is part of the midi message, it has no relation with the midi port.  
Midi ports are the highways between devices. You can think of them like cables that connect one midi device to the computer, or one midi device to another midi device.  
Midi devices usually have two midi ports: midi IN and midi OUT.  
MIDI IN is the highway where all midi messages sent TO an specific device will be transmitted to.  
MIDI OUT is the highway where all midi messages sent FROM an specific device will be transmitted to.

Example:

Let's say you have a Yamaha midi mixer device connected to a macbook pro with Logic. Both devices are connected with a thunderbolt cable. The thunderbolt cable is a double cable that connects:

- the Logic midi out port to the Yamaha midi in port
- the Yamaha midi out port to the Logic midi in port

If you want to move the fader of the Yamaha mixer and then see that the fader in Logic moves accordingly, you should configure this midi configuration in Logic:

**control change number 7** (it's the cc of the fader, it could be another one)  
**velocity x** (x=0 to 127 : 0 is fader at the bottom / 127 is fader at the top)  
**channel 1** (it could be anyone)  
**Logic Pro midi in port: Yamaha midi out port**  
**Logic Pro midi out port: None**

If you want also to move the fader in Logic Pro and then see that the fader in Yamaha mixer moves accordingly, you have to configure Logic Pro like this:

**control change number 7**  
**velocity x**  
**channel 1**  
**Logic Pro midi in port: Yamaha midi out port**  
**Logic Pro midi out port: Yamaha midi in port**

Midi ports can also be virtual ports. This means that the midi in and the midi out ports cables are virtual and instead of connecting devices you can connect software apps.

Very Important: It's a golden rule to not share midi ports to send and receive midi messages and not share midi ports betweeen different devices. One port only for send from one device to another device. One port only for receive from one device to another device.

**NOTE ON** : It represents a key pressed on a keyboarf pressed. The intensity you press the key is determined by the midi velocity value.

**NOTE OFF** : It represents a key released on a keyboarf pressed. The velocity you release the key is determined by the midi velocity value.

**2 - AUDIO MIDI SETUP app**

Open the Audio Midi Setup \> Midi Studio \> IAC Configuration: Create here two virtual midi ports. Call the two ports with clear names that define the direction of the communication:

BetterTouchTool\_To\_PocketMidi  
PocketMidi\_To\_BetterTouchTool

**3 - POCKET MIDI app**

Download this app from appstore or from the [website](https://www.morson.jp/pocketmidi-webpage/)

This app is a perfect tool to send and receive midi messages and monitor also all the midi transmissions.

In the menubar select the port "BetterTouchTool\_To\_PocketMidi" as the InputPort.

In the menubar select the port "PocketMidi\_To\_BetterTouchTool" as the OutputPort.

In the menubar there is the views menu. Open the views and configure and save a layout like this:

 ![Layout 1](https://community.folivora.ai/uploads/default/original/3X/5/b/5b352c4cbc33b1c4282fb6a068ecf588ba812c68.jpeg)

Now you can press any key of the keyboard and a note on/off will be transmitted with the selected channel and velocity to the output port (to BTT)

Pressing the transmit button you can send cc, pc, pb, etc to the output port.

All midi messages sent from BTT to the midi port "BetterTouchTool\_To\_PocketMidi" will be listed in the MIDI IN MONITOR of the Pocket Midi app

* * *

Finally, I would like to suggest you to open a "Midi Development Thread" where all users can share ideas/bugs/questions (something similar to the "Floating Menu Alpha Development Thread" you started last year)

---

<div class="post-metadata">

**Author:** ![jordikt](https://community.folivora.ai/user_avatar/community.folivora.ai/jordikt/32/26021_2.png) [@jordikt](https://community.folivora.ai/u/jordikt)\
**Post date:** [July 19, 2024, 11:17pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/5 "2024-07-19T23:17:18Z")

</div>

> [@Andreas\_Hegenberg](#):
>
> I‘ll have a look! Unfortunately I don’t know anything about midi, BTT just shows the ports it received from the system. Does it matter which one you select?

I have tested it and it doesn't matter wich one I select. If I select the original name port, it works. If I select the duplicated reduced name port, it works too.

Anyway, it seems to me that it should be fixed to only show the ports with the original names. I don't know how you get the list of ports, but I get the same name and quantity of ports in any of my music apps.

Here is a screenshot of the listed ports in PocketMidi:

 ![Input ports](https://community.folivora.ai/uploads/default/original/3X/8/e/8e9d04872704f7f2231f2eca316c9f962c858338.png)

I get the same list in Cubase, Live, Bome, etc.

But in BTT I get this list:

 ![Duplicated Midi Ports](https://community.folivora.ai/uploads/default/original/3X/a/7/a74f044868f87228937e4d17c02215d9e3c3fda1.png)

The duplicated ports are only the IAC ports. The hardware ports of my audio sound card are not duplicated, but the name is reduced.

In the other hand, the 13 correct IAC names are repeated twice.

---

<div class="post-metadata">

**Author:** ![jordikt](https://community.folivora.ai/user_avatar/community.folivora.ai/jordikt/32/26021_2.png) [@jordikt](https://community.folivora.ai/u/jordikt)\
**Post date:** [August 10, 2024, 2:15pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/6 "2024-08-10T14:15:24Z")

</div>

Hi @Andreas_Hegenberg

I'm on version 4,660

The channel bug is still not fixed.

Send Midi \> Control Change always send midi messages through channel 1.

As example, this configuration sends Control Change number 12 value 12 thorugh channel 1 instead of channel 12:

 ![Captura de pantalla 2024-08-10 a les 16.13.01](https://community.folivora.ai/uploads/default/original/3X/a/3/a3310c54e64ecc143f19ae8182f756d6fd9a8584.png)

---

<div class="post-metadata">

**Author:** ![mrdrennan](https://community.folivora.ai/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mrdrennan](https://community.folivora.ai/u/mrdrennan)\
**Post date:** [May 17, 2025, 4:28pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/7 "2025-05-17T16:28:41Z")

</div>

Oh man...I just painstakingly created over 1000 Logic Pro Key Command assignments using the "Send MIDI Command" action, and my experience is exactly the same as @jordikt. Nothing is sending as programmed in the action list. MIDI CC messages seem to only go out on channel 1 and in some cases the MIDI commands are not sending at all as verified by a MIDI monitor application running in the background. Is there any plans to correct? I was really hoping to use the custom menus and widgets to send MIDI assigned key commands to Logic but the experience has been frustrating so far.

Thank you.

---

<div class="post-metadata">

**Author:** ![mrdrennan](https://community.folivora.ai/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mrdrennan](https://community.folivora.ai/u/mrdrennan)\
**Post date:** [May 17, 2025, 5:01pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/8 "2025-05-17T17:01:37Z")

</div>

Update: I can see that the MIDI channels are offset by 1, i.e., MIDI channel 1 = 0 in BTT. I do wish they were 1:1, but that can be worked around. I also experimented a little bit and see that the MIDI messages are being passed if I execute them from an AppleScript. However, nothing seems to be passed when trying to execute them from a named trigger.

---

<div class="post-metadata">

**Author:** ![Max\_Megalon](https://community.folivora.ai/user_avatar/community.folivora.ai/max_megalon/32/23811_2.png) [@Max\_Megalon](https://community.folivora.ai/u/Max_Megalon)\
**Post date:** [May 17, 2025, 6:15pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/9 "2025-05-17T18:15:28Z")

</div>

> [@mrdrennan](#):
>
> However, nothing seems to be passed when trying to execute them from a named trigger.

Hallo,

overhere the _Midi send_ works fine from a "Named Trigger".  
for my Midi drumpad I am setting the midi\_note, midi\_velocity, octave ect **first** in BTT variables...as part of the button definition. And when a button is pressed the Java script is called via a "Named trigger".

 ![Send Midi Notes](https://community.folivora.ai/uploads/default/original/3X/8/3/83e0e415d7f7989eb9d9abbeba770d437329e735.jpeg)

here the script:

```auto
async function sendMidiCommand159() {
    
    // Get necessary variables
    let velocity = await get_string_variable('midi_velocity');
    let octave = await get_number_variable('octave'); // This is already a number
    let midinote_str = await get_string_variable('midi_note');

    // Convert midinote string to number (base 10)
    // Add basic error handling for parseInt in case midinote_str is not a valid number
    let midinote_num = parseInt(midinote_str, 10);
    if (isNaN(midinote_num)) {
        midinote_num = 60; // Default to middle C if parsing fails
    }

    // Calculate the target MIDI note number by adding the octave offset
    let calculated_note = midinote_num + octave;

    // --- Clamp the value to the valid MIDI range [0, 127] ---
    let clamped_note = Math.max(0, Math.min(calculated_note, 127));
    // Explanation:
    // Math.min(calculated_note, 127) ensures the value is no more than 127.
    // Math.max(0, ...) applied to the result ensures the value is no less than 0.

    // Convert the clamped number back to string for the JSON payload
    let new_midinote_str = clamped_note.toString();

	const midiJSON = {
        BTTPredefinedActionType: 462,
        BTTPredefinedActionName: "Send MIDI Command",
        BTTAdditionalActionData: {
            BTTMidiCommandNote: new_midinote_str, 
            BTTMidiCommandType: 159,
            BTTMidiCommandChannel: 0,
            BTTMidiCommandEndpoint: ";;;;Bus 1",
            BTTMidiCommandVelocity: velocity
        }
	};
	
	let res = await trigger_action({ json: JSON.stringify(midiJSON) });
    return(JSON.stringify(midiJSON));

}

```

 ![Midi drumpad](https://community.folivora.ai/uploads/default/original/3X/4/a/4ae8099239706189295bb50c110b42f74660660a.jpeg)

---

<div class="post-metadata">

**Author:** ![mrdrennan](https://community.folivora.ai/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mrdrennan](https://community.folivora.ai/u/mrdrennan)\
**Post date:** [May 17, 2025, 7:03pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/10 "2025-05-17T19:03:48Z")

</div>

I’m such a dummy. I didn’t realize when I was duplicating midi triggers that the original one was set to disabled. Hence, all were disabled. The script would work but not the trigger until activation. Seems to be working now, although I have to go back and decrement every midi message channel number by 1 to match BTTs handling of Midi channels. Don’t suppose there’s a way to do this as a batch?

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [May 17, 2025, 8:20pm UTC](https://community.folivora.ai/t/send-midi-command-control-change-channel-bug/38357/11 "2025-05-17T20:20:10Z")

</div>

You can copy them all and do a search & replace in a text editor, then paste them back in BTT. the channel is saved like this:

```auto
          "BTTMidiCommandChannel" : 5,

```
