Realtime midi output device selection iOS

Hey all,

I’m working on an iOS app and am looking to setup a basic MIDI out configuration/interface selector. I see that in the documentation the only way to configure this is via command line flag -Q. Is there any other way to change the device number? I imagine if not the best course would be to simply restart the csound instance and pass in the new device ID when restarting it correct?

For some context, I’m designing a sequencer app to control external hardware, however being able to output to other iOS apps via something like AudioBus would be cool too. I’m new to this and not familiar how one would go about piping MIDI data if you want to be able to send it both within the device and externally.

Also, a final question, has anybody managed to route MIDI to an external hardware device through the simulator? I’m not sure how feasible this is or if I’m better off just testing with a real device

Thanks in advance!

Cheers