M4L and midi output issue
Hi all, I dug around the forums looking for a solution to this problem and nothing I tried seemed to work, so I figured I'd start a thread. Apologies for anything that's unclear or messy, I just started learning Max a couple days ago.
Essentially I built a sequencer that uses a multislider for note selection. It works great with the cycle~ device I have running, so the problem doesn't lie there. The issue arises when I try to output the current note value to midiout/noteout in order to capture the notes in Ableton's midi editor. I'm not sure if this is because I'm running plugout~ simultaneously.
I've tried outputting to midiout, noteout, and ctrlout trying to find something that would work, passing values either through the port symbol or integers, but nothing outputs properly to Ableton in either the Max1 or Max2 inputs. I've also tried passing the note number value to midiformat which didn't help. Ableton's Midi Track In indicator doesn't blink at all, leading me to believe there could be something wrong with the midi setup/ports.
One thing is that I can't double click the devices to set the ports like the reference book tells me I should be able to. Instead of pulling up the menu, it just edits the object name. I suspect this is a M4L thing?
Not sure if anyone has run into this issue before, but I would appreciate any help. I can provide more screenshots/patch info if needed.



m4l device has no control of midi ports.
if you device is midi type and is inserted in midi track,
then you should be able to output notes .
but maybe you don't know how to format midi messages ?
this here is definitelly not going to work:

midiout expects 3 bytes long raw midi message:
1 status byte
2 pitch
3 velocity
144 48 122 = midi note on channel 1, pitch 48 velocity 122
but then you also need to turn note off, after wished length....
I would suggest you check raw midi message format,
and also read help of midi objects in max,
like noteout, makenote, midiformat etc
Thanks for the reply, unfortunately after trying several variations of what you mentioned, I can't seem to get it working. I've gone over the help files as well.
I tried starting a new device from scratch and played with outputting a basic midi message to a midiout device, but that doesn't trigger anything in Live either, leading me to believe it's either my port settings or my install of Max. I've tried formatting the midi messages in different ways, etc..
Basic premise of what I was trying (new device set to abbreviation 'b' in the midi setup menu)

again, midi ports can not be set in live device.
put you device into midi track,
bang that message 144 50 122 to midi out,
and your track should output that note.
simple as that.
where that note goes, depends on what you set at track midi output
selector.
While editing, you must turn preview on
Point taken about the ports, I've removed those from my patches
The device is on a midi track (pictured to the right) and banging the message does not output anything to Live. I'm keeping an eye out for the midi light indicators.
you show audio track, from Max 1 means from max standalone app.
What are you trying to do exactly ?
I've also tried the other inputs (the standard All In, etc)
The patch generates random notes and sends them to plugout~ in order to create a signal. The device can also interpret incoming midi data entered in Ableton, so you can use the built-in sequencer or just create Ableton midi clips as per usual. I created this as a Max Instrument in Live.
I wanted the option to take the notes that the sequencer generates and output them as midi data, which is what this is trying to accomplish
Then put that device into MIDI TRACK.
Or feed your whatever it is instrument
with generated notes directly, and use midiout of the track
as midi input in other midi tracks.
@SAM M ... I've been running into a similar challenge. I am developing a generative composition device and I'm looking to be able to simplify the process of capturing/recording the MIDI generated by the device onto the same track on which the device is located. However, I've come to the conclusion that this is actually not feasible, because the MIDI that gets recorded to the track is whatever the track is recognizing as its MIDI In source. And so if your M4L device's MIDI output is somehow routed to the track's MIDI In, you get a feedback loop that clearly this is workflow is designed to prevent.
What I have to do as a workaround is to create a separate MIDI track in Live, let's call it "MIDI Track 2" and set the output of the track (via the track I/O) with my device to "MIDI Track 2", then arm "MIDI Track 2" for recording.
Have you been able to figure out a different solution?
Late reaction here but there are some heavy misconceptions mentioned above....
First... always check the reference page of whatever object you're working with and when you do so: always check the "See also" section as well. See... MIDI parsing is seriously really easy.
Alas... [midiin] gets you RAW MIDI data. If you want to do more with this.. just parse it. Use the [midiparse] object for that. This node takes raw MIDI and neatly cuts it up into more usable chunks such as pitch/velocity (list), poly key/value (also list)... but also program changes, aftertouch values and pitch bend.
As mentioned: reference pages. Because those should point you to the counterpart of all this: [midiformat]. Just feed it with all required data and then you can use the formatted output to be sent out of [midiout].
Here is some proof of concept:
Another late reaction, but oh well...
@Sam
I wanted the option to take the notes that the sequencer generates and output them as midi data, which is what this is trying to accomplish
A M4l device (or better put: the API) only supports up to 1 output type at a given time. I base this conclusion on the info of the somewhat recently added live.routing object, see its reference page. This makes me conclude that if you're making a M4l instrument then your only output type is audio, not MIDI.
And even though M4l can do some signal routing as well as sent data to tracks and ports directly, that's still only 1 type: audio.
I am not Live user ...
but live 11 can output both audio and midi from single track to other tracks.
Here Max sends notes via IAC buss to track in live, which outputs it together
with self created midi and audio to another live track ...


@Source
but live 11 can output both audio and midi from single track to other tracks.
Sure it can, but the API aka M4l can't. If I use the Reason rack plugin I can grab both audio & MIDI from it too.
Notice how your getboth track (first screenshot) doesn't produce any output?
Also: MIDI routing in Live is a thing of its own. If I have a MIDI track with all-ins, add a M4l MIDI effect and cut the connection between in and out then MIDI will still pour into the track itself.
The simplest way around this, IF you can live with the latency, is to use send and receive pairs between devices. It will add the latency of one signal vector (64 samples). Depending on your use case, this may be just fine.