midilib 2.0.2 → 2.0.4
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.
- data/Credits +5 -0
- data/README.rdoc +35 -30
- data/examples/reader2text.rb +1 -0
- data/html/IO.html +259 -0
- data/html/MIDI.html +665 -0
- data/html/MIDI/ActiveSense.html +295 -0
- data/html/MIDI/ChannelEvent.html +319 -0
- data/html/MIDI/ChannelPressure.html +350 -0
- data/html/MIDI/Clock.html +295 -0
- data/html/MIDI/Continue.html +295 -0
- data/html/MIDI/Controller.html +365 -0
- data/html/MIDI/Event.html +573 -0
- data/html/MIDI/IO.html +207 -0
- data/html/MIDI/IO/MIDIFile.html +1996 -0
- data/html/MIDI/IO/SeqReader.html +946 -0
- data/html/MIDI/IO/SeqWriter.html +648 -0
- data/html/MIDI/KeySig.html +435 -0
- data/html/MIDI/MIDI.html +204 -0
- data/html/MIDI/MIDI/MIDI.html +204 -0
- data/html/MIDI/MIDI/MIDI/Array.html +353 -0
- data/html/MIDI/Marker.html +257 -0
- data/html/MIDI/Measure.html +423 -0
- data/html/MIDI/Measures.html +375 -0
- data/html/MIDI/MetaEvent.html +534 -0
- data/html/MIDI/NoteEvent.html +417 -0
- data/html/MIDI/NoteOff.html +316 -0
- data/html/MIDI/NoteOn.html +316 -0
- data/html/MIDI/PitchBend.html +351 -0
- data/html/MIDI/PolyPressure.html +360 -0
- data/html/MIDI/ProgramChange.html +350 -0
- data/html/MIDI/Realtime.html +328 -0
- data/html/MIDI/Sequence.html +961 -0
- data/html/MIDI/SongPointer.html +351 -0
- data/html/MIDI/SongSelect.html +350 -0
- data/html/MIDI/Start.html +295 -0
- data/html/MIDI/Stop.html +295 -0
- data/html/MIDI/SystemCommon.html +257 -0
- data/html/MIDI/SystemExclusive.html +353 -0
- data/html/MIDI/SystemReset.html +295 -0
- data/html/MIDI/Tempo.html +474 -0
- data/html/MIDI/TimeSig.html +467 -0
- data/html/MIDI/Track.html +769 -0
- data/html/MIDI/TuneRequest.html +328 -0
- data/html/MIDI/Utils.html +320 -0
- data/html/README_rdoc.html +751 -0
- data/html/TODO_rdoc.html +200 -0
- data/html/created.rid +14 -0
- data/html/images/add.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +750 -0
- data/html/js/darkfish.js +153 -0
- data/html/js/jquery.js +18 -0
- data/html/js/navigation.js +142 -0
- data/html/js/search.js +94 -0
- data/html/js/search_index.js +1 -0
- data/html/js/searcher.js +228 -0
- data/html/rdoc.css +543 -0
- data/html/table_of_contents.html +652 -0
- data/lib/midilib/info.rb +1 -1
- data/lib/midilib/io/seqreader.rb +1 -1
- data/lib/midilib/sequence.rb +7 -0
- data/test/test_sequence.rb +11 -0
- metadata +80 -3
@@ -0,0 +1,328 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class MIDI::TuneRequest - midilib</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/midilib/event.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="SystemCommon.html">MIDI::SystemCommon</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-data_as_bytes">#data_as_bytes</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-to_s">#to_s</a>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<div id="project-metadata">
|
85
|
+
<nav id="fileindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Pages</h3>
|
87
|
+
|
88
|
+
<ul>
|
89
|
+
|
90
|
+
<li class="file"><a href="../README_rdoc.html">README</a>
|
91
|
+
|
92
|
+
<li class="file"><a href="../TODO_rdoc.html">TODO</a>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</nav>
|
96
|
+
|
97
|
+
<nav id="classindex-section" class="section project-section">
|
98
|
+
<h3 class="section-header">Class and Module Index</h3>
|
99
|
+
|
100
|
+
<ul class="link-list">
|
101
|
+
|
102
|
+
<li><a href="../MIDI.html">MIDI</a>
|
103
|
+
|
104
|
+
<li><a href="../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
|
105
|
+
|
106
|
+
<li><a href="../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
|
107
|
+
|
108
|
+
<li><a href="../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
|
109
|
+
|
110
|
+
<li><a href="../MIDI/Clock.html">MIDI::Clock</a>
|
111
|
+
|
112
|
+
<li><a href="../MIDI/Continue.html">MIDI::Continue</a>
|
113
|
+
|
114
|
+
<li><a href="../MIDI/Controller.html">MIDI::Controller</a>
|
115
|
+
|
116
|
+
<li><a href="../MIDI/Event.html">MIDI::Event</a>
|
117
|
+
|
118
|
+
<li><a href="../MIDI/IO.html">MIDI::IO</a>
|
119
|
+
|
120
|
+
<li><a href="../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
|
121
|
+
|
122
|
+
<li><a href="../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
|
123
|
+
|
124
|
+
<li><a href="../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
|
125
|
+
|
126
|
+
<li><a href="../MIDI/KeySig.html">MIDI::KeySig</a>
|
127
|
+
|
128
|
+
<li><a href="../MIDI/MIDI.html">MIDI::MIDI</a>
|
129
|
+
|
130
|
+
<li><a href="../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
|
131
|
+
|
132
|
+
<li><a href="../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
|
133
|
+
|
134
|
+
<li><a href="../MIDI/Marker.html">MIDI::Marker</a>
|
135
|
+
|
136
|
+
<li><a href="../MIDI/Measure.html">MIDI::Measure</a>
|
137
|
+
|
138
|
+
<li><a href="../MIDI/Measures.html">MIDI::Measures</a>
|
139
|
+
|
140
|
+
<li><a href="../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
|
141
|
+
|
142
|
+
<li><a href="../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
|
143
|
+
|
144
|
+
<li><a href="../MIDI/NoteOff.html">MIDI::NoteOff</a>
|
145
|
+
|
146
|
+
<li><a href="../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
|
147
|
+
|
148
|
+
<li><a href="../MIDI/NoteOn.html">MIDI::NoteOn</a>
|
149
|
+
|
150
|
+
<li><a href="../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
|
151
|
+
|
152
|
+
<li><a href="../MIDI/PitchBend.html">MIDI::PitchBend</a>
|
153
|
+
|
154
|
+
<li><a href="../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
|
155
|
+
|
156
|
+
<li><a href="../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
|
157
|
+
|
158
|
+
<li><a href="../MIDI/Realtime.html">MIDI::Realtime</a>
|
159
|
+
|
160
|
+
<li><a href="../MIDI/Sequence.html">MIDI::Sequence</a>
|
161
|
+
|
162
|
+
<li><a href="../MIDI/SongPointer.html">MIDI::SongPointer</a>
|
163
|
+
|
164
|
+
<li><a href="../MIDI/SongSelect.html">MIDI::SongSelect</a>
|
165
|
+
|
166
|
+
<li><a href="../MIDI/Start.html">MIDI::Start</a>
|
167
|
+
|
168
|
+
<li><a href="../MIDI/Stop.html">MIDI::Stop</a>
|
169
|
+
|
170
|
+
<li><a href="../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
|
171
|
+
|
172
|
+
<li><a href="../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
|
173
|
+
|
174
|
+
<li><a href="../MIDI/SystemReset.html">MIDI::SystemReset</a>
|
175
|
+
|
176
|
+
<li><a href="../MIDI/Tempo.html">MIDI::Tempo</a>
|
177
|
+
|
178
|
+
<li><a href="../MIDI/TimeSig.html">MIDI::TimeSig</a>
|
179
|
+
|
180
|
+
<li><a href="../MIDI/Track.html">MIDI::Track</a>
|
181
|
+
|
182
|
+
<li><a href="../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
|
183
|
+
|
184
|
+
<li><a href="../MIDI/Utils.html">MIDI::Utils</a>
|
185
|
+
|
186
|
+
<li><a href="../IO.html">IO</a>
|
187
|
+
|
188
|
+
</ul>
|
189
|
+
</nav>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
</nav>
|
193
|
+
|
194
|
+
<div id="documentation">
|
195
|
+
<h1 class="class">class MIDI::TuneRequest</h1>
|
196
|
+
|
197
|
+
<div id="description" class="description">
|
198
|
+
|
199
|
+
</div><!-- description -->
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<!-- Methods -->
|
214
|
+
|
215
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
216
|
+
<h3 class="section-header">Public Class Methods</h3>
|
217
|
+
|
218
|
+
|
219
|
+
<div id="method-c-new" class="method-detail ">
|
220
|
+
|
221
|
+
<div class="method-heading">
|
222
|
+
<span class="method-name">new</span><span
|
223
|
+
class="method-args">(delta_time = 0)</span>
|
224
|
+
<span class="method-click-advice">click to toggle source</span>
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
<div class="method-description">
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<div class="method-source-code" id="new-source">
|
235
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 327</span>
|
236
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
|
237
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-constant">TUNE_REQUEST</span>, <span class="ruby-identifier">delta_time</span>)
|
238
|
+
<span class="ruby-keyword">end</span></pre>
|
239
|
+
</div><!-- new-source -->
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
</div><!-- new-method -->
|
247
|
+
|
248
|
+
|
249
|
+
</section><!-- public-class-method-details -->
|
250
|
+
|
251
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
252
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
253
|
+
|
254
|
+
|
255
|
+
<div id="method-i-data_as_bytes" class="method-detail ">
|
256
|
+
|
257
|
+
<div class="method-heading">
|
258
|
+
<span class="method-name">data_as_bytes</span><span
|
259
|
+
class="method-args">()</span>
|
260
|
+
<span class="method-click-advice">click to toggle source</span>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
|
264
|
+
<div class="method-description">
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<div class="method-source-code" id="data_as_bytes-source">
|
271
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 331</span>
|
272
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_bytes</span>
|
273
|
+
<span class="ruby-identifier">data</span> = []
|
274
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@status</span>
|
275
|
+
<span class="ruby-keyword">end</span></pre>
|
276
|
+
</div><!-- data_as_bytes-source -->
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
</div><!-- data_as_bytes-method -->
|
284
|
+
|
285
|
+
|
286
|
+
<div id="method-i-to_s" class="method-detail ">
|
287
|
+
|
288
|
+
<div class="method-heading">
|
289
|
+
<span class="method-name">to_s</span><span
|
290
|
+
class="method-args">()</span>
|
291
|
+
<span class="method-click-advice">click to toggle source</span>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
|
295
|
+
<div class="method-description">
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
<div class="method-source-code" id="to_s-source">
|
302
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 336</span>
|
303
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
304
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">super</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"tune req"</span>
|
305
|
+
<span class="ruby-keyword">end</span></pre>
|
306
|
+
</div><!-- to_s-source -->
|
307
|
+
|
308
|
+
</div>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
</div><!-- to_s-method -->
|
314
|
+
|
315
|
+
|
316
|
+
</section><!-- public-instance-method-details -->
|
317
|
+
|
318
|
+
</section><!-- 5Buntitled-5D -->
|
319
|
+
|
320
|
+
</div><!-- documentation -->
|
321
|
+
|
322
|
+
|
323
|
+
<footer id="validator-badges">
|
324
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
325
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
326
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
327
|
+
</footer>
|
328
|
+
|
@@ -0,0 +1,320 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class MIDI::Utils - midilib</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/midilib/utils.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Object
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-as_var_len">::as_var_len</a>
|
74
|
+
|
75
|
+
<li><a href="#method-c-note_to_s">::note_to_s</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</nav>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div id="project-metadata">
|
83
|
+
<nav id="fileindex-section" class="section project-section">
|
84
|
+
<h3 class="section-header">Pages</h3>
|
85
|
+
|
86
|
+
<ul>
|
87
|
+
|
88
|
+
<li class="file"><a href="../README_rdoc.html">README</a>
|
89
|
+
|
90
|
+
<li class="file"><a href="../TODO_rdoc.html">TODO</a>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</nav>
|
94
|
+
|
95
|
+
<nav id="classindex-section" class="section project-section">
|
96
|
+
<h3 class="section-header">Class and Module Index</h3>
|
97
|
+
|
98
|
+
<ul class="link-list">
|
99
|
+
|
100
|
+
<li><a href="../MIDI.html">MIDI</a>
|
101
|
+
|
102
|
+
<li><a href="../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
|
103
|
+
|
104
|
+
<li><a href="../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
|
105
|
+
|
106
|
+
<li><a href="../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
|
107
|
+
|
108
|
+
<li><a href="../MIDI/Clock.html">MIDI::Clock</a>
|
109
|
+
|
110
|
+
<li><a href="../MIDI/Continue.html">MIDI::Continue</a>
|
111
|
+
|
112
|
+
<li><a href="../MIDI/Controller.html">MIDI::Controller</a>
|
113
|
+
|
114
|
+
<li><a href="../MIDI/Event.html">MIDI::Event</a>
|
115
|
+
|
116
|
+
<li><a href="../MIDI/IO.html">MIDI::IO</a>
|
117
|
+
|
118
|
+
<li><a href="../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
|
119
|
+
|
120
|
+
<li><a href="../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
|
121
|
+
|
122
|
+
<li><a href="../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
|
123
|
+
|
124
|
+
<li><a href="../MIDI/KeySig.html">MIDI::KeySig</a>
|
125
|
+
|
126
|
+
<li><a href="../MIDI/MIDI.html">MIDI::MIDI</a>
|
127
|
+
|
128
|
+
<li><a href="../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
|
129
|
+
|
130
|
+
<li><a href="../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
|
131
|
+
|
132
|
+
<li><a href="../MIDI/Marker.html">MIDI::Marker</a>
|
133
|
+
|
134
|
+
<li><a href="../MIDI/Measure.html">MIDI::Measure</a>
|
135
|
+
|
136
|
+
<li><a href="../MIDI/Measures.html">MIDI::Measures</a>
|
137
|
+
|
138
|
+
<li><a href="../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
|
139
|
+
|
140
|
+
<li><a href="../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
|
141
|
+
|
142
|
+
<li><a href="../MIDI/NoteOff.html">MIDI::NoteOff</a>
|
143
|
+
|
144
|
+
<li><a href="../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
|
145
|
+
|
146
|
+
<li><a href="../MIDI/NoteOn.html">MIDI::NoteOn</a>
|
147
|
+
|
148
|
+
<li><a href="../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
|
149
|
+
|
150
|
+
<li><a href="../MIDI/PitchBend.html">MIDI::PitchBend</a>
|
151
|
+
|
152
|
+
<li><a href="../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
|
153
|
+
|
154
|
+
<li><a href="../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
|
155
|
+
|
156
|
+
<li><a href="../MIDI/Realtime.html">MIDI::Realtime</a>
|
157
|
+
|
158
|
+
<li><a href="../MIDI/Sequence.html">MIDI::Sequence</a>
|
159
|
+
|
160
|
+
<li><a href="../MIDI/SongPointer.html">MIDI::SongPointer</a>
|
161
|
+
|
162
|
+
<li><a href="../MIDI/SongSelect.html">MIDI::SongSelect</a>
|
163
|
+
|
164
|
+
<li><a href="../MIDI/Start.html">MIDI::Start</a>
|
165
|
+
|
166
|
+
<li><a href="../MIDI/Stop.html">MIDI::Stop</a>
|
167
|
+
|
168
|
+
<li><a href="../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
|
169
|
+
|
170
|
+
<li><a href="../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
|
171
|
+
|
172
|
+
<li><a href="../MIDI/SystemReset.html">MIDI::SystemReset</a>
|
173
|
+
|
174
|
+
<li><a href="../MIDI/Tempo.html">MIDI::Tempo</a>
|
175
|
+
|
176
|
+
<li><a href="../MIDI/TimeSig.html">MIDI::TimeSig</a>
|
177
|
+
|
178
|
+
<li><a href="../MIDI/Track.html">MIDI::Track</a>
|
179
|
+
|
180
|
+
<li><a href="../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
|
181
|
+
|
182
|
+
<li><a href="../MIDI/Utils.html">MIDI::Utils</a>
|
183
|
+
|
184
|
+
<li><a href="../IO.html">IO</a>
|
185
|
+
|
186
|
+
</ul>
|
187
|
+
</nav>
|
188
|
+
|
189
|
+
</div>
|
190
|
+
</nav>
|
191
|
+
|
192
|
+
<div id="documentation">
|
193
|
+
<h1 class="class">class MIDI::Utils</h1>
|
194
|
+
|
195
|
+
<div id="description" class="description">
|
196
|
+
|
197
|
+
<p>Utility methods.</p>
|
198
|
+
|
199
|
+
</div><!-- description -->
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<!-- Constants -->
|
211
|
+
<section id="constants-list" class="section">
|
212
|
+
<h3 class="section-header">Constants</h3>
|
213
|
+
<dl>
|
214
|
+
|
215
|
+
<dt id="NOTE_NAMES">NOTE_NAMES
|
216
|
+
|
217
|
+
<dd class="description"><p><a href="MIDI.html">MIDI</a> note names. <a href="http://0">NOTE_NAMES</a>
|
218
|
+
is 'C', <a href="http://1">NOTE_NAMES</a> is 'C#', etc.</p>
|
219
|
+
|
220
|
+
|
221
|
+
</dl>
|
222
|
+
</section>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<!-- Methods -->
|
228
|
+
|
229
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
230
|
+
<h3 class="section-header">Public Class Methods</h3>
|
231
|
+
|
232
|
+
|
233
|
+
<div id="method-c-as_var_len" class="method-detail ">
|
234
|
+
|
235
|
+
<div class="method-heading">
|
236
|
+
<span class="method-name">as_var_len</span><span
|
237
|
+
class="method-args">(val)</span>
|
238
|
+
<span class="method-click-advice">click to toggle source</span>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
|
242
|
+
<div class="method-description">
|
243
|
+
|
244
|
+
<p>Given an integer, returns it as a variable length array of bytes (the
|
245
|
+
format used by <a href="MIDI.html">MIDI</a> files).</p>
|
246
|
+
|
247
|
+
<p>The converse operation--converting a var len into a number--requires input
|
248
|
+
from a stream of bytes. Therefore we don't supply it here. That is a part
|
249
|
+
of the MIDIFile class.</p>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
<div class="method-source-code" id="as_var_len-source">
|
254
|
+
<pre><span class="ruby-comment"># File lib/midilib/utils.rb, line 24</span>
|
255
|
+
<span class="ruby-keyword">def</span> <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">as_var_len</span>(<span class="ruby-identifier">val</span>)
|
256
|
+
<span class="ruby-identifier">buffer</span> = []
|
257
|
+
<span class="ruby-identifier">buffer</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">val</span> & <span class="ruby-value">0x7f</span>)
|
258
|
+
<span class="ruby-identifier">val</span> = (<span class="ruby-identifier">val</span> <span class="ruby-operator">>></span> <span class="ruby-value">7</span>)
|
259
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
260
|
+
<span class="ruby-identifier">buffer</span> <span class="ruby-operator"><<</span> (<span class="ruby-value">0x80</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">val</span> & <span class="ruby-value">0x7f</span>))
|
261
|
+
<span class="ruby-identifier">val</span> = (<span class="ruby-identifier">val</span> <span class="ruby-operator">>></span> <span class="ruby-value">7</span>)
|
262
|
+
<span class="ruby-keyword">end</span>
|
263
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">reverse!</span>
|
264
|
+
<span class="ruby-keyword">end</span></pre>
|
265
|
+
</div><!-- as_var_len-source -->
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
</div><!-- as_var_len-method -->
|
273
|
+
|
274
|
+
|
275
|
+
<div id="method-c-note_to_s" class="method-detail ">
|
276
|
+
|
277
|
+
<div class="method-heading">
|
278
|
+
<span class="method-name">note_to_s</span><span
|
279
|
+
class="method-args">(num)</span>
|
280
|
+
<span class="method-click-advice">click to toggle source</span>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
|
284
|
+
<div class="method-description">
|
285
|
+
|
286
|
+
<p>Given a <a href="MIDI.html">MIDI</a> note number, return the name and
|
287
|
+
octave as a string.</p>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
<div class="method-source-code" id="note_to_s-source">
|
292
|
+
<pre><span class="ruby-comment"># File lib/midilib/utils.rb, line 12</span>
|
293
|
+
<span class="ruby-keyword">def</span> <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">note_to_s</span>(<span class="ruby-identifier">num</span>)
|
294
|
+
<span class="ruby-identifier">note</span> = <span class="ruby-identifier">num</span> <span class="ruby-operator">%</span> <span class="ruby-value">12</span>
|
295
|
+
<span class="ruby-identifier">octave</span> = <span class="ruby-identifier">num</span> <span class="ruby-operator">/</span> <span class="ruby-value">12</span>
|
296
|
+
<span class="ruby-keyword">return</span> <span class="ruby-node">"#{NOTE_NAMES[note]}#{octave - 1}"</span>
|
297
|
+
<span class="ruby-keyword">end</span></pre>
|
298
|
+
</div><!-- note_to_s-source -->
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
</div><!-- note_to_s-method -->
|
306
|
+
|
307
|
+
|
308
|
+
</section><!-- public-class-method-details -->
|
309
|
+
|
310
|
+
</section><!-- 5Buntitled-5D -->
|
311
|
+
|
312
|
+
</div><!-- documentation -->
|
313
|
+
|
314
|
+
|
315
|
+
<footer id="validator-badges">
|
316
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
317
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
318
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
319
|
+
</footer>
|
320
|
+
|