Virtual Ports and Loopback
A virtual port is a MIDI cable inside the system, and a loopback returns an output to an input.
Related
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
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.