You will need to use Apple event IPC to control Music.app. Options:
• ScriptingBridge.framework – defective by design and effectively unsupported and abandoned; usually mostly works for trivial stuff, but breaks on a lot of tasks that work perfectly in AppleScript and generally not worth wasting time on
• AppleScript-ObjC bridge – allows you to wrap your AppleScript handlers as NSObject subclasses and call them directly from your Swift/ObjC code. Bridging numerical types is a little fiddly (you have to use NSNumber, not Bool/Int/Double primitives) and block-based APIs are unsupported, but this is by far the least awful option and the one I recommend. Example project here: github.com/hhas/Swift-AppleScriptObjC
(There is also SwiftAutomation, which unlike Apple’s ScriptingBridge actually works right, but I haven’t used or maintained it in ages and don’t provide any support so for the recklessly brave only.)