RP-NDI-MIDI_2019
proposal for MIDI protocol support in NDI:NDI-MIDI
This page contains a technical proposal which is not currently a published or formal standard. If you have comments or feedback on the content of this proposal PLEASE contact us with your contribution.
The NDI IP Video protocol SDK does not currently offer any guidance on provision for midi between devices. However, NDI has multiple real time metadata mechanisms which could easily carry midi data. This document is an attempt to standardise support for midi in order to prevent different implementations by each vendor by way of a recommended practice technical note.
Basic Premise:
The focus is based on the need of an NDI Sender or NDI Receiver to send or receive control information in a highly standardised and widely deployed protocol. This document simply standardises a mechanism for sending industry standard midi messages over an NDI Connection.
The objectives are to allow the following scenarios:
- Support for industry standard MIDI message streams from NDI Sender to NDI Receiver
- Support for industry standard MIDI message streams from NDI Receiver to NDI Sender
- MIDI can be sent alongside video and audio, or on a dedicated metadata only NDI connection.
The MIDI Standard is straightforward and very well understood with virtually no ambiguity about message purpose, syntax and implementation. Although it was originally designed for music instruments, It is widely used for all sorts of media operations, such as a midi control surface controlling an audio mixer with midi controller messages, midi machine control for precisely defined transport control, and midi show control.
These and all other midi messages can be seamlessly carried using this protocol over NDI connections.
In this proposal, the Midi data is sent using dedicated metadata messages already defined in the NDI Protocol
- the same ones used for PTZ control of cameras, and tally information.
It uses the real time (non frame based) NDI Metadata stream, with a string of hexadecimal MIDI bytes represented in their ascii form.
Example 1 :
NDIlib_metadata_frame_t meta_data
meta_data.p_data =
<MIDI>F07F7F0602F7</MIDI>
This represents a MIDI Machine Control PLAY command sent to all devices.
Example 2 :
meta_data.p_data =
<MIDI>F07F010601F7</MIDI>
This represents a MIDI Machine Control STOP command sent to MMC device 1
Example 3 :
meta_data.p_data =
<MIDI>B00740</MIDI>
This represents a MIDI Continuous controller message on Midi channel 1, with controller 7 (typically used for level/volume) with value 64 (in the range 0-127). This only has a 7 bit resolution, which may not be ideal for some applications.
In practice, for higher precision control commands, Midi devices will often use messages like the next example
Example 4 :
meta_data.p_data =
<MIDI>E00040</MIDI>
This represents a MIDI Pitch Bend message on Midi channel 1 (typically used for level/volume in professional devices) with value 0x2000 (in the range 0-0x4000), using 14-bit resolution.
An NDI Sending Device would send NDI-MIDI messages (to connected clients) on an NDI 'send' it has created using the NDIlib_send_send_metadata() message, and could receive NDI-MIDI messages back from connected clients using the NDIlib_send_capture() message
An NDI Receiving Device would receive NDI-MIDI messages from the device it has connected to using the NDIlib_recv_capture_v2() message, and would send NDI-MIDI messages back to the sender using the NDIlib_recv_send_metadata() message.
If you have any questions, or you would like to engage Sienna for NDI Consultancy or Custom Development, please contact info @ sienna.tv