MIDI Library on UDP

Status
Not open for further replies.

pjeve

Member
Hi all,
I would like to know if there is a relatively simple way to make an UDP interface that can replace the current "Serial" transport layer in the MIDI_Libray in order to use the beauty of the library itself on the midi message's manipulation (callbacks, etc.) on a faster and more flexible configuration.

Here I'm not referring to the Apple-Midi standard.
I would like to use the midi-library in a setup that require "udp multicast" and involve the ipMIDI software ( http://www.nerds.de/en/ipmidi.html ).

I know that a previous problem that did not allowed use of udp multicast has been resolved on teensyduino 3.6 release.
(https://forum.pjrc.com/threads/42468-UDP-Multicast-issues?highlight=udp+multicast).

Please, can someone point me in the right directions?

Thank you!
 
I just looked at their website. I didn't see any sort of specification for those ipmidi protocol, like which UDP port number, whether the MIDI messages are packed a 2-3 bytes like serial or 4 bytes like USB or some other way, and how they're doing the 20 cables part.

But I did see their software is a free trial with 60 minute time limit, until you pay. What are the odds they're willing to open the protocol to allow other free implementations?
 
Hello Paul and thanks for the quick response.

I'm not an expert but from what I understand so far:

- the ipMidi OSX version is free

- from here (http://www.midi-and-more.de/midi2ether.htm) I see that the IP need to be set to 225.0.0.37 and the port to 21928

- there are some hardware manufacturers who implement the protocol
(Http://www.nerds.de/en/ipmidi_hardware.html)

- The QmidiNet application is free and open-source and seems to be compatible with ipMIDI too
(Https://github.com/rncbc/qmidinet)

I hope that some of these informations can help you better understand a possible implementation

Thank you again!
 
I would like to use another way for the midi trasmission over udp mainly because I think that the "complexity" of the RTP-MIDI system, related to the mechanism of session creation, invitations, checkings, ecc., them all can add some latency that could be avoided in Real Time Applications.
I think that a more simpler system (and yes, more error prone) could be better in the above situations.
 
The actual protocol literally is nothing special at all, what I mean by this is it's just the MIDI protocol over UDP. How do I know this? I used Wireshark to view messages that ipMIDI sends.
Each UDP message can have a maximum of 128 bytes of data, now what is in those 128 bytes is up to you. There can be any number of MIDI messages packed in there.
Now if your messages are larger than 128 bytes, for example SysEx, then you simply send it in 128 byte chunks.

You don't have to add anything to your original MIDI messages you just send them straight over UDP.
 
UDP packets can and often are dropped on the floor. This can't be detected unless there is some kind of sequencing field in each packet.
Unless you tightly control the physical network the packets go over (and there are no bugs in the switches) you will experience drops which can be tricky with MIDI producing stuck notes etc.
 
Indeed this would be an issue with ipMIDI as it has no way to detect this and that’s why the commercial products that use ipMIDI aren’t WiFi products. I believe that Apple-MIDI/rtpMIDI has a way to fix that, but as mentioned in the original post he didn’t want to use it.
 
Hello everyone!
Yes, my idea is to implement the system using physical connections and not wifi.
Moreover, the problems concerning the loss of information (stuck notes etc.) are easily manageable live in my situation. Recently, thanks to the contribution of a user/developer, some changes to the midi library have been proposed (and implemented!).
I hope this can help other developers to make the library more flexible and usable in different contextes...

You can find more information here:
https://github.com/FortySevenEffects/arduino_midi_library/issues/123
and here:
https://github.com/lathoub/Arduino-ipMIDI
 
There really is no protocol to it besides standard MIDI message, if you open a UDP multicast socket to the correct port number you just send your MIDI message straight to it with no changes or additions to the original message.
For example, this would send the MIDI message to turn off middle C:
Code:
IPAddress multicast(225, 0, 0, 37);
uint8_t messsage[3] = {0x80,0x3C,0x00};
UDP.beginPacket(multicast,21928);
UDP.write(message,3);
UDP.endPacket();
 
Thanks everyone for the replies.
I came to the same conclusions: ipMidi sends raw MIDI messages over UDP with no extra stuff.
 
Status
Not open for further replies.
Back
Top