r/MidiNet • • Aug 22 '26

Midinet v0.1 for Digital Audio

Midinet protocol for delivering Digital Audio with Midi timestamps in standard Ethernet.

What ?

Midinet delivers digital audio with Midi timestamps in Ethernet with very low latencies directly between synthesizers without routers and hubs. Midinet digital audio packets include Midi JR timestamps for exact syncing between Midi note events and digital audio. User can select both daisy chain and star topology with Ethernet cables.

In daisy-chain, you can connect tens of synthesizers with under 5 millisecond round-trip latency for Midi packets and digital audio. Midinet protocol is designed mainly for home synth setups. You can also listen to all synths from one synths output jack, without any analog mixers or cables. You can also calculate songs faster than real time (burst-mode with Midi timestamps). Synthesizers send complete tracks, like bass-lines, back to the computer in a few seconds. Synthesizers can create their own audio stream or mix their audio to existing stream.

Protocol latency test below with ethernet cables and packet forwarding.

Why ?

Altough there are similar protocols like Dante, Aes67, A2B, IEEE etc. those often require specialized hardware and lack features like faster-than-realtime audio, on-the-go mixing and Midi timestamps. Many also require an expensive license, while Midinet is free and open. Midinet protocol is designed mainly as a light-weight digital audio alternative for home synthesizers.

Midi (5pin) vs. Standard Ethernet (8pin)

json at synthesizers

    midinet-stream-id                     0              ; stream id
    midinet-stream-enable                 10             ; enabled, seconds
    midinet-stream-type                   create         ; create or mix to stream (daisy-chain)
    midinet-stream-time                   realtime       ; realtime (udp) or burst (tcp)

    midinet-stream-server-ip              192.168.1.51   ; server
    midinet-stream-server-protocol        udp 
    midinet-stream-server-port            7002

    midinet-stream-router-ip              192.168.1.40   ; router
    midinet-stream-router-protocol        udp 
    midinet-stream-router-port            7002

    midinet-stream-format-hz              48000          ; stream format
    midinet-stream-format-bps             32
    midinet-stream-format-floating-point  0
    midinet-stream-format-channels        2
    midinet-stream-format-channel-use     0,1
    midinet-stream-format-samples         24
    midinet-stream-format-byte-order      0
    midinet-stream-format-divider         1
    midinet-stream-format-header-type     0
    midinet-stream-format-db0             24

    midinet-stream-include-midich         all            ; stream include
    midinet-stream-include-note           all
    midinet-stream-include-instrument     all
    midinet-stream-include-velocity       all
    midinet-stream-include-pitchbend      all

    midinet-stream-control-volume         65535          ; stream control
    midinet-stream-control-pan            32768
    midinet-stream-control-reverb         16384
    midinet-stream-control-delay,etc      8192

    midinet-stream-topology-discovery     off            ; off,send,read,detected
                                                          
    midinet-stream-status                 ok             ; ok,error,busy

Ethernet packet format for Audio

Fields: Flags, StreamID, Midi JR timestamp of first sample (extrapolated), PacketCount, AudioData.

Flags: StreamID present(0), JR present(1), PacketCount present(2), JR reset(3), PacketCount reset(4), JR rounded(5), Topology send/detected(6/7)

 Byte 0           Byte 1           Byte 2          Byte 3
┌────────────────┬────────────────┬────────────────────────────────┐
│  Flags (8b)    │ StreamID (8b)  │       Midi JR (16b)            │  <- First 32 bits
├────────────────┴────────────────┴────────────────────────────────┤
│                        PacketCount (32b)                         │  <- Second 32 bits
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│                        AudioData (PCM)                           │  <- Audiodata starts here
│                                                                  │

Audio server

  1. Device search (mDNS, midinet)
  2. Topology search (first forwarding node replaces 'send' with 'detected' to server)
  3. Configures json parameters at synthesizers (Midi 2.0 PE, Http patch/put/get, ..)
  4. Receives the sent digital audio packets.

Server runs on computers or synthesizers, so you could listen to all synths from single synths output port.

Single-button-configuration for audio listening.

Protocol and latency test

