I work in Unity3D Standard Edition. For those who don't know this, this is a 3D game engine that supports C # /. NET scripts (so it has access to the .NET 2.0 API).
I created my own synthesizer. (He is currently responding to Note-ON events that are generated by a MIDI sequencer chewing on a MIDI file.)
Now I want to catch Note-ON events from a MIDI keyboard.
I'm going to deploy my application on iOS, at least hope other operating systems follow. Thus, the target scenarios are:
- someone runs my application on iPhone, they have a MIDI keyboard that connects to their windows machine.
- someone runs my application on an Android tablet, they have a MIDI keyboard plugged into their Linux machine.
- someone runs my application on OS X, they have a MIDI keyboard connected to OS X
The latter is the situation I am in, so if someone has a solution for one that is not distributed, I am still very interested in this - this will at least allow me to get a functional prototype together.
There is one asset, MIDI Unified , that will connect to a MIDI device. However, this requires a PRO version. This is due to the fact that the PRO version allows you to create your own plugins.
I believe it should be possible to get MIDI in Unity without using its own plugins, but instead over a network connection.
(Note that I'm not talking about Internet connectivity, Ethernet, TCP / IP, UDP, HTTP, as I'm not quite sure what to use the correct term.)
A utility appears for sending MIDI signals over networks: ipMIDI will do this for Windows and OS X. There may be something for this on Linux.
OSX has a โ Audio MIDI setup, โ which I mentioned in order to transfer MIDI signals from the device to the local host. (Perhaps that is why ipMIDI for OS X is free?)
EDIT: I just found that Audio MIDI tuning implements RTP MIDI , which seems to be the best standard for simulating MIDI over a network (it handles lossy networks).
So, I'm sure the challenge will be: how to implement RTP MIDI in C # /. NET?
But perhaps there is a slightly lighter (but less powerful) solution, for example, some solution that only works and receives Note-ON MIDI messages from localhost to OSX.
I would be very happy if I could get a basic solution for the first generation of my application, and then replace it with a reliable component when I have the tools.
So, as far as I got, can anyone take it all away to steer it forward?
ฯ
EDIT: http://u3d.as/content/sta-blockhead/websocket-sharp-for-unity/4X4 Did this help?