Maybe I’m just misunderstanding something basic. I always found it confusing with MIDI as to what is in and what is out (because the in on one end is the out on the other and vice versa). So… in GP devices that issue midi messages are MidiIn. Makes sense. Midi input comes from them and likewise, devices that receive are MidiOut as they receive output.

Ok, no probs, why am I writing this.

In GPScript you send messages to MidiInBlock. This makes no sense to me and seems to contradict the above convention.
Then when I want to send a midi message to a device, I have to send it to a MidiInBlock. If I attach that to a device that has a midi input (a MidiOut device) then GPScript (understandably) complains that “MIDI Out is not a MidiIn Block”. And if I send it so a MidiIn device then it doesn’t seem to work (unsurprisingly since the device has no midi input).
Am I doing or misunderstanding something very basic?

This should be simple enough. The device/software/anything that you are currently looking at is your reference point. If you are working in GP - anything coming INTO GP is an IN and anything going OUT of GP is an OUT

Scripting can add/send things to a MIDI Input block for further processing by plugins connected to that block.

If you are doing this for a hardware device that’s connected to your system - use the MIDI OUT block unless you want to do some plugin processing beforehand. Then use SendNowExternal… and other “External” variants to send stuff out through a MIDI Out block.

SendNowExternal(out, m)

You could send it to a MIDI In block, then connect the midi in block to a midi out block to go out, but in that case, you could be doing some internal GP processing so you are really not sending things out as far as your script is concerned.

Gotcha. Thx

Yes, that’s the key point — if you want to inject extra MIDI messages into a plugin (for example, a script that supports transpose), the only way you can do it is by injecting them into the MIDI In Block that’s connected to the plugin.