Protocol and latency test used two 3Ghz x86-64 computers with i8256x network cards.

  1. Computer A sent audio waveform packet with rdtsc-timestamp to Computer B
  2. Computer B summed its own waveform to the audio packet and sent it back to Computer A
  3. Computer A displayed the difference in rdtsc timestamp / 2 to get the per hop latency.

At 100mbps, latencies for Ethernet UDP packet with store/forward are following:

- Midi note packet (16 bytes) - below 40 microseconds

- Audio packet (8 byte header + 24 samples * 2 channels * 32bits) - below 60 microseconds

100Mbps - 50 synths in daisy-chain has a round-trip latency under 5 milliseconds.

1000Mbps - 70 synths in daisy-chain has a round-trip latency under 5 milliseconds.

Comparison to other audio protocols

===================================================================================================================
Feature          Midinet          IEEE avb/tsn     Aes67/Ravenna    A2B              Dante           mLan
===================================================================================================================
Licensing        Free/Open        Free/Open        Free/Open        Prop.chips       Proprietary     Prop.sw

Hardware         Standard         Req.AVB/TSN      Standard         A2B transc.      Dante HW or     Firewire
                 Ethernet         switches         Ethernet         No ethernet      Ethernet+Hub    No ethernet

Control          mDNS,MidiPE or   IEEE-802/1722    mDNS,RTSP        Proprietary      Dante           mLAN Tools
                 Http (json)                       NMOS             software         Controller      software

Streamtypes      Individual       Individual       Individual       Individual       Individual      Individual
                 Mixed

Streamtime       Realtime         Realtime         Realtime         Realtime         Realtime        Realtime
                 Burst

Timing           Midi JR          PTPv2            PTPv2            TDM              PTPv1/PTPv2     IEC 61883-6
===================================================================================================================

Links

https://midi.org/network-midi-2-0-udp-overview

5 Upvotes

10 comments sorted by

3

u/TOGoS Sep 04 '26 edited Sep 04 '26

I've long been searching for some way to send audio over the network in a very low-latency way for the very mundane purpose of being able to play music in multiple rooms at once, from multiple sources.

As the post mentions, all the existing standards seem to require some expensive hardware or licenses or something.

I looked into NetJACK but it seemed to be...somewhat abandoned. And hard to get working on Windows, which unfortunately is where my main DAW[s] live.

I've even thought about whipping up my own protocol.

I wonder if this would be suitable.

That said, what is 'MidiNet'? I see the link to a page about 'network MIDI 2.0', but I'm not sure in what way these are related.

1

u/micro2970 Sep 04 '26 edited Sep 14 '26

Midinet is the name for this experimental digital audio procotol. And midinet uses Midi JR timestamps from network Midi 2.0 to sync audio precisely with Midi note events. But yeah, it can carry all sorts of audio.

2

u/EduardoCorochio Sep 14 '26

Amazing. Apologies if I’m not seeing it but how many channels of audio can this handle?

1

u/micro2970 Sep 14 '26 edited Sep 14 '26

If one Ethernet frame deliveres 10 audio channels (32bit/sample at 48hkz) at 0.5 ms intervals (2000 frames a second) that takes around 16.7 Mb/sec. So even at 100Mb/s, network can deliver tens of channels. At 1 Gb network, much more. Each node should forward packets at below 100 microsec.

2

u/EduardoCorochio Sep 14 '26

So a free alternative to Dante that also transmits MIDI!?

1

u/micro2970 Sep 14 '26 edited Sep 14 '26

Midi 2.0 has support for Ethernet and timestamps.

So a free digital audio protocol for synthesizers with Midi timestamps.

1

u/EduardoCorochio Sep 14 '26

Why do you say it's only for synthesizers? It transmits audio over standard network hardware? Couldn't that be used for anything that can receive a network stream?

1

u/micro2970 Sep 14 '26 edited Sep 14 '26

Yes it can be used for all other audio also. Synthesizers just use Midi timestamps.

2

u/EduardoCorochio Sep 14 '26

Cool - how do I implement it? Apologies if I missed a github page or something.

3

u/Specialist-Dog-501 Aug 30 '26

I don't understand all of it, but impressed! Hope you find some devs supporting this, awesome!