Index
Projects
Notes
Contact

miditcp

miditcp is a VST host for Windows that receives MIDI data through TCP/IP sockets. It is especially useful when running under Wine: see the readme file for details, including how to set it up as an ALSA MIDI output device.

VST is a trademark of Steinberg Media Technologies GmbH

Screenshots

The main program dialog
The settings dialog

README

MIDITcp
=======

Author: mla (bgm13.com)

MIDITcp is essentially a MIDI to VST bridge, using TCP/IP as a
transport. The program maintains a bunch of "ports". Each port reads
MIDI data from a socket and sends the data to a VST synth plugin. The
sound generated by the VST plugins is mixed and sent to the speakers.

This program is handy for:

       - setting up an VST softsynth as the MIDI output device in both
         Linux and Wine, using the ALSA virmidi driver (see below)

       - connecting a MIDI keyboard to an VST without using a DAW

       - generating sound in a simple way (just send() some MIDI data
         from a C program, or pipe something using netcat)

       - generating MIDI data in one computer and
         rendering it in another (not tested)

The program uses TCP/IP only as a convenient *local* IPC method
between Wine and Linux. It may or may not work across the network (no
special attention has been given to network latency, etc)

VST is a trademark of Steinberg Media Technologies GmbH

Licensed under the GNU GPL version 3

PROTOCOL
========

The program opens several TCP sockets listening at consecutive
ports. In the default configuration these sockets are ports 8820,
8821, 8822... bound to address 127.0.0.1.

The data received is interpreted as a MIDI byte stream** and sent
quite literally to the VST. SysRT messages are ignored.

** (the bytes flowing through a good old MIDI cable, not the contents
   of a .mid file!)

CONFIGURATION
=============

The program maintains its configuration in the Windows registry. The
64-bit version saves the data under:

     HKEY_CURRENT_USER\Software\mla\miditcp64

The 32-bit version:

     HKEY_CURRENT_USER\Software\mla\miditcp32

HOW TO COMPILE
==============

No external libraries are needed beyond the VST 2.4 SDK; unpack the
SDK zip file under the source tree so that the aeffect.h file is at
vstsdk2.4/pluginterfaces/vst2.x/aeffect.h (or edit the file
GNUmakefile to point to the SDK location).

The program is usually cross compiled using mingw32 from Linux. If you
have the x86_64-w64-mingw32 toolchain installed, all you need to do
is:

     $ make

If you then want to build the 32-bit version, then:

     $ make clean
     $ make CROSS_COMPILE=i686-w64-mingw32-

Assuming make is GNU make.

ImageMagick is only needed if you want to regenerate the icon (app.ico)
from the source file (app.png).

USING MIDITCP AS ALSA MIDI DEVICE
=================================

With this program and the ALSA virmidi driver you can use a VST plugin
as the MIDI output device in Linux! It even works just fine inside
Wine (so you can get MIDI sound from old Windows games/RPG Maker games/etc)

How to do it is quite simple:

1. load the virmidi module (you may want to put this in a rc init file or something)

       # modprobe snd-virmidi

2. start the miditcp program and set up the VST plugin

3. pipe the virtual MIDI device into miditcp using netcat:

       $ netcat localhost 8820 < /dev/midi2

   where /dev/midi2 is the device file for the virtual MIDI device
   created by virmidi: your system will probably name it differently,
   or have different permissions: you'll have to do some trial and error

That's it. Now, playing MIDI using one of the ALSA MIDI devices named
"Virtual Raw MIDI ..." or "VirMIDI ..." will sound through the miditcp.

(While you're at it, set the Wine MIDI mapper output device to the
virmidi port so that programs that use the default Windows MIDI output
device emit sound through miditcp:

open regedit and go to key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Multimedia\MIDIMap
add value "szPname"="VirMIDI ..."

see https://bgm13.com/notes/wine-midi.html for details)

CONNECTING MIDI KEYBOARD TO MIDITCP
===================================

If you've done the ALSA virmidi thing, it is possible to connect a
real MIDI keyboard to miditcp. This is useful if you don't want to open
a DAW just to redirect the data from the MIDI keyboard into an VST.

To do this, use the ALSA aconnect tool:

      $ aconnect KEYBOARD VIRMIDI

where KEYBOARD and VIRMIDI are ALSA MIDI client:port pairs (list them
with aconnect -o and aconnect -i).

Downloads

User: guest, password: guest (info)
miditcp-1.0.tar.xz [SIG] source code 30 KB 2025-Jun-03
miditcp-1.0-w32.zip [SIG] win32 build 134 KB 2025-Jun-03
miditcp-1.0-w64.zip [SIG] win64 build 134 KB 2025-Jun-03
Initial public release.