I have just updated my ALSA (asound) interfaces at
https://github.com/MarkMLl/asound to include a fairly complete transcript of the sequencer (i.e. MIDI) API. This does not try to call libc, which historically was the cause of versioning problems.
(My recollection is that) it was based initially on the output of h2pas merged with documentation text such that Lazarus should display sensible hints etc., then run through a (so-far unpublished) program which outputs interface files for load-time and on-demand library linkage.
There's a working filter demo in the examples directory, although I must say that I find some of the naming conventions uncomfortable: things that are named like pointers but turn out not to be and vice-versa.
Up to a point, the filter supports a dynamically-loaded plugin as the backend. It works, but I'm not entirely happy with naming conventions etc. and there's details like automatic reload if the backend is recompiled which I've not merged from earlier work. I might revisit this, but it won't be immediate.
Provided in the hope that it's of some use to the community.
MarkMLl