r/MidiNet • • Aug 22 '26

Midinet v0.1 for Digital Audio

5 Upvotes

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