dnadoba / MIDIKit

MIDI message decoder/encoder and typesafe wrapper around CoreMIDI in Swift
Apache License 2.0
14 stars 4 forks source link

JavaScriptCore support #4

Open MicheleLonghi opened 3 years ago

MicheleLonghi commented 3 years ago

Allowing access to MIDIKit APIs from JS.

dnadoba commented 3 years ago

Many types, especially MIDIMessage and types MIDIMessage uses, are enums with associated values. I don't know a good way to expose those types to JS.

I think it's a nice idea for scripting purposes. Do you think this can be done in separate Swift Package?

MicheleLonghi commented 3 years ago

You're right. The library is nicely done as a pure Swift implementation. The biggest issue is MIDIMessage indeed. It would be necessary to create specific JS types, like MIIDNoteOnMessage, only for the purpose. TBH last time I used JSC was with ObjC, so I have to get back to it and better understand what can be done with Swift. Cheers