Sending MIDI from Reaper to Unreal Engine

How to setup Reaper to send MIDI to Unreal Engine. If you are looking to use OSC instead, take a look at daw-out.

Setting up Reaper

  • Install loopMIDI (This allows us to create a loopback MIDI device)

  • Add a new MIDI device in loopMIDI called unreal_port

    loopMIDI with unreal_port added

  • Enable new MIDI output in Reaper via Options -> Preferences -> Audio -> MIDI Devices

    Only enable the MIDI Output

    Reaper MIDI devices with unreal_port enabled

  • Setup MIDI output routing per track via:

    Routing Matrix (View -> Routing Matrix)
    Routing Matrix (View -> Routing Matrix)
    OR
    Track routing settings (IO button on track)
    Track routing settings (IO button on track)

Set each track to a separate MIDI channel, so each track number maps to its corresponding channel number.

Setting up Unreal Engine

Based on this forum thread

  • Enable MIDI Device Support Plugin

    Unreal Engine's MIDI Device Support plugin enabled

  • Import Midi Blueprints

  • Create Blueprint Interface with OnNoteAction and OffNoteAction functions called MidiListener

  • Set Game Instance Class via Edit -> Project Settings -> Maps & Modes -> Game Instance -> Game Instance Class

    Unreal Engine's Game Instance Class set to MidiManager

  • Set MidiDeviceId in MidiManager to map to the output of unreal_port (You can find this out from the debug logs in the console)

  • Place MidiDebug in the scene to print note debug information to the console

  • Place TestListener in the scene and set MidiChannel to whichever track # in Reaper

Test it out

If you have added MIDI to the track, set the MidiInput number and MidiChannel number on the TestListener. Hit play in Unreal Engine and then Play in Reaper, the TestListener cube should respond to MIDI input.