Camd is a project mainly written in C, it's free.
MIDI library for AmigaOS3, AROS (official), MorphOS and AOS4
camd.readme