Skip to content

Enable real-time MIDI API (adl_rt_* methods)#2

Merged
csinkers merged 1 commit into
csinkers:masterfrom
abedegno:feat/realtime-api
May 9, 2026
Merged

Enable real-time MIDI API (adl_rt_* methods)#2
csinkers merged 1 commit into
csinkers:masterfrom
abedegno:feat/realtime-api

Conversation

@abedegno
Copy link
Copy Markdown
Contributor

@abedegno abedegno commented Apr 12, 2026

Summary

The RealTime* wrapper methods for the adl_rt_* real-time API were wrapped in #if false — the native entry points already existed in AdlMidiImports, but no public API surfaced them. This PR removes the preprocessor guard so consumers can drive the synth with MIDI events in real time (e.g. for live XMI playback or streaming audio synthesis).

Also fixed the RealTimeSystemExclusive signature to use a byte* pointer (matching the underlying adl_rt_systemExclusive import), wrapped in an unsafe context. The previous IntPtr pass-through didn't match the native declaration.

Motivation

Building a real-time music system for UnderworldGodot on top of AdlMidi.NET — feeding individual MIDI events from an XMI sequencer into the synth, then pulling rendered PCM into Godot's audio callback. This required the adl_rt_* API, which was implemented but inaccessible.

Test plan

  • dotnet build succeeds
  • Tests pass
  • Downstream consumer (UnderworldGodot) builds against this and plays back real-time OPL MIDI correctly on macOS/Linux/Windows

@csinkers
Copy link
Copy Markdown
Owner

csinkers commented May 9, 2026

Thanks for the contribution! There's some warnings about missing XML comments on the new methods, you can make another PR to add some, or I'll do it at some point, either way is fine.

@csinkers csinkers merged commit d506aa8 into csinkers:master May 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants