Routing MIDI input with live.routing does not work in a MIDI device

Sonoran Music Devices's icon

Sonoran Music Devices

1月 17 2024 | 7:40 午後

The example "route midi input" in the maxhelp file for live.routing is ostensibly a MIDI device, so presumably it is intended to work. After loading that example into a MIDI device, the ports do not load, and I get this error:

live.routing: Live API is not initialized, use live.thisdevice to determine when initialization is complete

If I copy the example (minus the midiin and midiout objects) to an audio device, it works.

I tried messing with live.thisdevice, etc. but it does not work.

Any ideas? Is this a bug? Or, despite the example, is it not supposed to work in a MIDI device?

tyler mazaika's icon

tyler mazaika

1月 17 2024 | 9:02 午後

I think it's telling you exactly what's wrong, and how to fix it.

use live.thisdevice to determine when initialization is complete

So rather than using any "loadmess" or "loadbang" to send messages to live.api anything, always trigger them with live.thisdevice.

It's weird that their help file uses loadmess. You should file a support ticket for this and any other LiveAPI related documentation that makes this mistake. It's not "wrong" in Max context, but its an obvious and unnecessary trap/pitfall for copy-paste adoption like you tried to do.

Sonoran Music Devices's icon

Sonoran Music Devices

1月 17 2024 | 9:49 午後

Thanks Tyler, but I am very familiar with using live.thisdevice to initialize stuff, and I already tried messing with it.

After some more searching, it seems like the issue is probably that MIDI routing is not supposed to work in a MIDI device.

Here is where I found out.

MIDI in/outputs in MIDI devices are known not to be routable in the current API because only one midi in/output can be routed at the moment and in MIDI effects these are already hard-wired to the Live in- and output.

tomme's icon

tomme

9月 12 2024 | 3:36 午後

Hi, did you find a solution to this?