Repository navigation
Expand file tree
/
Copy pathREADME.windows
More file actions
138 lines (101 loc) · 6.01 KB
/
Copy pathREADME.windows
File metadata and controls
138 lines (101 loc) · 6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Compiling and Running KeyKit on Windows
--------------------------------
To compile the windows version, you'll need these prerequisites:
0) Windows 10 or later (WinMM); Windows 11 25H2 or later for WMS
1) Microsoft Visual Studio 2022 or newer
Note: When installing, select "Desktop development with C++"
with CMake 3.24 or newer and Windows SDK 10.0.22000 or newer
2) Git (in c:\program files\Git, for a few unix utilities)
--------------------------------
To compile the executables from the command-line, execute:
makewindows.bat
This will compile and put binaries in the bin directory.
The x64 build includes RtMidi 6.1.0 with WinMM and Windows MIDI Services.
On SDKs without WMS headers, the first build downloads approximately 103 MB
of Microsoft preview metadata and generates the headers. It installs no runtime.
See rtmidi/README.keykit.md for details, offline metadata options, and tests.
The legacy Win32 Visual Studio configuration builds WinMM only; WMS is
included in the x64 build.
--------------------------------
KEYROOT is optional. KeyKit derives it from the running executable's location
(the parent of its bin or src directory), independently of PATH and the working
directory, including executable paths containing spaces. An explicit KEYROOT
still overrides this location. If discovery fails, the fallback diagnostic goes
to the Windows debug output without opening a blocking popup.
--------------------------------
MIDI backend selection (set before launching KeyKit):
WinMM is the default. No environment variable is required.
PowerShell, to request Windows MIDI Services:
$env:KEYKIT_MIDI_API = "wms"
.\bin\key.exe
Command Prompt:
set KEYKIT_MIDI_API=wms
bin\key.exe
Set KEYKIT_MIDI_API=winmm, or remove the variable, to return to WinMM.
Values are case insensitive. Invalid values or unavailable WMS report a
diagnostic and fall back to WinMM. Devmidi reports "winmm" or "wms".
KeyKit continues to send and receive MIDI 1.0 messages through either backend;
selecting WMS does not add a MIDI 2.0/UMP interface to the KeyKit language.
WMS requires the Windows.Devices.Midi2 API and a running MIDI service on a
supported Windows system. As of October 2026 this API is a Microsoft preview;
the standard x64 distribution bundles the API DLL and PRI, so users do not need
to install the SDK. This bundled edition requires Windows 11 25H2 or later.
For Windows 10 or older Windows 11 releases, use the _win_winmm.zip archive, which
excludes the preview API. WinMM remains the default in both editions. See
rtmidi/README.keykit.md and rtmidi/WINDOWS-MIDI-SERVICES-RUNTIME.txt for details.
With KEYKIT_MIDI_API=wms, KeyKit ensures three shared WMS loopback pairs exist:
KeyKit Loopback 1
KeyKit Loopback 2
KeyKit Loopback 3
Select the same name for output in one KeyKit instance and input in another,
just as with loopMIDI. This view works with WinMM and WMS. Other Windows
applications see "KeyKit Loopback 1 output" and "KeyKit Loopback 1 input":
send to output and receive from input. KeyKit hides the reverse sides and
shows the common name above. The native endpoints remain bidirectional;
their names indicate the intended use. These are
Windows MIDI Services loopbacks and do not require the loopMIDI driver.
Existing pairs are reused, including across simultaneous KeyKit startups.
KeyKit renames its previous default A/B names in place, preserving endpoint
identities and muted state. Custom names are preserved. It does not remove pairs
when it exits, so other instances can keep using them. The pairs last until
removed or the MIDI service restarts; the next WMS startup recreates missing
pairs. WinMM startup does not create pairs. If the WMS loopback transport is
unavailable, startup logs a diagnostic without a popup and keeps other MIDI
ports usable.
--------------------------------
MIDI port names:
Inputs and outputs now use the driver's names, so the same loopMIDI endpoint
has the same name in both directions. RtMidi's old output index suffix is
disabled. For the usual loopMIDI setup, update saved output selections as follows:
Previous output name New output and input name
loopMIDI Port 1 loopMIDI Port
loopMIDI Port 1 2 loopMIDI Port 1
loopMIDI Port 2 3 loopMIDI Port 2
These old suffixes were WinMM enumeration indices, not loopMIDI port numbers.
They applied to every WinMM output; the synth at output index 0 shifted the
loopMIDI output indices relative to the input indices. The numeric port values
reported by midi("input","list") and midi("output","list") remain separate
input/output indices. This change affects their displayed names, not routing.
If a driver supplies identical names for multiple ports in the same direction,
KeyKit adds explicit labels such as "Keyboard [duplicate 1]" and
"Keyboard [duplicate 2]". These labels distinguish occurrences in that direction;
they do not identify matching hardware across directions or device reorderings.
Unique driver names (including their original digits) are preserved verbatim.
inport() and outport() prefer an exact name before trying the existing partial
or regular-expression matching. For example, "loopMIDI Port 1" selects that
literal name even if "loopMIDI Port 10" appears earlier in the device list.
Update old names in keylocal.k or saved configurations; ambiguous old names
cannot be used as aliases because some are now real driver names.
--------------------------------
If you want to debug with Visual Studio after using makewindows.bat,
invoke Visual Studio on src/key.sln . If you make changes to some of the
files in src (for Windows-specific things) like makefile or key.sln,
execute "nmake mdepback" to copy those changes back to ../mdep/nt
--------------------------------
To compile a distribution and clean up afterward:
nmake distribution_nt
--------------------------------
See the doc directory for:
*.html - nicely formatted docs
porting - gives detailed porting guidelines.
Any questions, email to me@timthompson.com