midi-communications-windows 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.version +6 -0
- data/.yardoc/checksums +8 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/.yardopts +8 -0
- data/Gemfile +3 -0
- data/LICENSE +165 -0
- data/README.md +176 -0
- data/Rakefile +13 -0
- data/doc/MIDICommunicationsWindows/API/MIDIHdr.html +144 -0
- data/doc/MIDICommunicationsWindows/API/MIDIInCaps.html +142 -0
- data/doc/MIDICommunicationsWindows/API/MIDIOutCaps.html +140 -0
- data/doc/MIDICommunicationsWindows/API/MSG.html +143 -0
- data/doc/MIDICommunicationsWindows/API.html +981 -0
- data/doc/MIDICommunicationsWindows/Device/ClassMethods.html +365 -0
- data/doc/MIDICommunicationsWindows/Device/InstanceMethods.html +1096 -0
- data/doc/MIDICommunicationsWindows/Device.html +988 -0
- data/doc/MIDICommunicationsWindows/Error.html +438 -0
- data/doc/MIDICommunicationsWindows/Input.html +1554 -0
- data/doc/MIDICommunicationsWindows/Message.html +700 -0
- data/doc/MIDICommunicationsWindows/Output.html +1697 -0
- data/doc/MIDICommunicationsWindows/TypeConversion.html +369 -0
- data/doc/MIDICommunicationsWindows.html +210 -0
- data/doc/_index.html +262 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +206 -0
- data/doc/css/style.css +1089 -0
- data/doc/file.README.html +240 -0
- data/doc/file.testing-on-windows.html +253 -0
- data/doc/file_list.html +64 -0
- data/doc/frames.html +22 -0
- data/doc/index.html +240 -0
- data/doc/js/app.js +801 -0
- data/doc/js/full_list.js +334 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +382 -0
- data/doc/top-level-namespace.html +112 -0
- data/docs/testing-on-windows.md +222 -0
- data/examples/input.rb +27 -0
- data/examples/list_ports.rb +17 -0
- data/examples/output.rb +22 -0
- data/examples/sysex_output.rb +15 -0
- data/lib/midi-communications-windows/api.rb +340 -0
- data/lib/midi-communications-windows/device.rb +310 -0
- data/lib/midi-communications-windows/input.rb +486 -0
- data/lib/midi-communications-windows/message.rb +133 -0
- data/lib/midi-communications-windows/output.rb +206 -0
- data/lib/midi-communications-windows/type_conversion.rb +20 -0
- data/lib/midi-communications-windows/version.rb +4 -0
- data/lib/midi-communications-windows.rb +76 -0
- data/midi-communications-windows.gemspec +32 -0
- metadata +220 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Module: MIDICommunicationsWindows::TypeConversion
|
|
8
|
+
|
|
9
|
+
— MIDI Communications Windows API
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css">
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "MIDICommunicationsWindows::TypeConversion";
|
|
19
|
+
relpath = '../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div id="main_progress" aria-hidden="true"></div>
|
|
31
|
+
|
|
32
|
+
<div class="nav_wrap">
|
|
33
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
34
|
+
<div id="resizer"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="main" tabindex="-1">
|
|
38
|
+
<div id="header">
|
|
39
|
+
<div id="menu">
|
|
40
|
+
|
|
41
|
+
<a href="../_index.html">Index (T)</a> »
|
|
42
|
+
<span class='title'><span class='object_link'><a href="../MIDICommunicationsWindows.html" title="MIDICommunicationsWindows (module)">MIDICommunicationsWindows</a></span></span>
|
|
43
|
+
»
|
|
44
|
+
<span class="title">TypeConversion</span>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div id="search">
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="class_list_link"
|
|
51
|
+
href="../class_list.html">
|
|
52
|
+
|
|
53
|
+
<svg width="24" height="24">
|
|
54
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
56
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
57
|
+
</svg>
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="content"><h1>Module: MIDICommunicationsWindows::TypeConversion
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</h1>
|
|
69
|
+
<div class="box_info">
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
<dl>
|
|
75
|
+
<dt>Extended by:</dt>
|
|
76
|
+
<dd><span class='object_link'><a href="" title="MIDICommunicationsWindows::TypeConversion (module)">TypeConversion</a></span></dd>
|
|
77
|
+
</dl>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
<dl>
|
|
85
|
+
<dt>Included in:</dt>
|
|
86
|
+
<dd><span class='object_link'><a href="" title="MIDICommunicationsWindows::TypeConversion (module)">TypeConversion</a></span></dd>
|
|
87
|
+
</dl>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<dl>
|
|
92
|
+
<dt>Defined in:</dt>
|
|
93
|
+
<dd>lib/midi-communications-windows/type_conversion.rb
|
|
94
|
+
</dd>
|
|
95
|
+
</dl>
|
|
96
|
+
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<h2>Overview</h2><div class="docstring">
|
|
100
|
+
<div class="discussion">
|
|
101
|
+
<p>Utility methods for converting between MIDI data formats.</p>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="tags">
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
<h2>
|
|
117
|
+
Class Method Summary
|
|
118
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
119
|
+
</h2>
|
|
120
|
+
|
|
121
|
+
<ul class="summary">
|
|
122
|
+
|
|
123
|
+
<li class="public ">
|
|
124
|
+
<span class="summary_signature">
|
|
125
|
+
|
|
126
|
+
<a href="#numeric_bytes_to_hex_string-class_method" title="#numeric_bytes_to_hex_string (class method)">.<strong>numeric_bytes_to_hex_string</strong>(bytes) ⇒ String </a>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
</span>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
<span class="summary_desc"><div class='inline'><p>Converts an array of numeric bytes to a hex string.</p></div></span>
|
|
141
|
+
|
|
142
|
+
</li>
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
</ul>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
<h2>
|
|
149
|
+
Instance Method Summary
|
|
150
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
151
|
+
</h2>
|
|
152
|
+
|
|
153
|
+
<ul class="summary">
|
|
154
|
+
|
|
155
|
+
<li class="public ">
|
|
156
|
+
<span class="summary_signature">
|
|
157
|
+
|
|
158
|
+
<a href="#numeric_bytes_to_hex_string-instance_method" title="#numeric_bytes_to_hex_string (instance method)">#<strong>numeric_bytes_to_hex_string</strong>(bytes) ⇒ String </a>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
</span>
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
<span class="summary_desc"><div class='inline'><p>Converts an array of numeric bytes to a hex string.</p></div></span>
|
|
173
|
+
|
|
174
|
+
</li>
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
</ul>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
<div id="class_method_details" class="method_details_list">
|
|
184
|
+
<h2>Class Method Details</h2>
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
<div class="method_details first">
|
|
188
|
+
<h3 class="signature first" id="numeric_bytes_to_hex_string-class_method">
|
|
189
|
+
|
|
190
|
+
.<strong>numeric_bytes_to_hex_string</strong>(bytes) ⇒ <tt>String</tt>
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
</h3><div class="docstring">
|
|
197
|
+
<div class="discussion">
|
|
198
|
+
<p>Converts an array of numeric bytes to a hex string.</p>
|
|
199
|
+
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
<div class="tags">
|
|
203
|
+
|
|
204
|
+
<div class="examples">
|
|
205
|
+
<h4 class="tag_title">Examples:</h4>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="MIDICommunicationsWindows::TypeConversion (module)">TypeConversion</a></span></span><span class='period'>.</span><span class='id identifier rubyid_numeric_bytes_to_hex_string'>numeric_bytes_to_hex_string</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>0x90</span><span class='comma'>,</span> <span class='int'>0x40</span><span class='comma'>,</span> <span class='int'>0x40</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
209
|
+
<span class='comment'># => "904040"</span></code></pre>
|
|
210
|
+
|
|
211
|
+
</div>
|
|
212
|
+
<p class="tag_title">Parameters:</p>
|
|
213
|
+
<ul class="param">
|
|
214
|
+
|
|
215
|
+
<li>
|
|
216
|
+
|
|
217
|
+
<span class='name'>bytes</span>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
—
|
|
225
|
+
<div class='inline'><p>numeric bytes, e.g. <code>[0x90, 0x40, 0x40]</code></p></div>
|
|
226
|
+
|
|
227
|
+
</li>
|
|
228
|
+
|
|
229
|
+
</ul>
|
|
230
|
+
|
|
231
|
+
<p class="tag_title">Returns:</p>
|
|
232
|
+
<ul class="return">
|
|
233
|
+
|
|
234
|
+
<li>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
—
|
|
242
|
+
<div class='inline'><p>uppercase hex, two characters per byte, e.g. <code>'904040'</code></p></div>
|
|
243
|
+
|
|
244
|
+
</li>
|
|
245
|
+
|
|
246
|
+
</ul>
|
|
247
|
+
|
|
248
|
+
</div><table class="source_code">
|
|
249
|
+
<tr>
|
|
250
|
+
<td>
|
|
251
|
+
<pre class="lines">
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
16
|
|
255
|
+
17
|
|
256
|
+
18</pre>
|
|
257
|
+
</td>
|
|
258
|
+
<td>
|
|
259
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-windows/type_conversion.rb', line 16</span>
|
|
260
|
+
|
|
261
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_numeric_bytes_to_hex_string'>numeric_bytes_to_hex_string</span><span class='lparen'>(</span><span class='id identifier rubyid_bytes'>bytes</span><span class='rparen'>)</span>
|
|
262
|
+
<span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_byte'>byte</span><span class='op'>|</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%02X</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_byte'>byte</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
|
263
|
+
<span class='kw'>end</span></pre>
|
|
264
|
+
</td>
|
|
265
|
+
</tr>
|
|
266
|
+
</table>
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<div id="instance_method_details" class="method_details_list">
|
|
272
|
+
<h2>Instance Method Details</h2>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
<div class="method_details first">
|
|
276
|
+
<h3 class="signature first" id="numeric_bytes_to_hex_string-instance_method">
|
|
277
|
+
|
|
278
|
+
#<strong>numeric_bytes_to_hex_string</strong>(bytes) ⇒ <tt>String</tt>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
</h3><div class="docstring">
|
|
285
|
+
<div class="discussion">
|
|
286
|
+
<p>Converts an array of numeric bytes to a hex string.</p>
|
|
287
|
+
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
<div class="tags">
|
|
291
|
+
|
|
292
|
+
<div class="examples">
|
|
293
|
+
<h4 class="tag_title">Examples:</h4>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="MIDICommunicationsWindows::TypeConversion (module)">TypeConversion</a></span></span><span class='period'>.</span><span class='id identifier rubyid_numeric_bytes_to_hex_string'>numeric_bytes_to_hex_string</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>0x90</span><span class='comma'>,</span> <span class='int'>0x40</span><span class='comma'>,</span> <span class='int'>0x40</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
297
|
+
<span class='comment'># => "904040"</span></code></pre>
|
|
298
|
+
|
|
299
|
+
</div>
|
|
300
|
+
<p class="tag_title">Parameters:</p>
|
|
301
|
+
<ul class="param">
|
|
302
|
+
|
|
303
|
+
<li>
|
|
304
|
+
|
|
305
|
+
<span class='name'>bytes</span>
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
—
|
|
313
|
+
<div class='inline'><p>numeric bytes, e.g. <code>[0x90, 0x40, 0x40]</code></p></div>
|
|
314
|
+
|
|
315
|
+
</li>
|
|
316
|
+
|
|
317
|
+
</ul>
|
|
318
|
+
|
|
319
|
+
<p class="tag_title">Returns:</p>
|
|
320
|
+
<ul class="return">
|
|
321
|
+
|
|
322
|
+
<li>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
—
|
|
330
|
+
<div class='inline'><p>uppercase hex, two characters per byte, e.g. <code>'904040'</code></p></div>
|
|
331
|
+
|
|
332
|
+
</li>
|
|
333
|
+
|
|
334
|
+
</ul>
|
|
335
|
+
|
|
336
|
+
</div><table class="source_code">
|
|
337
|
+
<tr>
|
|
338
|
+
<td>
|
|
339
|
+
<pre class="lines">
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
16
|
|
343
|
+
17
|
|
344
|
+
18</pre>
|
|
345
|
+
</td>
|
|
346
|
+
<td>
|
|
347
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-windows/type_conversion.rb', line 16</span>
|
|
348
|
+
|
|
349
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_numeric_bytes_to_hex_string'>numeric_bytes_to_hex_string</span><span class='lparen'>(</span><span class='id identifier rubyid_bytes'>bytes</span><span class='rparen'>)</span>
|
|
350
|
+
<span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_byte'>byte</span><span class='op'>|</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%02X</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_byte'>byte</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
|
351
|
+
<span class='kw'>end</span></pre>
|
|
352
|
+
</td>
|
|
353
|
+
</tr>
|
|
354
|
+
</table>
|
|
355
|
+
</div>
|
|
356
|
+
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
</div>
|
|
360
|
+
|
|
361
|
+
<div id="footer">
|
|
362
|
+
Generated on Sun Sep 6 21:20:52 2026 by
|
|
363
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
364
|
+
0.9.45 (ruby-3.4.7).
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
</div>
|
|
368
|
+
</body>
|
|
369
|
+
</html>
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Module: MIDICommunicationsWindows
|
|
8
|
+
|
|
9
|
+
— MIDI Communications Windows API
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css">
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css">
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "MIDICommunicationsWindows";
|
|
19
|
+
relpath = '';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div id="main_progress" aria-hidden="true"></div>
|
|
31
|
+
|
|
32
|
+
<div class="nav_wrap">
|
|
33
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
|
34
|
+
<div id="resizer"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="main" tabindex="-1">
|
|
38
|
+
<div id="header">
|
|
39
|
+
<div id="menu">
|
|
40
|
+
|
|
41
|
+
<a href="_index.html">Index (M)</a> »
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<span class="title">MIDICommunicationsWindows</span>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div id="search">
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="class_list_link"
|
|
51
|
+
href="class_list.html">
|
|
52
|
+
|
|
53
|
+
<svg width="24" height="24">
|
|
54
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
56
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
57
|
+
</svg>
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="content"><h1>Module: MIDICommunicationsWindows
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</h1>
|
|
69
|
+
<div class="box_info">
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<dl>
|
|
82
|
+
<dt>Defined in:</dt>
|
|
83
|
+
<dd>lib/midi-communications-windows.rb<span class="defines">,<br>
|
|
84
|
+
lib/midi-communications-windows/api.rb,<br> lib/midi-communications-windows/input.rb,<br> lib/midi-communications-windows/device.rb,<br> lib/midi-communications-windows/output.rb,<br> lib/midi-communications-windows/message.rb,<br> lib/midi-communications-windows/version.rb,<br> lib/midi-communications-windows/type_conversion.rb</span>
|
|
85
|
+
|
|
86
|
+
</dd>
|
|
87
|
+
</dl>
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
|
92
|
+
<div class="discussion">
|
|
93
|
+
<p>Windows-specific MIDI I/O through the Windows Multimedia (WinMM) API.</p>
|
|
94
|
+
<p>This library gives low-level access to MIDI ports on Windows by binding
|
|
95
|
+
<code>winmm.dll</code> with FFI. It is normally used through the higher-level
|
|
96
|
+
<a href="https://github.com/javier-sy/midi-communications" target="_parent" title="midi-communications">midi-communications</a> gem,
|
|
97
|
+
which selects it automatically on Windows.</p>
|
|
98
|
+
<p>The classes are <span class='object_link'><a href="MIDICommunicationsWindows/Input.html" title="MIDICommunicationsWindows::Input (class)">Input</a></span>, for receiving, and <span class='object_link'><a href="MIDICommunicationsWindows/Output.html" title="MIDICommunicationsWindows::Output (class)">Output</a></span>, for sending. <span class='object_link'><a href="MIDICommunicationsWindows/Device.html" title="MIDICommunicationsWindows::Device (module)">Device</a></span>
|
|
99
|
+
enumerates both.</p>
|
|
100
|
+
<h2 id="Why_WinMM__and_not_one_of_the_newer_APIs">Why WinMM, and not one of the newer APIs</h2>
|
|
101
|
+
<p>Windows has three MIDI APIs a program could use. WinMM is the oldest, and as
|
|
102
|
+
of February 2026 it is also the most sensible choice for Ruby.</p>
|
|
103
|
+
<p>Windows MIDI Services, generally available in Windows 11 since then, replaced
|
|
104
|
+
the MIDI stack underneath. The existing MIDI 1.0 APIs were reconnected to the
|
|
105
|
+
new service rather than retired, so a WinMM client reaches what the new stack
|
|
106
|
+
offers with nothing installed — including the loopback endpoints the system
|
|
107
|
+
now creates itself, which used to need a third-party driver.</p>
|
|
108
|
+
<p>Whether a port can be opened by more than one program at a time follows the
|
|
109
|
+
endpoint, not the API. Measured: two clients shared a loopback input and both
|
|
110
|
+
received every message, while a second open of a classic <code>wdmaud</code> device was
|
|
111
|
+
refused as already in use. On Windows 10 there is no Windows MIDI Services.</p>
|
|
112
|
+
<p>The new App SDK offers MIDI 2.0 and UMP, which this library does not need —
|
|
113
|
+
<code>midi-communications</code> and MusaDSL are MIDI 1.0 throughout — and it is
|
|
114
|
+
published only as WinRT. Microsoft's own guidance is that other languages
|
|
115
|
+
need a WinRT projection from their toolchain, and Ruby has none.</p>
|
|
116
|
+
<h2 id="Why_no_compiled_artifact">Why no compiled artifact</h2>
|
|
117
|
+
<p><code>winmm.dll</code> is present on every Windows installation, so this gem binds a
|
|
118
|
+
library that is already there and ships no binary of its own. The only
|
|
119
|
+
compiled dependency is <code>ffi</code> itself, which is published for every Windows
|
|
120
|
+
platform including ARM64. Distributing platform-specific binaries through
|
|
121
|
+
RubyGems is where installations break; there is nothing here to break.</p>
|
|
122
|
+
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="tags">
|
|
126
|
+
|
|
127
|
+
<div class="examples">
|
|
128
|
+
<h4 class="tag_title">Examples:</h4>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<h5 class="example_title"><div class='inline'><p>List the output ports</p></div></h5>
|
|
132
|
+
|
|
133
|
+
<pre class="example code"><code><span class='const'>MIDICommunicationsWindows</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="MIDICommunicationsWindows/Output.html" title="MIDICommunicationsWindows::Output (class)">Output</a></span></span><span class='period'>.</span><span class='id identifier rubyid_all'><span class='object_link'><a href="MIDICommunicationsWindows/Device/ClassMethods.html#all-instance_method" title="MIDICommunicationsWindows::Device::ClassMethods#all (method)">all</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_output'>output</span><span class='op'>|</span>
|
|
134
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
135
|
+
<span class='kw'>end</span></code></pre>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<h5 class="example_title"><div class='inline'><p>Send a note</p></div></h5>
|
|
139
|
+
|
|
140
|
+
<pre class="example code"><code><span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='const'>MIDICommunicationsWindows</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="MIDICommunicationsWindows/Output.html" title="MIDICommunicationsWindows::Output (class)">Output</a></span></span><span class='period'>.</span><span class='id identifier rubyid_first'><span class='object_link'><a href="MIDICommunicationsWindows/Device/ClassMethods.html#first-instance_method" title="MIDICommunicationsWindows::Device::ClassMethods#first (method)">first</a></span></span>
|
|
141
|
+
<span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span>
|
|
142
|
+
<span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span><span class='lparen'>(</span><span class='int'>0x90</span><span class='comma'>,</span> <span class='int'>60</span><span class='comma'>,</span> <span class='int'>100</span><span class='rparen'>)</span></code></pre>
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<p class="tag_title">See Also:</p>
|
|
148
|
+
<ul class="see">
|
|
149
|
+
|
|
150
|
+
<li><a href="https://learn.microsoft.com/en-us/windows/win32/multimedia/midi-reference" target="_parent" title="Microsoft's MIDI reference">Microsoft's MIDI reference</a></li>
|
|
151
|
+
|
|
152
|
+
</ul>
|
|
153
|
+
|
|
154
|
+
</div><h2>Defined Under Namespace</h2>
|
|
155
|
+
<p class="children">
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="MIDICommunicationsWindows/API.html" title="MIDICommunicationsWindows::API (module)">API</a></span>, <span class='object_link'><a href="MIDICommunicationsWindows/Device.html" title="MIDICommunicationsWindows::Device (module)">Device</a></span>, <span class='object_link'><a href="MIDICommunicationsWindows/Message.html" title="MIDICommunicationsWindows::Message (module)">Message</a></span>, <span class='object_link'><a href="MIDICommunicationsWindows/TypeConversion.html" title="MIDICommunicationsWindows::TypeConversion (module)">TypeConversion</a></span>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="MIDICommunicationsWindows/Error.html" title="MIDICommunicationsWindows::Error (class)">Error</a></span>, <span class='object_link'><a href="MIDICommunicationsWindows/Input.html" title="MIDICommunicationsWindows::Input (class)">Input</a></span>, <span class='object_link'><a href="MIDICommunicationsWindows/Output.html" title="MIDICommunicationsWindows::Output (class)">Output</a></span>
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
</p>
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
<h2>
|
|
169
|
+
Constant Summary
|
|
170
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
171
|
+
</h2>
|
|
172
|
+
|
|
173
|
+
<dl class="constants">
|
|
174
|
+
|
|
175
|
+
<dt id="VERSION-constant" class="">VERSION =
|
|
176
|
+
<div class="docstring">
|
|
177
|
+
<div class="discussion">
|
|
178
|
+
<p>Current version of the midi-communications-windows gem.</p>
|
|
179
|
+
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="tags">
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
</div>
|
|
186
|
+
</dt>
|
|
187
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.3</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
188
|
+
|
|
189
|
+
</dl>
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div id="footer">
|
|
203
|
+
Generated on Sun Sep 6 21:20:52 2026 by
|
|
204
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
205
|
+
0.9.45 (ruby-3.4.7).
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
</div>
|
|
209
|
+
</body>
|
|
210
|
+
</html>
|