Skip to content

dm1khm/MidiHarmonixBridge

Repository files navigation

MidiHarmonixBridge

MidiHarmonixBridge is an Unreal Engine plugin that moves live MIDI note data from gameplay code into Harmonix MetaSound graphs. It provides simple Blueprint helpers for sending note events and a MetaSound node that plays them back in time on the audio thread.

Key Features

  • Thread-safe queue that carries note-on, note-off, and all-notes-off messages.
  • Blueprint function library for triggering MIDI events from gameplay systems or hardware callbacks.
  • MetaSound node that starts and stops listening on demand and outputs a ready-to-use FMidiStream.
  • Support for multiple logical streams so different instruments can listen to their own MIDI data.

Requirements

  • Unreal Engine 5 (tested on 5.5).

Installation

  1. Copy the Plugins/MidiHarmonixBridge directory into your Unreal project or clone this repository directly into YourProject/Plugins.
  2. Regenerate project files if you are using C++.
  3. Build or launch the editor so the MidiHarmonixBridge module compiles.
  4. Enable MidiHarmonixBridge inside Edit → Plugins if it is not enabled automatically.

Sending MIDI Events (Blueprint or C++)

Use the Blueprint nodes from Midi Harmonix Bridge category or call the subsystem directly in C++.

  • Midi Bridge Note On
  • Midi Bridge Note Off
  • Midi Bridge All Notes Off

Each function accepts:

  • MidiNote (0-127)
  • Velocity (0-127)
  • MidiChannel (0-15, optional)
  • VoiceId (optional; leave at 0 to auto-generate)
  • StreamId (non-negative, defaults to 0)

C++ Example

#include "MidiHarmonixBridgeSubsystem.h"

if (UMidiHarmonixBridgeSubsystem* Bridge = UMidiHarmonixBridgeSubsystem::Get())
{
	Bridge->BridgeNoteOn(60 /* Middle C */, 100, 0, 0, 0);
}

Listening in MetaSound

  1. Open your MetaSound graph and add the MIDI Bridge node.
  2. Connect the Start Listen trigger (for example, On Begin Play) and the Stop Listen trigger (for example, On End Play).
  3. Choose the same Stream Id value that the gameplay side uses.
  4. Connect the MIDI Stream output to Harmonix operators such as FusionSampler.

The node keeps its own listener handle and drains the queue every audio block, so multiple MetaSound graphs can listen to different streams safely.

Multiple Streams

Set a unique Stream Id per instrument or MetaSound graph. Gameplay code pushes MIDI events into the matching stream, and only MetaSound nodes that listen to that stream will receive them.

Contributing

Improvements are welcome. Please open an issue or pull request with a clear description and steps to reproduce or test your change.

About

Unreal Engine 5 Harmonix MidiStream bridge node

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published