Binding Group with CC and Note Bindings firing out of order

I’ve got a binding group with a binding that sends a CC followed by a binding that sends a Note. The Note message is appearing before the CC.

Here are the bindings:

And here is a monitor of the output stream:

BindingCCNoteOutOfOrder_2_Screenshot 2023-12-17 060123

Regarding the order of bindings, Bindings - Cantabile - Software for Performing Musicians says “Bindings in racks loaded into the active song, in the order the racks are in the song”. I had thought that would mean that two bindings would fire sequentially in order, but that does not seem to be the case.

Has binding ordering changed since v4100?

Do I use delays to get the order that I want?

EDIT: The bindings in other binding groups that I have do fire in order, but they output Notes only.

… and … I tried adding a delay to the second (Note) binding, and it does not work reliably at 10 or even 20 msec … I’ve gone to 30 msec and that does appear to work AOK, but I can’t be sure without trying an infinity of cases …

Maybe this has to do with the longer byte length of the CC message that is supposed to be sent first?

Hi Clint,

Set the 2 bindings with the “Other bindings invoked by the same event” scheduling area of the timing area of both bindings. Even with no delays it sorts related bindings into the order you placed them. The question about binding order differences from 40xx builds would need some help from @brad because I don’t know the answer. Here it worked rock solid with the ‘same event’ switch in the timing.

image

Dave

1 Like

Hi Clint,

Normally these bindings should fire in order, however it looks like the first binding is using a binding expression where-as the second isn’t. So…

[start technical detail]

Normally MIDI to MIDI bindings run on the audio thread for performance reasons. Binding Expressions however are implemented in C# and can’t run on the audio thread.

I suspect what’s happening here is the first binding is getting triggered first, but because it runs on the UI thread in parallel to the audio thread, the second binding although invoked second actually runs more quickly.

[end technical detail]

What happens if you reconfigure the first binding like so:

I should add, I’d like to get binding expressions running on the audio thread where possible, but I need to either:

  1. figure out if the expression is purely math based, no arrays etc… since my unmanaged expression engine doesn’t support those.
  2. update the unmanaged expression to support non-numeric types, but that has other implications.

Brad

1 Like

Changing the Mapping of the first binding from using an Expression mapper to using a Command to Value mapper causes the two bindings to fire and produce MIDI in the expected / intended order (the order they appear in the binding group). Returning to the Mapping of the first binding to using the Expression mapper again causes them to produce MIDI in reverse order.

Looks like your “I suspect what’s happening here” is correct!

Hi @ClintGoss

Thanks for confirming… I’ll have to figure out a way to work around this because it’s not obvious.

Brad