Sending raw udp data


I need to send MIDI via UDP to a remote machine - is there a way to do that in SC?
So far I could only find NetAddr.sendMsg but that does send OSC - not raw UDP.

Thanks !


You might try sendRaw – though the documentation is thin. I guess you’d need to supply it with an Int8Array but I’m not sure.

But… is it absolutely required for the data to be MIDI during transport? I’d guess, probably not.

The remote machine could also be running SC, receive OSC, and unpack MIDI messages from that. You could encode MIDI message types as OSC command paths, or send a generic /rawMIDI and append the MIDI bytes as arguments. Or Pd/Max can receive OSC and treat the data as MIDI.

I guess this wouldn’t work if the remote machine is a hardware synth with a network MIDI interface, but such devices are rare. If it’s a softsynth on the other side, you could still run SC to receive OSC and send MIDI by loopback. There are a lot of approaches here – there may not be a need to lock into “I must transmit MIDI.”


Thanks a lot for your reply - I´ll have a look into sendRaw. In my case, the data needs to be MIDI during transport, and protocol needs to be UDP as I don´t have access to the remote machine´s os. It´s a pipe organ that has a MIDI-to-UDP interface, but stop controls do not work properly via that interface so I´m trying to omit it and send the midi directly to the organ´s system. I can connect to the organ´s IP and I know from the manufacturer, that it accepts midi via udp, but I can´t make that last step work… so this might be one of such rare devices…

I’ve connected to a few weird things via sendRaw - it SHOULD be exactly what it sounds like: a way to dump raw data to a UDP port. In my experience, getting SC to produce the right binary data was always harder than actually making the connection / sending.

I would definitely grab a tool like Wireshark to monitor the packets you’re sending, it can help with debugging obvious problems. Actually, if the “MIDI-to-UDP interface” you’re describing is software running on your side, Wireshark should be able to tell you exactly what it’s sending, which should make it easier to reverse engineer.

Thanks for the tips - it seems like I could send MIDI via .sendRaw, but would need to make an interpreter for it. In my case ipMIDI by ipMIDI - MIDI over Ethernet port will do the trick easier I guess. (wireshark is a great helper too !)