Ctlin not passing through CC message to ctlout (M4L)

tim dewilde's icon

Hey Guys,

Im trying to make a M4L patch that communicates with a custom midi controller through CC messages. Mainly just LED's that respond to button presses, nothing fancy really...

However, when i press the button on the controller, the m4l patch receives the message and will turn on a toggle box, but no LED lights up... But when i just toggle the toggle box the led DOES light up..

[ctlin 1 13]

|

[== 127]

|

[X]

|

[* 127]

|

[ctlout 1 13]

CTLOUT BUG.amxd
amxd

So the setup is correct, but isn't working as expected.

Can somebody explain to me why this happens, or what I should do to make this work?

Thanks in advance!

Source Audio's icon

probably midi loopback of some kind.

can't say more without more details.

you also have midi through beside ctlin

tim dewilde's icon

Thanks for the response!

I thought of a Midi loopback as well but i cant manage a way to check that. checked the midi through part by removing it but no luck.

What kind of details are needed to help me more? I can send you more

schlam's icon

Hello.

I cannot look your patch right now but maybe a (set $1) is missing ?

[ctlin 1 13]

|

[== 127]

|

(set $1)

|

[X]

|

[* 127]

|

[ctlout 1 13]

tim dewilde's icon

Thanks for your response as well!

I've tried the 'set $1' message, but still no luck unfortunately

Sébastien Gay's icon

Have you tried to add a [print] right after [ctlin 1 13], so as to check in the MAX Console that the message sent by the controller is 127 when expected ?

tyler mazaika's icon

[ctlin] and [ctlout] in a Max for Live device don't honor the "Channel". If you have MIDI going into/out of a M4L device it's always going to be on channel 1. (Unless your device is MPE).

So [ctlin 1 13] doesn't make sense, nor does [ctlout 1 13], to me.

I'd put the "MIDI Monitor.amxd" before and after your device to double-check this behavior, though.

Source Audio's icon

needed infos are -

why do you need to resend same CC# value to the source device ?

is that toggle only visual representation of current state ?

in which case you should use set $1 message to display what came in,

but not feed back.

midi in max is different than midi in live.

here is simulation using IAC buss instead of external device

tim dewilde's icon

Thanks for all the responses guys!

Connecting [print] to [ctlin] results in the expected output: 0 or 127.

why do i need to resend same CC# value to the source device?

I want to be able to control ableton from my controller, and i want visual feedback in the form of led's. In my controller setup i can change the CC# and channel for each led, but even when they're completely different, the same thing happens: the LED is not directly responding to the button.

is that toggle only visual representation of current state ?

For now it is. I have tried different setups to pass through the messages: directly from [ctlin] to [ctlout] / [ctlin] to [sel 0 127] to message boxes with the corresponding value (0) and (127) / using [midiformat] / and a bunch of other options but that didn't seem to matter. So i'm missing something, clearly.

So using only CC# and removing channel# on ctlin and ctlout indeed works the same way, does that mean that it only channel 1? Does it work the same way with assigning a device name?

And i don't think i fully understand what you mean with send from your device and send to your device.

Source Audio's icon

On that screenshot I used IAC Buss to simulate sending of CC#

from external source to max, receiving it in max, showing state in toggle,

and sending back to extrnal device by manual toggle trigger.

Can't say more ....

you talk about controller, without naming it,

or if it is control surface, etc etc

All infos that could explain what your problem is.

Again : Live sends midi ONLY to device and channel set at track output.

To avoid midi loopback, use different CC# numbers for LEDs,

than for what buttons send.

You must set one midi channel for LEDs - also selected at track output.

tyler mazaika's icon

MIDI devices in Live receive MIDI from their Track / Channel only. They don't have direct access to "IAC Driver Bus 1" like they do in the Max environment. See MIDI Limitations here. https://docs.cycling74.com/max8/vignettes/live_limitations

Again... use the "MIDI Monitor" device to see what's going on with what MIDI is going in / out of your device, and add a screenshot of your Track's I/O settings while we're at it.

I want to be able to control ableton from my controller, and i want visual feedback in the form of led's.

LEDs in your Max for Live device, or LEDs on the controller?

So using only CC# and removing channel# on ctlin and ctlout indeed works the same way, does that mean that it only channel 1?

Yes.

Does it work the same way with assigning a device name?

I don't understand this question. Does "device name" mean the name of the Max for Live device? Or the name of a MIDI Input port (e.g. "IAC Bus Driver 1").

tim dewilde's icon

I build a MIDI controller with OpenDeck https://shanteacontrols.com/ a hardware platform for DIY MIDI devices. Using it without works great, but the control options for Ableton are very limited.

To avoid midi loopback, use different CC# numbers for LEDs

I've changed this now on the OpenDeck board: button is assigned to CC1 Ch1 and LED is assigned to CC2 ch2. My patch looks like this:

and my ableton track i/o looks like this:

'preview mode' is ON and I own a full max license, not just m4l, so when i use [midiinfo] i get a list of all midi driver connected to my computer.

Does "device name" mean the name of the Max for Live device? Or the name of a MIDI Input port (e.g. "IAC Bus Driver 1").

I meant the MIDI Input port, which in my case is "OpenDeck"

I've also added midi monitor before and after the Max MIDI Effect. When i press the button i get this:

So the buttonpress doesn't seem to reach the second monitor. However, when i activate the togglebox in my patch, the led on my OpenDeck board DOES turn on.

Thanks for helping me out!

Source Audio's icon

now that you have different CC for led, remove set $1 message and connect toggle directly.

giving ctlout midi channel argument is useless in Live device.

Also - if you use different midi channel for LEDs,

no need to use different CC# numbers.

tim dewilde's icon

THAT WORKED!!

So all along it had to do with channel routing in Ableton and not the patch itself

I'm very happy now! Much appreciated! Thanks so much for all the help!

Source Audio's icon

check this

all CC numbers with value 127 will get echoed to ouput,

if value != 127 then 0

So you can use same CC numbers, but output to different channel from Live track.

if it were used in max, replace 176 wih 177 - midi channel 2

tim dewilde's icon

Thanks for all this!

So midi channel in track i/o is most important.

Also for it to work propperly I figured that i should set my 'MIDI Input port' in the patch to "OpenDeck.amxd" (name of the max device in ableton), and not simply "OpenDeck', which is the name of my MIDI controller.

What is the best use for your patch here, as in, in what way should i use this?

No need for max here, I'm gonna use m4l for this project anyway.

Thanks again!