midi-communications-macos 0.6.1 → 0.7.0
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 +4 -4
- data/.version +6 -0
- data/.yardoc/checksums +9 -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 +6 -0
- data/LICENSE +159 -668
- data/README.md +6 -13
- data/doc/MIDICommunicationsMacOS/API/CF.html +124 -0
- data/doc/MIDICommunicationsMacOS/API/HostTime.html +124 -0
- data/doc/MIDICommunicationsMacOS/API/MIDIPacket.html +137 -0
- data/doc/MIDICommunicationsMacOS/API/MIDIPacketList.html +137 -0
- data/doc/MIDICommunicationsMacOS/API/MIDISysexSendRequest.html +137 -0
- data/doc/MIDICommunicationsMacOS/API.html +912 -0
- data/doc/MIDICommunicationsMacOS/Destination.html +1983 -0
- data/doc/MIDICommunicationsMacOS/Device.html +1102 -0
- data/doc/MIDICommunicationsMacOS/Endpoint.html +1665 -0
- data/doc/MIDICommunicationsMacOS/Entity.html +971 -0
- data/doc/MIDICommunicationsMacOS/Source.html +1784 -0
- data/doc/MIDICommunicationsMacOS/TypeConversion.html +393 -0
- data/doc/MIDICommunicationsMacOS.html +214 -0
- data/doc/_index.html +250 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +503 -0
- data/doc/file.README.html +275 -0
- data/doc/file_list.html +59 -0
- data/doc/frames.html +22 -0
- data/doc/index.html +275 -0
- data/doc/js/app.js +344 -0
- data/doc/js/full_list.js +242 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +542 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/midi-communications-macos/api.rb +7 -1
- data/lib/midi-communications-macos/destination.rb +86 -20
- data/lib/midi-communications-macos/device.rb +52 -18
- data/lib/midi-communications-macos/endpoint.rb +31 -5
- data/lib/midi-communications-macos/entity.rb +20 -6
- data/lib/midi-communications-macos/source.rb +79 -19
- data/lib/midi-communications-macos/type_conversion.rb +11 -4
- data/lib/midi-communications-macos/version.rb +2 -1
- data/lib/midi-communications-macos.rb +37 -0
- data/midi-communications-macos.gemspec +11 -9
- metadata +83 -4
|
@@ -0,0 +1,275 @@
|
|
|
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
|
+
File: README
|
|
8
|
+
|
|
9
|
+
— MIDI Communications macOS 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 = "README";
|
|
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 class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="file_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="_index.html">Index</a> »
|
|
40
|
+
<span class="title">File: README</span>
|
|
41
|
+
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div id="search">
|
|
45
|
+
|
|
46
|
+
<a class="full_list_link" id="class_list_link"
|
|
47
|
+
href="class_list.html">
|
|
48
|
+
|
|
49
|
+
<svg width="24" height="24">
|
|
50
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
51
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
52
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
</svg>
|
|
54
|
+
</a>
|
|
55
|
+
|
|
56
|
+
</div>
|
|
57
|
+
<div class="clear"></div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div id="content"><div id='filecontents'><h1 id="midi-communications-macos-layer">MIDI Communications MacOS Layer</h1>
|
|
61
|
+
|
|
62
|
+
<p><a href="https://www.ruby-lang.org/"><img src="https://img.shields.io/badge/ruby-2.7+-red.svg" alt="Ruby Version"></a>
|
|
63
|
+
<a href="https://www.gnu.org/licenses/lgpl-3.0.html"><img src="https://img.shields.io/badge/license-LGPL--3.0--or--later-blue.svg" alt="License"></a></p>
|
|
64
|
+
|
|
65
|
+
<p><strong>Realtime MIDI IO with Ruby for OSX.</strong></p>
|
|
66
|
+
|
|
67
|
+
<p>Access the <a href="https://developer.apple.com/library/mac/#documentation/MusicAudio/Reference/CACoreMIDIRef/MIDIServices/">Apple Core MIDI framework API</a> with Ruby.</p>
|
|
68
|
+
|
|
69
|
+
<p>This library is part of a suite of Ruby libraries for MIDI:</p>
|
|
70
|
+
|
|
71
|
+
<table><thead>
|
|
72
|
+
<tr>
|
|
73
|
+
<th>Function</th>
|
|
74
|
+
<th>Library</th>
|
|
75
|
+
</tr>
|
|
76
|
+
</thead><tbody>
|
|
77
|
+
<tr>
|
|
78
|
+
<td>MIDI Events representation</td>
|
|
79
|
+
<td><a href="https://github.com/javier-sy/midi-events">MIDI Events</a></td>
|
|
80
|
+
</tr>
|
|
81
|
+
<tr>
|
|
82
|
+
<td>MIDI Data parsing</td>
|
|
83
|
+
<td><a href="https://github.com/javier-sy/midi-parser">MIDI Parser</a></td>
|
|
84
|
+
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td>MIDI communication with Instruments and Control Surfaces</td>
|
|
87
|
+
<td><a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a></td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td>Low level MIDI interface to MacOS</td>
|
|
91
|
+
<td><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a></td>
|
|
92
|
+
</tr>
|
|
93
|
+
<tr>
|
|
94
|
+
<td>Low level MIDI interface to Linux</td>
|
|
95
|
+
<td><strong>TO DO</strong> (by now <a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a> uses <a href="http://github.com/arirusso/alsa-rawmidi">alsa-rawmidi</a>)</td>
|
|
96
|
+
</tr>
|
|
97
|
+
<tr>
|
|
98
|
+
<td>Low level MIDI interface to JRuby</td>
|
|
99
|
+
<td><strong>TO DO</strong> (by now <a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a> uses <a href="http://github.com/arirusso/midi-jruby">midi-jruby</a>)</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td>Low level MIDI interface to Windows</td>
|
|
103
|
+
<td><strong>TO DO</strong> (by now <a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a> uses <a href="http://github.com/arirusso/midi-winmm">midi-winm</a>)</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</tbody></table>
|
|
106
|
+
|
|
107
|
+
<p>This library is based on <a href="http://github.com/arirusso">Ari Russo's</a> library <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a>.</p>
|
|
108
|
+
|
|
109
|
+
<h2 id="features">Features</h2>
|
|
110
|
+
|
|
111
|
+
<ul>
|
|
112
|
+
<li>Simplified API</li>
|
|
113
|
+
<li>Input and output on multiple devices concurrently</li>
|
|
114
|
+
<li>Generalized handling of different MIDI Message types (including SysEx)</li>
|
|
115
|
+
<li>Timestamped input events</li>
|
|
116
|
+
<li>Patch MIDI via software to other programs using IAC</li>
|
|
117
|
+
<li>No events history and no buffers optimization</li>
|
|
118
|
+
</ul>
|
|
119
|
+
|
|
120
|
+
<h2 id="requirements">Requirements</h2>
|
|
121
|
+
|
|
122
|
+
<ul>
|
|
123
|
+
<li><a href="http://github.com/ffi/ffi">ffi</a></li>
|
|
124
|
+
</ul>
|
|
125
|
+
|
|
126
|
+
<h2 id="installation">Installation</h2>
|
|
127
|
+
|
|
128
|
+
<p>If you're using Bundler, add this line to your application's Gemfile:</p>
|
|
129
|
+
|
|
130
|
+
<p><code>gem "midi-communications-macos"</code></p>
|
|
131
|
+
|
|
132
|
+
<p>Otherwise</p>
|
|
133
|
+
|
|
134
|
+
<p><code>gem install midi-communications-macos</code></p>
|
|
135
|
+
|
|
136
|
+
<h2 id="documentation">Documentation</h2>
|
|
137
|
+
|
|
138
|
+
<p>(<strong>TO DO</strong>) <a href="http://rubydoc.info/github/javier-sy/midi-communications-macos">rdoc</a></p>
|
|
139
|
+
|
|
140
|
+
<h2 id="differences-between-midi-communications-macos-layer-library-and-ffi-coremidi-library">Differences between <a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a> library and <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> library</h2>
|
|
141
|
+
|
|
142
|
+
<p><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a> is mostly a clone of <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> with some modifications:</p>
|
|
143
|
+
|
|
144
|
+
<ul>
|
|
145
|
+
<li>Added locking behaviour when waiting midi events</li>
|
|
146
|
+
<li>Removed buffering and process history information logging (to reduce CPU usage in some scenarios)</li>
|
|
147
|
+
<li>Improved MIDI devices name detection</li>
|
|
148
|
+
<li>Source updated to Ruby 2.7 code conventions (method keyword parameters instead of options = {}, hash keys as 'key:' instead of ':key =>', etc.)</li>
|
|
149
|
+
<li>Updated dependencies versions</li>
|
|
150
|
+
<li>Renamed module to MIDICommunicationsMacOS instead of CoreMIDI</li>
|
|
151
|
+
<li>Renamed gem to midi-communications-macos instead of ffi-coremidi</li>
|
|
152
|
+
<li>TODO: update tests to use rspec instead of rake</li>
|
|
153
|
+
<li>TODO: migrate to (or confirm it's working ok on) Ruby 3.0 and Ruby 3.1</li>
|
|
154
|
+
</ul>
|
|
155
|
+
|
|
156
|
+
<h2 id="then-why-does-exist-this-library-if-it-is-mostly-a-clone-of-another-library">Then, why does exist this library if it is mostly a clone of another library?</h2>
|
|
157
|
+
|
|
158
|
+
<p>The author has been developing since 2016 a Ruby project called
|
|
159
|
+
<a href="https://github.com/javier-sy/musa-dsl">Musa DSL</a> that needs a way
|
|
160
|
+
of representing MIDI Events and a way of communicating with
|
|
161
|
+
MIDI Instruments and MIDI Control Surfaces.</p>
|
|
162
|
+
|
|
163
|
+
<p><a href="https://github.com/arirusso">Ari Russo</a> has done a great job creating
|
|
164
|
+
several interdependent Ruby libraries that allow
|
|
165
|
+
MIDI Events representation (<a href="https://github.com/arirusso/midi-message">MIDI Message</a>
|
|
166
|
+
and <a href="https://github.com/arirusso/nibbler">Nibbler</a>)
|
|
167
|
+
and communication with MIDI Instruments and MIDI Control Surfaces
|
|
168
|
+
(<a href="https://github.com/arirusso/unimidi">unimidi</a>,
|
|
169
|
+
<a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> and others)
|
|
170
|
+
that, <strong>with some modifications</strong>, I've been using in MusaDSL.</p>
|
|
171
|
+
|
|
172
|
+
<p>After thinking about the best approach to publish MusaDSL
|
|
173
|
+
I've decided to publish my own renamed version of the modified dependencies because:</p>
|
|
174
|
+
|
|
175
|
+
<ul>
|
|
176
|
+
<li>The original libraries have features
|
|
177
|
+
(buffering, very detailed logging and processing history information, not locking behaviour when waiting input midi messages)
|
|
178
|
+
that are not needed in MusaDSL and, in fact,
|
|
179
|
+
can degrade the performance on some use cases in MusaDSL.</li>
|
|
180
|
+
<li>The requirements for <strong>Musa DSL</strong> users probably will evolve in time, so it will be easier to maintain an independent source code base.</li>
|
|
181
|
+
<li>Some differences on the approach of the modifications vs the original library doesn't allow to merge the modifications on the original libraries.</li>
|
|
182
|
+
<li>Then the renaming of the libraries is needed to avoid confusing existent users of the original libraries.</li>
|
|
183
|
+
<li>Due to some of the interdependencies of Ari Russo libraries,
|
|
184
|
+
the modification and renaming on some of the low level libraries (ffi-coremidi, etc.)
|
|
185
|
+
forces to modify and rename unimidi library.</li>
|
|
186
|
+
</ul>
|
|
187
|
+
|
|
188
|
+
<p>All in all I have decided to publish a suite of libraries optimized for MusaDSL use case that also can be used by other people in their projects.</p>
|
|
189
|
+
|
|
190
|
+
<table><thead>
|
|
191
|
+
<tr>
|
|
192
|
+
<th>Function</th>
|
|
193
|
+
<th>Library</th>
|
|
194
|
+
<th>Based on Ari Russo's</th>
|
|
195
|
+
<th>Difference</th>
|
|
196
|
+
</tr>
|
|
197
|
+
</thead><tbody>
|
|
198
|
+
<tr>
|
|
199
|
+
<td>MIDI Events representation</td>
|
|
200
|
+
<td><a href="https://github.com/javier-sy/midi-events">MIDI Events</a></td>
|
|
201
|
+
<td><a href="https://github.com/arirusso/midi-message">MIDI Message</a></td>
|
|
202
|
+
<td>removed parsing, small improvements</td>
|
|
203
|
+
</tr>
|
|
204
|
+
<tr>
|
|
205
|
+
<td>MIDI Data parsing</td>
|
|
206
|
+
<td><a href="https://github.com/javier-sy/midi-parser">MIDI Parser</a></td>
|
|
207
|
+
<td><a href="https://github.com/arirusso/nibbler">Nibbler</a></td>
|
|
208
|
+
<td>removed process history information, minor optimizations</td>
|
|
209
|
+
</tr>
|
|
210
|
+
<tr>
|
|
211
|
+
<td>MIDI communication with Instruments and Control Surfaces</td>
|
|
212
|
+
<td><a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a></td>
|
|
213
|
+
<td><a href="https://github.com/arirusso/unimidi">unimidi</a></td>
|
|
214
|
+
<td>use of <a href="https://github.com/javier-sy/midi-communications-macos,%20removed%20process%20history%20information,%20removed%20buffering,%20removed%20command%20line%20script">MIDI Communications MacOS Layer</a></td>
|
|
215
|
+
</tr>
|
|
216
|
+
<tr>
|
|
217
|
+
<td>Low level MIDI interface to MacOS</td>
|
|
218
|
+
<td><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a></td>
|
|
219
|
+
<td><a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a></td>
|
|
220
|
+
<td>removed buffering and process history information, locking behaviour when waiting midi events, improved midi devices name detection, minor optimizations</td>
|
|
221
|
+
</tr>
|
|
222
|
+
<tr>
|
|
223
|
+
<td>Low level MIDI interface to Linux</td>
|
|
224
|
+
<td><strong>TO DO</strong></td>
|
|
225
|
+
<td></td>
|
|
226
|
+
<td></td>
|
|
227
|
+
</tr>
|
|
228
|
+
<tr>
|
|
229
|
+
<td>Low level MIDI interface to JRuby</td>
|
|
230
|
+
<td><strong>TO DO</strong></td>
|
|
231
|
+
<td></td>
|
|
232
|
+
<td></td>
|
|
233
|
+
</tr>
|
|
234
|
+
<tr>
|
|
235
|
+
<td>Low level MIDI interface to Windows</td>
|
|
236
|
+
<td><strong>TO DO</strong></td>
|
|
237
|
+
<td></td>
|
|
238
|
+
<td></td>
|
|
239
|
+
</tr>
|
|
240
|
+
</tbody></table>
|
|
241
|
+
|
|
242
|
+
<h2 id="author">Author</h2>
|
|
243
|
+
|
|
244
|
+
<ul>
|
|
245
|
+
<li><a href="https://github.com/javier-sy">Javier Sánchez Yeste</a></li>
|
|
246
|
+
</ul>
|
|
247
|
+
|
|
248
|
+
<h2 id="acknowledgements">Acknowledgements</h2>
|
|
249
|
+
|
|
250
|
+
<p>Thanks to <a href="http://github.com/arirusso">Ari Russo</a> for his ruby library <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> licensed under Apache License 2.0.</p>
|
|
251
|
+
|
|
252
|
+
<p>As explained by <strong>Ari Russo</strong> regarding his library <strong>ffi-coremidi</strong>:</p>
|
|
253
|
+
|
|
254
|
+
<ul>
|
|
255
|
+
<li><strong>ffi-coremidi</strong> began with some coremidi/ffi binding code for MIDI output by <a href="http://github.com/aberant">Colin Harris</a> contained in <a href="http://github.com/aberant/midiator">his fork of MIDIator</a> and a <a href="http://aberant.tumblr.com/post/694878119/sending-midi-sysex-with-core-midi-and-ruby-ffi">blog post</a>.</li>
|
|
256
|
+
<li><a href="http://github.com/bleything/midiator">MIDIator</a> is (c)2008 by Ben Bleything and Topher Cyll and released under the MIT license (see LICENSE.midiator and LICENSE.prp)</li>
|
|
257
|
+
<li>Also thank you to <a href="http://github.com/jvoorhis">Jeremy Voorhis</a> for some useful debugging.</li>
|
|
258
|
+
</ul>
|
|
259
|
+
|
|
260
|
+
<h3 id="license">License</h3>
|
|
261
|
+
|
|
262
|
+
<p><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a> Copyright (c) 2021-2025 <a href="https://yeste.studio">Javier Sánchez Yeste</a>, licensed under LGPL 3.0 License</p>
|
|
263
|
+
|
|
264
|
+
<p><a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> Copyright (c) 2011-2017 <a href="http://arirusso.com">Ari Russo</a>, licensed under Apache License 2.0 (see the file LICENSE.ffi-coremidi)</p>
|
|
265
|
+
</div></div>
|
|
266
|
+
|
|
267
|
+
<div id="footer">
|
|
268
|
+
Generated on Tue Nov 25 11:37:07 2025 by
|
|
269
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
270
|
+
0.9.37 (ruby-3.4.7).
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
</div>
|
|
274
|
+
</body>
|
|
275
|
+
</html>
|
data/doc/file_list.html
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html >
|
|
3
|
+
<head>
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" />
|
|
8
|
+
|
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" />
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<title>File List</title>
|
|
19
|
+
<base id="base_target" target="_parent" />
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<div id="content">
|
|
23
|
+
<div class="fixed_header">
|
|
24
|
+
<h1 id="full_list_header">File List</h1>
|
|
25
|
+
<div id="full_list_nav">
|
|
26
|
+
|
|
27
|
+
<span><a target="_self" href="class_list.html">
|
|
28
|
+
Classes
|
|
29
|
+
</a></span>
|
|
30
|
+
|
|
31
|
+
<span><a target="_self" href="method_list.html">
|
|
32
|
+
Methods
|
|
33
|
+
</a></span>
|
|
34
|
+
|
|
35
|
+
<span><a target="_self" href="file_list.html">
|
|
36
|
+
Files
|
|
37
|
+
</a></span>
|
|
38
|
+
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div id="search">
|
|
42
|
+
<label for="search-class">Search:</label>
|
|
43
|
+
<input id="search-class" type="text" />
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<ul id="full_list" class="file">
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<li id="object_README" class="odd">
|
|
51
|
+
<div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
|
|
52
|
+
</li>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
</ul>
|
|
57
|
+
</div>
|
|
58
|
+
</body>
|
|
59
|
+
</html>
|
data/doc/frames.html
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>MIDI Communications macOS API</title>
|
|
6
|
+
</head>
|
|
7
|
+
<script type="text/javascript">
|
|
8
|
+
var mainUrl = 'index.html';
|
|
9
|
+
try {
|
|
10
|
+
var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
|
|
11
|
+
var name = match ? match[1] : mainUrl;
|
|
12
|
+
var url = new URL(name, location.href);
|
|
13
|
+
window.top.location.replace(url.origin === location.origin ? name : mainUrl);
|
|
14
|
+
} catch (e) {
|
|
15
|
+
window.top.location.replace(mainUrl);
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
<noscript>
|
|
19
|
+
<h1>Oops!</h1>
|
|
20
|
+
<h2>YARD requires JavaScript!</h2>
|
|
21
|
+
</noscript>
|
|
22
|
+
</html>
|
data/doc/index.html
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
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
|
+
File: README
|
|
8
|
+
|
|
9
|
+
— MIDI Communications macOS 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 = "README";
|
|
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 class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="_index.html">Index</a> »
|
|
40
|
+
<span class="title">File: README</span>
|
|
41
|
+
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div id="search">
|
|
45
|
+
|
|
46
|
+
<a class="full_list_link" id="class_list_link"
|
|
47
|
+
href="class_list.html">
|
|
48
|
+
|
|
49
|
+
<svg width="24" height="24">
|
|
50
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
51
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
52
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
</svg>
|
|
54
|
+
</a>
|
|
55
|
+
|
|
56
|
+
</div>
|
|
57
|
+
<div class="clear"></div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div id="content"><div id='filecontents'><h1 id="midi-communications-macos-layer">MIDI Communications MacOS Layer</h1>
|
|
61
|
+
|
|
62
|
+
<p><a href="https://www.ruby-lang.org/"><img src="https://img.shields.io/badge/ruby-2.7+-red.svg" alt="Ruby Version"></a>
|
|
63
|
+
<a href="https://www.gnu.org/licenses/lgpl-3.0.html"><img src="https://img.shields.io/badge/license-LGPL--3.0--or--later-blue.svg" alt="License"></a></p>
|
|
64
|
+
|
|
65
|
+
<p><strong>Realtime MIDI IO with Ruby for OSX.</strong></p>
|
|
66
|
+
|
|
67
|
+
<p>Access the <a href="https://developer.apple.com/library/mac/#documentation/MusicAudio/Reference/CACoreMIDIRef/MIDIServices/">Apple Core MIDI framework API</a> with Ruby.</p>
|
|
68
|
+
|
|
69
|
+
<p>This library is part of a suite of Ruby libraries for MIDI:</p>
|
|
70
|
+
|
|
71
|
+
<table><thead>
|
|
72
|
+
<tr>
|
|
73
|
+
<th>Function</th>
|
|
74
|
+
<th>Library</th>
|
|
75
|
+
</tr>
|
|
76
|
+
</thead><tbody>
|
|
77
|
+
<tr>
|
|
78
|
+
<td>MIDI Events representation</td>
|
|
79
|
+
<td><a href="https://github.com/javier-sy/midi-events">MIDI Events</a></td>
|
|
80
|
+
</tr>
|
|
81
|
+
<tr>
|
|
82
|
+
<td>MIDI Data parsing</td>
|
|
83
|
+
<td><a href="https://github.com/javier-sy/midi-parser">MIDI Parser</a></td>
|
|
84
|
+
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td>MIDI communication with Instruments and Control Surfaces</td>
|
|
87
|
+
<td><a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a></td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td>Low level MIDI interface to MacOS</td>
|
|
91
|
+
<td><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a></td>
|
|
92
|
+
</tr>
|
|
93
|
+
<tr>
|
|
94
|
+
<td>Low level MIDI interface to Linux</td>
|
|
95
|
+
<td><strong>TO DO</strong> (by now <a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a> uses <a href="http://github.com/arirusso/alsa-rawmidi">alsa-rawmidi</a>)</td>
|
|
96
|
+
</tr>
|
|
97
|
+
<tr>
|
|
98
|
+
<td>Low level MIDI interface to JRuby</td>
|
|
99
|
+
<td><strong>TO DO</strong> (by now <a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a> uses <a href="http://github.com/arirusso/midi-jruby">midi-jruby</a>)</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td>Low level MIDI interface to Windows</td>
|
|
103
|
+
<td><strong>TO DO</strong> (by now <a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a> uses <a href="http://github.com/arirusso/midi-winmm">midi-winm</a>)</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</tbody></table>
|
|
106
|
+
|
|
107
|
+
<p>This library is based on <a href="http://github.com/arirusso">Ari Russo's</a> library <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a>.</p>
|
|
108
|
+
|
|
109
|
+
<h2 id="features">Features</h2>
|
|
110
|
+
|
|
111
|
+
<ul>
|
|
112
|
+
<li>Simplified API</li>
|
|
113
|
+
<li>Input and output on multiple devices concurrently</li>
|
|
114
|
+
<li>Generalized handling of different MIDI Message types (including SysEx)</li>
|
|
115
|
+
<li>Timestamped input events</li>
|
|
116
|
+
<li>Patch MIDI via software to other programs using IAC</li>
|
|
117
|
+
<li>No events history and no buffers optimization</li>
|
|
118
|
+
</ul>
|
|
119
|
+
|
|
120
|
+
<h2 id="requirements">Requirements</h2>
|
|
121
|
+
|
|
122
|
+
<ul>
|
|
123
|
+
<li><a href="http://github.com/ffi/ffi">ffi</a></li>
|
|
124
|
+
</ul>
|
|
125
|
+
|
|
126
|
+
<h2 id="installation">Installation</h2>
|
|
127
|
+
|
|
128
|
+
<p>If you're using Bundler, add this line to your application's Gemfile:</p>
|
|
129
|
+
|
|
130
|
+
<p><code>gem "midi-communications-macos"</code></p>
|
|
131
|
+
|
|
132
|
+
<p>Otherwise</p>
|
|
133
|
+
|
|
134
|
+
<p><code>gem install midi-communications-macos</code></p>
|
|
135
|
+
|
|
136
|
+
<h2 id="documentation">Documentation</h2>
|
|
137
|
+
|
|
138
|
+
<p>(<strong>TO DO</strong>) <a href="http://rubydoc.info/github/javier-sy/midi-communications-macos">rdoc</a></p>
|
|
139
|
+
|
|
140
|
+
<h2 id="differences-between-midi-communications-macos-layer-library-and-ffi-coremidi-library">Differences between <a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a> library and <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> library</h2>
|
|
141
|
+
|
|
142
|
+
<p><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a> is mostly a clone of <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> with some modifications:</p>
|
|
143
|
+
|
|
144
|
+
<ul>
|
|
145
|
+
<li>Added locking behaviour when waiting midi events</li>
|
|
146
|
+
<li>Removed buffering and process history information logging (to reduce CPU usage in some scenarios)</li>
|
|
147
|
+
<li>Improved MIDI devices name detection</li>
|
|
148
|
+
<li>Source updated to Ruby 2.7 code conventions (method keyword parameters instead of options = {}, hash keys as 'key:' instead of ':key =>', etc.)</li>
|
|
149
|
+
<li>Updated dependencies versions</li>
|
|
150
|
+
<li>Renamed module to MIDICommunicationsMacOS instead of CoreMIDI</li>
|
|
151
|
+
<li>Renamed gem to midi-communications-macos instead of ffi-coremidi</li>
|
|
152
|
+
<li>TODO: update tests to use rspec instead of rake</li>
|
|
153
|
+
<li>TODO: migrate to (or confirm it's working ok on) Ruby 3.0 and Ruby 3.1</li>
|
|
154
|
+
</ul>
|
|
155
|
+
|
|
156
|
+
<h2 id="then-why-does-exist-this-library-if-it-is-mostly-a-clone-of-another-library">Then, why does exist this library if it is mostly a clone of another library?</h2>
|
|
157
|
+
|
|
158
|
+
<p>The author has been developing since 2016 a Ruby project called
|
|
159
|
+
<a href="https://github.com/javier-sy/musa-dsl">Musa DSL</a> that needs a way
|
|
160
|
+
of representing MIDI Events and a way of communicating with
|
|
161
|
+
MIDI Instruments and MIDI Control Surfaces.</p>
|
|
162
|
+
|
|
163
|
+
<p><a href="https://github.com/arirusso">Ari Russo</a> has done a great job creating
|
|
164
|
+
several interdependent Ruby libraries that allow
|
|
165
|
+
MIDI Events representation (<a href="https://github.com/arirusso/midi-message">MIDI Message</a>
|
|
166
|
+
and <a href="https://github.com/arirusso/nibbler">Nibbler</a>)
|
|
167
|
+
and communication with MIDI Instruments and MIDI Control Surfaces
|
|
168
|
+
(<a href="https://github.com/arirusso/unimidi">unimidi</a>,
|
|
169
|
+
<a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> and others)
|
|
170
|
+
that, <strong>with some modifications</strong>, I've been using in MusaDSL.</p>
|
|
171
|
+
|
|
172
|
+
<p>After thinking about the best approach to publish MusaDSL
|
|
173
|
+
I've decided to publish my own renamed version of the modified dependencies because:</p>
|
|
174
|
+
|
|
175
|
+
<ul>
|
|
176
|
+
<li>The original libraries have features
|
|
177
|
+
(buffering, very detailed logging and processing history information, not locking behaviour when waiting input midi messages)
|
|
178
|
+
that are not needed in MusaDSL and, in fact,
|
|
179
|
+
can degrade the performance on some use cases in MusaDSL.</li>
|
|
180
|
+
<li>The requirements for <strong>Musa DSL</strong> users probably will evolve in time, so it will be easier to maintain an independent source code base.</li>
|
|
181
|
+
<li>Some differences on the approach of the modifications vs the original library doesn't allow to merge the modifications on the original libraries.</li>
|
|
182
|
+
<li>Then the renaming of the libraries is needed to avoid confusing existent users of the original libraries.</li>
|
|
183
|
+
<li>Due to some of the interdependencies of Ari Russo libraries,
|
|
184
|
+
the modification and renaming on some of the low level libraries (ffi-coremidi, etc.)
|
|
185
|
+
forces to modify and rename unimidi library.</li>
|
|
186
|
+
</ul>
|
|
187
|
+
|
|
188
|
+
<p>All in all I have decided to publish a suite of libraries optimized for MusaDSL use case that also can be used by other people in their projects.</p>
|
|
189
|
+
|
|
190
|
+
<table><thead>
|
|
191
|
+
<tr>
|
|
192
|
+
<th>Function</th>
|
|
193
|
+
<th>Library</th>
|
|
194
|
+
<th>Based on Ari Russo's</th>
|
|
195
|
+
<th>Difference</th>
|
|
196
|
+
</tr>
|
|
197
|
+
</thead><tbody>
|
|
198
|
+
<tr>
|
|
199
|
+
<td>MIDI Events representation</td>
|
|
200
|
+
<td><a href="https://github.com/javier-sy/midi-events">MIDI Events</a></td>
|
|
201
|
+
<td><a href="https://github.com/arirusso/midi-message">MIDI Message</a></td>
|
|
202
|
+
<td>removed parsing, small improvements</td>
|
|
203
|
+
</tr>
|
|
204
|
+
<tr>
|
|
205
|
+
<td>MIDI Data parsing</td>
|
|
206
|
+
<td><a href="https://github.com/javier-sy/midi-parser">MIDI Parser</a></td>
|
|
207
|
+
<td><a href="https://github.com/arirusso/nibbler">Nibbler</a></td>
|
|
208
|
+
<td>removed process history information, minor optimizations</td>
|
|
209
|
+
</tr>
|
|
210
|
+
<tr>
|
|
211
|
+
<td>MIDI communication with Instruments and Control Surfaces</td>
|
|
212
|
+
<td><a href="https://github.com/javier-sy/midi-communications">MIDI Communications</a></td>
|
|
213
|
+
<td><a href="https://github.com/arirusso/unimidi">unimidi</a></td>
|
|
214
|
+
<td>use of <a href="https://github.com/javier-sy/midi-communications-macos,%20removed%20process%20history%20information,%20removed%20buffering,%20removed%20command%20line%20script">MIDI Communications MacOS Layer</a></td>
|
|
215
|
+
</tr>
|
|
216
|
+
<tr>
|
|
217
|
+
<td>Low level MIDI interface to MacOS</td>
|
|
218
|
+
<td><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a></td>
|
|
219
|
+
<td><a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a></td>
|
|
220
|
+
<td>removed buffering and process history information, locking behaviour when waiting midi events, improved midi devices name detection, minor optimizations</td>
|
|
221
|
+
</tr>
|
|
222
|
+
<tr>
|
|
223
|
+
<td>Low level MIDI interface to Linux</td>
|
|
224
|
+
<td><strong>TO DO</strong></td>
|
|
225
|
+
<td></td>
|
|
226
|
+
<td></td>
|
|
227
|
+
</tr>
|
|
228
|
+
<tr>
|
|
229
|
+
<td>Low level MIDI interface to JRuby</td>
|
|
230
|
+
<td><strong>TO DO</strong></td>
|
|
231
|
+
<td></td>
|
|
232
|
+
<td></td>
|
|
233
|
+
</tr>
|
|
234
|
+
<tr>
|
|
235
|
+
<td>Low level MIDI interface to Windows</td>
|
|
236
|
+
<td><strong>TO DO</strong></td>
|
|
237
|
+
<td></td>
|
|
238
|
+
<td></td>
|
|
239
|
+
</tr>
|
|
240
|
+
</tbody></table>
|
|
241
|
+
|
|
242
|
+
<h2 id="author">Author</h2>
|
|
243
|
+
|
|
244
|
+
<ul>
|
|
245
|
+
<li><a href="https://github.com/javier-sy">Javier Sánchez Yeste</a></li>
|
|
246
|
+
</ul>
|
|
247
|
+
|
|
248
|
+
<h2 id="acknowledgements">Acknowledgements</h2>
|
|
249
|
+
|
|
250
|
+
<p>Thanks to <a href="http://github.com/arirusso">Ari Russo</a> for his ruby library <a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> licensed under Apache License 2.0.</p>
|
|
251
|
+
|
|
252
|
+
<p>As explained by <strong>Ari Russo</strong> regarding his library <strong>ffi-coremidi</strong>:</p>
|
|
253
|
+
|
|
254
|
+
<ul>
|
|
255
|
+
<li><strong>ffi-coremidi</strong> began with some coremidi/ffi binding code for MIDI output by <a href="http://github.com/aberant">Colin Harris</a> contained in <a href="http://github.com/aberant/midiator">his fork of MIDIator</a> and a <a href="http://aberant.tumblr.com/post/694878119/sending-midi-sysex-with-core-midi-and-ruby-ffi">blog post</a>.</li>
|
|
256
|
+
<li><a href="http://github.com/bleything/midiator">MIDIator</a> is (c)2008 by Ben Bleything and Topher Cyll and released under the MIT license (see LICENSE.midiator and LICENSE.prp)</li>
|
|
257
|
+
<li>Also thank you to <a href="http://github.com/jvoorhis">Jeremy Voorhis</a> for some useful debugging.</li>
|
|
258
|
+
</ul>
|
|
259
|
+
|
|
260
|
+
<h3 id="license">License</h3>
|
|
261
|
+
|
|
262
|
+
<p><a href="https://github.com/javier-sy/midi-communications-macos">MIDI Communications MacOS Layer</a> Copyright (c) 2021-2025 <a href="https://yeste.studio">Javier Sánchez Yeste</a>, licensed under LGPL 3.0 License</p>
|
|
263
|
+
|
|
264
|
+
<p><a href="https://github.com/arirusso/ffi-coremidi">ffi-coremidi</a> Copyright (c) 2011-2017 <a href="http://arirusso.com">Ari Russo</a>, licensed under Apache License 2.0 (see the file LICENSE.ffi-coremidi)</p>
|
|
265
|
+
</div></div>
|
|
266
|
+
|
|
267
|
+
<div id="footer">
|
|
268
|
+
Generated on Tue Nov 25 11:37:07 2025 by
|
|
269
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
270
|
+
0.9.37 (ruby-3.4.7).
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
</div>
|
|
274
|
+
</body>
|
|
275
|
+
</html>
|