You might be interested in AudioKit, audio synthesis, processing, & analysis platform for iOS, macOS and tvOS.
https://github.com/audiokit/AudioKit
Full disclosure: I'm a core member of the project.
Oh and also check out WebMIDIKit, https://github.com/adamnemecek/WebMIDIKit, it tries to wrap the terrible CoreMIDI APIs.