Patch problem: Inconsistent events when changing out ports

Hi All!
The first 2 lines of pipes invert incoming midi notes with an assigned cc69 toggle switch and sends them out vA.
The second two lines of pipes , when pressing an assigned cc66 toggle switch, direct midi notes to out B, and turns off out vA.

The problem is when cc 66 is depressed, the midi notes to Out B are no longer inverted when engaging cc 69. The result, in this context, tis that midi notes go out to both outputs. This is not intended.
The goal is to be able to invert the notes with CC 69 whether or not cc 66 is engaged.

works fine out vA, but, when I switch to my 2nd sound : out B

Instead of inverting the notes, it merely enables both vA and B single notes.
I can’t picture everything here, so I’ll attach the file. What am I doing wrong?
Thank you very much!
Invrt12.10.11LoopUpdte(Preset 1).mhp (1.4 KB)

“Notes”, Peter?

You might need to explain to readers what is supposed to happen (I think you had toggle buttons)
and maybe update your Description to list the Port, Channel, CC info for each mapping.


I have explained the situation as closely as I can, which granted, is in Laymans terms. Hopefully with the attached file it can be seen what is happening. does it look passable?

Also, is there a way to change my primary email address? I could only find a way to add my real address as secondary. The real address is the one I am using to respond to you right now.

(((The URL went out of business and I can’t send from the pje address.)

When you say vA, are you referring to USB out A or Virtual port A?

This patch would never invert the notes going out to B because there is no way for inverted notes to go out through Output port B.

What is the purpose of the final 2 lines? When you toggle on the pipes in line 2, line 3 is still sending out non-inverted notes to the same port creating chords to USB A. Is that the intention?

To the right of your email in Prefs you should see a spanner icon
Screen Shot 2023-12-11 at 04.20.52

Also, instead of using email you can go to the forum website and contribute directly there once logged in.
This method also gives easier access to formatting options.

answering Joey‘s response, paragraph by paragraph;

vA , I understood to mean “virtual A”. is that not how it is used?

The last line sends the incoming midi notes to output, B

no, it is not the intention to continue sending out A with cc 66. The intention is to send inverted notes out B

Alright I see then. It may be more simple to skip the last 2 lines and then map to the output port after the rescale pipe. You can switch the port’s destination on the fly. One more question. Do you want the possibility of A and B sending notes at the same time or only A or only B sending notes individually?

I will attempt your suggestion.

No, I would want to send to either vA or B.

So quite simply, 69 switches active A,or B. CC 66 turns on or off note inversion. Are you using a button or a knob for this? Or is this your pedal? And if it is your pedal do you want B active only when you are pressing the pedal? Or the rescale only active when pressing the pedal?

I am using all buttons. It is an on/off [ 1 or 127] button. It s on a pedal board that I can assign.
I have these 2 buttons set to momentary so rescale is active after I press the button, and, until I press the button again. The same goes for cc 66. It is a momentary switch to go from vA to B

By the way, 69 is for inverting pitch, and 66 is for going between vA&B.

For clarity in the future. The A port icon isn’t a virtual port, that’s a USB port.

The virtual port is the icon in the first line. Important distinction because messages from a virtual port never leaves out of MidiHub.

I’ll help you tighten this patch up now I understand your intent. This is more of a 2 line function.

Edit: One more question after getting info about your pedal. You say both buttons are momentary. So do you want A to be active at all times except for when B is active then only do the inversion while pedal is pressed? Or do you want A only to be active when the pedal is pressed.

Answering by paragraph;

That was silly of me, I know it was a USB port. Do we call it uA? as opposed to vA?

The patch defaults to midi out A,
one pedal press/release diverts Midi information to B,
another pedal press/release back to A…etc [momentary]

HEY-why does it indicate solution? There has Not been one…mistake perhaps…

1 Like

My apologies, @pje, these abbreviations come from me (A habit I picked up from shortening descriptions to fit in the 1024 character limit).

Only seen them used occasionally by others…

Hmm. Does your pedal have the option to be set as toggle rather than momentary? Or to notes instead of CC? The toggle example in a earlier post only works on notes because you can drop the note off which retains the value argument in a transform pipe.

I can’t seem to figure out how to make it work with a momentary CC because you are always going to get Value 127 when pressing then value 0 when letting go. It would be much easier if you could set your pedal to toggle.

Edit: Okay I have found a new way to toggle that works with a momentary CC button. Basically it’s mapping to the bypass of the rescale pipe instead of the value in the transform pipe. So momentary buttons will work fine.

how? exactly
would it be done?


It would usually be a setting in your controller. It depends on if your controller has those options. I got the patch mostly working, I’m trying to solve one little niggling issue. If you can set CC66 to toggle the current version I have will work though.

Both pedals are already set to “toggle”, or “latched”. Not momentary.

and…I can choose between either pedal type.

So your current version will work for me.

I accounted for the inversion CC69 to be a toggle within MidiHub. It’s just switching the ports with CC66 that’s a current roadblock. If the CC66 control was a toggle instead of momentary than it wouldn’t require extra pipes to turn it into a toggle.

switch test.mhp (1.4 KB)

Test results;

-cc 69 requires two presses to switch to and from inverted notes -with both out uA and B. !
It should be a single press.

-66 works correctly switching between the two outputs

My third pedal is a momentary sustain pedal sending out cc 64. It works correct for both outputs

ps- you did see that both pedals are toggle, right?

So the first pedal is already a toggle? Then it’s no need to make a toggle inside of MidiHub, you just need to map to the bypass(already done in patch). Remove the first 2 transforms(the bypassed ones) if this works.

switch test 3.mhp (1.3 KB)

Just a note. Having to make toggles inside MidiHub always complicates things. If you can set toggle in your controller, that’s always the best and the first step.