midicnAudio & Music Production 中文

Virtual Ports and Loopback

A virtual port is a MIDI cable inside the system, and a loopback returns an output to an input.

Two programs both want to be host, or a sequencer and a sound source share one computer. Virtual ports replace cables, and loopbacks make self-tests possible.

The problem

Without ports, programs can only exchange files. A wrong port name sends messages into another application, while a miswired loopback returns the output to itself until notes pile up.

Protocol or message

A virtual port is an endpoint registered by a driver, visible to a sender at one end and a receiver at the other. A loopback connects an output straight to an input, returning messages unchanged. Each port still holds sixteen channels, and the port name is the routing address. Merging stacks several streams into one port, where identical channel numbers collide.

Settings and practice

Create the port first, then pick the same name at both ends. Send one note through a loopback and confirm it returns once. Prefix port names when several programs share them. Add a port when channels run out instead of squeezing every part into sixteen. Close unused ports to cut polling.

What to listen for

A miswired loopback creates a message storm as notes pile up. A wrong port makes a fader move another track.

Common misunderstandings

A virtual port is not a plug-in. A loopback is not a recording. Port count is not channel count.

Listen in the library

The Nutcracker (ballet) Op.71C16:1616 个通道全满,30 条轨共用,第二个端口才有分流余地DetailsFlourish For Wind BandC11:4431 条轨铺在 16 个通道上,端口元事件逐轨出现DetailsTristan und Isolde WWV 90C112:3443 条轨只用 15 个通道,合并时通道号最容易相撞Details

All tracks from midicn-lib — inline badge is the license tier (C1 commercial / C2 non-commercial / C3 study only).

Sources

  • 操作系统虚拟 MIDI 端点与回环的通行做法,依公开驱动文档核查,未抄文本
  • 端口元事件与多端口寻址的约定,依 SMF 规范核查,未抄文本

Used for fact-checking only; all prose is original.