How to send midi data directly to max from node.script?
Hello, I have a heavy typescript project, which is running on localhost and should be able to send midi data to Max directly via callbacks in main.js, which is read by node.script. As far as I know, node.script is capable of sending dictionaries in outlet, but I would actually prefer to send messages with pitch gate and velocity to synths directly, tied to global transport. Conceptually, how would I able to do that?
If you want to send messages from outlet, you can do this:
const Max = require('max-api');
Max.outlet('my message');
It's taken from the js file from the [node.script] helper patch. Just replace 'my message' by pairs of numbers for note number and velocity (or have multiple of them in the same message).