Generate notes (pitch and velocity data) in Max (Max/MSP) and send them to Ableton using noteout.
Similar video on sending controller data using ctlout: https://youtu.be/NDaCewWzEf8
More advanced Max to Ableton mapping: https://www.youtube.com/watch?v=xmobq55Sg8w
If you are using Windows, you might need to install loopMIDI - https://www.tobias-erichsen.de/software/loopmidi.html