Send MIDI CC on track select?

Michael DeFiore's icon

Hi.

Desired action: Ableton sends a midi cc message out when a track is selected.

Purpose: I'm using a BOME Midi Translator app and the app uses a midi cc message to identify (and thereby react to) which track is selected in ableton. So I need to find a way to transmit a midi cc message out when a specific track is selected.

Possible to do with a M4L device?

Level of complexity to do?

Before I undertake learning Max from scratch thought I'd consult the experts.

Thanks!
Mike

Iain Duncan's icon

This is definitely possible and not particularly hard. You will need to use the live API to set up a observer, and then send midi out. It would be a pretty good first project actually. :-)

iain

Michael DeFiore's icon

Thanks Iain. I have the patcher all set and working....but I need to send the midi CC's out on a midi port I have set to "remote". Is that possible? I can't find anything in the Live Object Model that will give me access to the different midi ports of Live. I can see how to send the midi messages out on different Max ports, but not on Ableton midi ports.

Any ideas?

Iain Duncan's icon

You should be able to set that port as both remote and track, and then you can can send out from your M4L device. One doesn't get direct access to other ports in M4L than the one the track is on, but there are various workarounds (you might need to make extra tracks who's only job is to handle devices for example) If you can't get what you need setting it as track, look for the examples of Midi routing. It's a bit of a hassle but you can get it do what you want!

Michael DeFiore's icon

Thanks Iain; I've done it with midi routing using other tracks but I have a lot of tracks and doubling them up really bloats the project and seems to make ableton seems more unstable (noticed additional crashing).

Based on my testing, it seems like ableton only transmits on the midi remote port when a user changes the value of a midi mapped controller manually. My testing went as follows:

I put a live.numbox object in the device that allows a user to change the midi cc value being sent manually. If I map the live.numbox to a midi cc in ableton, and then manually change that value in the live.numbox, then ableton does indeed send the value over the midi remote port. The problem is when I trigger the box with a bang, to send it automatically when the track is selected, the value is not sent over the report port.

I suspect ableton is watching the live.numbox for changes in values. When it sees a change, it then sends the new value over the remote midi port.

Can Max enter a value in a live.numbox pragmatically? In this way the algorithim would look like: ON track select, populate the midi mapped live.numbox with value "x", then ableton sends the value entered by Max to the remote midi port.

Thoughts?

Thanks!

Michael DeFiore's icon

Got it figured out. Using 3 live.numboxes, 1) where the user can specify an initial midi cc; another 2) specifying a final midi cc, and another 3) midi mapped in ableton. Connect the "inital" and "final" live.numboxes to the midi cc mapped live.numbox, then delay the bang to the "final" live.numbox with the Max delay object. This effectively changes the live.numbox programmatically upon a bang and allows the value in the "final" live.numbox to be sent over the ableton remote midi port of choice.

Iain Duncan's icon

That sounds about right, glad you got it figured.

One thing to be aware of is that you might not need need a delay if you are only trying to control order of operations. You can just use trigger to make sure things happen in the right sequence.

Michael DeFiore's icon

Understood! Thanks Iain.