Generate/inject/rewrite MIDI messages without MIDI-out loopback?

Hi clever folks,

Is there a way to generate MIDI messages from a Lua script so they reach other parts of Renoise? I can send them via MIDI-out and loopback into MIDI-in, but that requires either a software loopback or an actual cable loopback on the controller.

Is there a purely Renoise way of doing something like it?

Yep, by using the internal OSC server you can send internally-routedMIDI messages.

My own tool, Duplex, is using this to e.g. transform incoming pitch-bend messages into CC messages.

But when you say “generate MIDI messages”, you have to be aware that timing is an important issue -

When you don’t need crystalline precision, it’s fine to be using a lua loop - it’s run a dozen times or so per second (depends on CPU load).

But if you require more precision, you have to respond only - so, your script would be waiting for some external input (MIDI event) to trigger it.