Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I send and receive network MIDI data in iOS?

How do I send and receive network MIDI data in iOS? I am able to resolve the server using bonjour and apply the service to a MIDI connection, but I don't know where to go from there. The documentation seems to be lacking, and there's not much information online.

like image 655
ultra Avatar asked Oct 26 '25 06:10

ultra


1 Answers

Essentially, you need to connect to the session via Bonjour as you have done, and within your iOS app:

  • Create a client using MIDIClientCreate
  • Create an input port using MIDIInputPortCreate
    • This takes a pointer to a C function that will be called when MIDI data is received
    • You need to connect it to the MIDINetworkSession's defaultSession using MIDIPortConnectSource - connect it to the sourceEndpoint
  • Create an output port using MIDIOutputPortCreate
    • You can send data to the network session using MIDISend - send the packets to to the MIDINetworkSession defaultSession's destinationEndpoint

I wrote a few blog posts about this a while back, see here for source code etc.

Part 1

Part 2

Part 3

like image 78
Simon Lawrence Avatar answered Oct 27 '25 21:10

Simon Lawrence



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!