midilib 2.0.2 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/Credits +5 -0
  2. data/README.rdoc +35 -30
  3. data/examples/reader2text.rb +1 -0
  4. data/html/IO.html +259 -0
  5. data/html/MIDI.html +665 -0
  6. data/html/MIDI/ActiveSense.html +295 -0
  7. data/html/MIDI/ChannelEvent.html +319 -0
  8. data/html/MIDI/ChannelPressure.html +350 -0
  9. data/html/MIDI/Clock.html +295 -0
  10. data/html/MIDI/Continue.html +295 -0
  11. data/html/MIDI/Controller.html +365 -0
  12. data/html/MIDI/Event.html +573 -0
  13. data/html/MIDI/IO.html +207 -0
  14. data/html/MIDI/IO/MIDIFile.html +1996 -0
  15. data/html/MIDI/IO/SeqReader.html +946 -0
  16. data/html/MIDI/IO/SeqWriter.html +648 -0
  17. data/html/MIDI/KeySig.html +435 -0
  18. data/html/MIDI/MIDI.html +204 -0
  19. data/html/MIDI/MIDI/MIDI.html +204 -0
  20. data/html/MIDI/MIDI/MIDI/Array.html +353 -0
  21. data/html/MIDI/Marker.html +257 -0
  22. data/html/MIDI/Measure.html +423 -0
  23. data/html/MIDI/Measures.html +375 -0
  24. data/html/MIDI/MetaEvent.html +534 -0
  25. data/html/MIDI/NoteEvent.html +417 -0
  26. data/html/MIDI/NoteOff.html +316 -0
  27. data/html/MIDI/NoteOn.html +316 -0
  28. data/html/MIDI/PitchBend.html +351 -0
  29. data/html/MIDI/PolyPressure.html +360 -0
  30. data/html/MIDI/ProgramChange.html +350 -0
  31. data/html/MIDI/Realtime.html +328 -0
  32. data/html/MIDI/Sequence.html +961 -0
  33. data/html/MIDI/SongPointer.html +351 -0
  34. data/html/MIDI/SongSelect.html +350 -0
  35. data/html/MIDI/Start.html +295 -0
  36. data/html/MIDI/Stop.html +295 -0
  37. data/html/MIDI/SystemCommon.html +257 -0
  38. data/html/MIDI/SystemExclusive.html +353 -0
  39. data/html/MIDI/SystemReset.html +295 -0
  40. data/html/MIDI/Tempo.html +474 -0
  41. data/html/MIDI/TimeSig.html +467 -0
  42. data/html/MIDI/Track.html +769 -0
  43. data/html/MIDI/TuneRequest.html +328 -0
  44. data/html/MIDI/Utils.html +320 -0
  45. data/html/README_rdoc.html +751 -0
  46. data/html/TODO_rdoc.html +200 -0
  47. data/html/created.rid +14 -0
  48. data/html/images/add.png +0 -0
  49. data/html/images/brick.png +0 -0
  50. data/html/images/brick_link.png +0 -0
  51. data/html/images/bug.png +0 -0
  52. data/html/images/bullet_black.png +0 -0
  53. data/html/images/bullet_toggle_minus.png +0 -0
  54. data/html/images/bullet_toggle_plus.png +0 -0
  55. data/html/images/date.png +0 -0
  56. data/html/images/delete.png +0 -0
  57. data/html/images/find.png +0 -0
  58. data/html/images/loadingAnimation.gif +0 -0
  59. data/html/images/macFFBgHack.png +0 -0
  60. data/html/images/package.png +0 -0
  61. data/html/images/page_green.png +0 -0
  62. data/html/images/page_white_text.png +0 -0
  63. data/html/images/page_white_width.png +0 -0
  64. data/html/images/plugin.png +0 -0
  65. data/html/images/ruby.png +0 -0
  66. data/html/images/tag_blue.png +0 -0
  67. data/html/images/tag_green.png +0 -0
  68. data/html/images/transparent.png +0 -0
  69. data/html/images/wrench.png +0 -0
  70. data/html/images/wrench_orange.png +0 -0
  71. data/html/images/zoom.png +0 -0
  72. data/html/index.html +750 -0
  73. data/html/js/darkfish.js +153 -0
  74. data/html/js/jquery.js +18 -0
  75. data/html/js/navigation.js +142 -0
  76. data/html/js/search.js +94 -0
  77. data/html/js/search_index.js +1 -0
  78. data/html/js/searcher.js +228 -0
  79. data/html/rdoc.css +543 -0
  80. data/html/table_of_contents.html +652 -0
  81. data/lib/midilib/info.rb +1 -1
  82. data/lib/midilib/io/seqreader.rb +1 -1
  83. data/lib/midilib/sequence.rb +7 -0
  84. data/test/test_sequence.rb +11 -0
  85. metadata +80 -3
@@ -0,0 +1,375 @@
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::Measures - 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/measure.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">Array
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-measure_for_event">#measure_for_event</a>
76
+
77
+ <li><a href="#method-i-to_mbt">#to_mbt</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::Measures</h1>
196
+
197
+ <div id="description" class="description">
198
+
199
+ <p>A specialized container for <a href="Measure.html">MIDI::Measure</a>
200
+ objects, which can be use to map event times to measure numbers. Please
201
+ note that this object has to be remade when events are deleted/added in the
202
+ sequence.</p>
203
+
204
+ </div><!-- description -->
205
+
206
+
207
+
208
+
209
+ <section id="5Buntitled-5D" class="documentation-section">
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+ <!-- Attributes -->
218
+ <section id="attribute-method-details" class="method-section section">
219
+ <h3 class="section-header">Attributes</h3>
220
+
221
+
222
+ <div id="attribute-i-max_time" class="method-detail">
223
+ <div class="method-heading attribute-method-heading">
224
+ <span class="method-name">max_time</span><span
225
+ class="attribute-access-type">[R]</span>
226
+ </div>
227
+
228
+ <div class="method-description">
229
+
230
+ <p>The highest event time in the sequence (at the time when the object was
231
+ created)</p>
232
+
233
+ </div>
234
+ </div>
235
+
236
+ <div id="attribute-i-ppqd" class="method-detail">
237
+ <div class="method-heading attribute-method-heading">
238
+ <span class="method-name">ppqd</span><span
239
+ class="attribute-access-type">[R]</span>
240
+ </div>
241
+
242
+ <div class="method-description">
243
+
244
+ <p>The ppqd from the sequence</p>
245
+
246
+ </div>
247
+ </div>
248
+
249
+ </section><!-- attribute-method-details -->
250
+
251
+
252
+ <!-- Methods -->
253
+
254
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
255
+ <h3 class="section-header">Public Class Methods</h3>
256
+
257
+
258
+ <div id="method-c-new" class="method-detail ">
259
+
260
+ <div class="method-heading">
261
+ <span class="method-name">new</span><span
262
+ class="method-args">(max_time, ppqd)</span>
263
+ <span class="method-click-advice">click to toggle source</span>
264
+ </div>
265
+
266
+
267
+ <div class="method-description">
268
+
269
+ <p>Constructor</p>
270
+
271
+
272
+
273
+ <div class="method-source-code" id="new-source">
274
+ <pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 57</span>
275
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">max_time</span>, <span class="ruby-identifier">ppqd</span>)
276
+ <span class="ruby-keyword">super</span>(<span class="ruby-value">0</span>)
277
+ <span class="ruby-ivar">@max_time</span> = <span class="ruby-identifier">max_time</span>
278
+ <span class="ruby-ivar">@ppqd</span> = <span class="ruby-identifier">ppqd</span>
279
+ <span class="ruby-keyword">end</span></pre>
280
+ </div><!-- new-source -->
281
+
282
+ </div>
283
+
284
+
285
+
286
+
287
+ </div><!-- new-method -->
288
+
289
+
290
+ </section><!-- public-class-method-details -->
291
+
292
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
293
+ <h3 class="section-header">Public Instance Methods</h3>
294
+
295
+
296
+ <div id="method-i-measure_for_event" class="method-detail ">
297
+
298
+ <div class="method-heading">
299
+ <span class="method-name">measure_for_event</span><span
300
+ class="method-args">(e)</span>
301
+ <span class="method-click-advice">click to toggle source</span>
302
+ </div>
303
+
304
+
305
+ <div class="method-description">
306
+
307
+ <p>Returns the <a href="Measure.html">MIDI::Measure</a> object where the event
308
+ is located. Returns <code>nil</code> if the event isn't found in the
309
+ container (should never happen if the <a
310
+ href="Measures.html">MIDI::Measures</a> object is up to date).</p>
311
+
312
+
313
+
314
+ <div class="method-source-code" id="measure_for_event-source">
315
+ <pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 66</span>
316
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">measure_for_event</span>(<span class="ruby-identifier">e</span>)
317
+ <span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span> <span class="ruby-identifier">m</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">contains_event?</span>(<span class="ruby-identifier">e</span>) }
318
+ <span class="ruby-keyword">end</span></pre>
319
+ </div><!-- measure_for_event-source -->
320
+
321
+ </div>
322
+
323
+
324
+
325
+
326
+ </div><!-- measure_for_event-method -->
327
+
328
+
329
+ <div id="method-i-to_mbt" class="method-detail ">
330
+
331
+ <div class="method-heading">
332
+ <span class="method-name">to_mbt</span><span
333
+ class="method-args">(e)</span>
334
+ <span class="method-click-advice">click to toggle source</span>
335
+ </div>
336
+
337
+
338
+ <div class="method-description">
339
+
340
+ <p>Returns the event's time as a formatted MBT string (Measure:Beat:Ticks) as
341
+ found in <a href="MIDI.html">MIDI</a> sequencers.</p>
342
+
343
+
344
+
345
+ <div class="method-source-code" id="to_mbt-source">
346
+ <pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 72</span>
347
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_mbt</span>(<span class="ruby-identifier">e</span>)
348
+ <span class="ruby-identifier">m</span> = <span class="ruby-identifier">measure_for_event</span>(<span class="ruby-identifier">e</span>)
349
+ <span class="ruby-identifier">b</span> = (<span class="ruby-identifier">e</span>.<span class="ruby-identifier">time_from_start</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">start</span>.<span class="ruby-identifier">to_f</span>) <span class="ruby-operator">/</span> <span class="ruby-ivar">@ppqd</span>
350
+ <span class="ruby-identifier">b</span> <span class="ruby-operator">*=</span> <span class="ruby-value">24</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">metronome_ticks</span>
351
+ <span class="ruby-identifier">sprintf</span>(<span class="ruby-string">&quot;%d:%02d:%03d&quot;</span>, <span class="ruby-identifier">m</span>.<span class="ruby-identifier">measure_number</span>, <span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, (<span class="ruby-identifier">b</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_i</span>) * <span class="ruby-ivar">@ppqd</span>)
352
+ <span class="ruby-keyword">end</span></pre>
353
+ </div><!-- to_mbt-source -->
354
+
355
+ </div>
356
+
357
+
358
+
359
+
360
+ </div><!-- to_mbt-method -->
361
+
362
+
363
+ </section><!-- public-instance-method-details -->
364
+
365
+ </section><!-- 5Buntitled-5D -->
366
+
367
+ </div><!-- documentation -->
368
+
369
+
370
+ <footer id="validator-badges">
371
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
372
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
373
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
374
+ </footer>
375
+
@@ -0,0 +1,534 @@
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::MetaEvent - 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="Event.html">MIDI::Event</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-bytes_as_str">::bytes_as_str</a>
74
+
75
+ <li><a href="#method-c-new">::new</a>
76
+
77
+ <li><a href="#method-c-str_as_bytes">::str_as_bytes</a>
78
+
79
+ <li><a href="#method-i-data-3D">#data=</a>
80
+
81
+ <li><a href="#method-i-data_as_bytes">#data_as_bytes</a>
82
+
83
+ <li><a href="#method-i-data_as_str">#data_as_str</a>
84
+
85
+ <li><a href="#method-i-to_s">#to_s</a>
86
+
87
+ </ul>
88
+ </nav>
89
+
90
+ </div>
91
+
92
+ <div id="project-metadata">
93
+ <nav id="fileindex-section" class="section project-section">
94
+ <h3 class="section-header">Pages</h3>
95
+
96
+ <ul>
97
+
98
+ <li class="file"><a href="../README_rdoc.html">README</a>
99
+
100
+ <li class="file"><a href="../TODO_rdoc.html">TODO</a>
101
+
102
+ </ul>
103
+ </nav>
104
+
105
+ <nav id="classindex-section" class="section project-section">
106
+ <h3 class="section-header">Class and Module Index</h3>
107
+
108
+ <ul class="link-list">
109
+
110
+ <li><a href="../MIDI.html">MIDI</a>
111
+
112
+ <li><a href="../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
113
+
114
+ <li><a href="../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
115
+
116
+ <li><a href="../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
117
+
118
+ <li><a href="../MIDI/Clock.html">MIDI::Clock</a>
119
+
120
+ <li><a href="../MIDI/Continue.html">MIDI::Continue</a>
121
+
122
+ <li><a href="../MIDI/Controller.html">MIDI::Controller</a>
123
+
124
+ <li><a href="../MIDI/Event.html">MIDI::Event</a>
125
+
126
+ <li><a href="../MIDI/IO.html">MIDI::IO</a>
127
+
128
+ <li><a href="../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
129
+
130
+ <li><a href="../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
131
+
132
+ <li><a href="../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
133
+
134
+ <li><a href="../MIDI/KeySig.html">MIDI::KeySig</a>
135
+
136
+ <li><a href="../MIDI/MIDI.html">MIDI::MIDI</a>
137
+
138
+ <li><a href="../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
139
+
140
+ <li><a href="../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
141
+
142
+ <li><a href="../MIDI/Marker.html">MIDI::Marker</a>
143
+
144
+ <li><a href="../MIDI/Measure.html">MIDI::Measure</a>
145
+
146
+ <li><a href="../MIDI/Measures.html">MIDI::Measures</a>
147
+
148
+ <li><a href="../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
149
+
150
+ <li><a href="../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
151
+
152
+ <li><a href="../MIDI/NoteOff.html">MIDI::NoteOff</a>
153
+
154
+ <li><a href="../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
155
+
156
+ <li><a href="../MIDI/NoteOn.html">MIDI::NoteOn</a>
157
+
158
+ <li><a href="../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
159
+
160
+ <li><a href="../MIDI/PitchBend.html">MIDI::PitchBend</a>
161
+
162
+ <li><a href="../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
163
+
164
+ <li><a href="../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
165
+
166
+ <li><a href="../MIDI/Realtime.html">MIDI::Realtime</a>
167
+
168
+ <li><a href="../MIDI/Sequence.html">MIDI::Sequence</a>
169
+
170
+ <li><a href="../MIDI/SongPointer.html">MIDI::SongPointer</a>
171
+
172
+ <li><a href="../MIDI/SongSelect.html">MIDI::SongSelect</a>
173
+
174
+ <li><a href="../MIDI/Start.html">MIDI::Start</a>
175
+
176
+ <li><a href="../MIDI/Stop.html">MIDI::Stop</a>
177
+
178
+ <li><a href="../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
179
+
180
+ <li><a href="../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
181
+
182
+ <li><a href="../MIDI/SystemReset.html">MIDI::SystemReset</a>
183
+
184
+ <li><a href="../MIDI/Tempo.html">MIDI::Tempo</a>
185
+
186
+ <li><a href="../MIDI/TimeSig.html">MIDI::TimeSig</a>
187
+
188
+ <li><a href="../MIDI/Track.html">MIDI::Track</a>
189
+
190
+ <li><a href="../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
191
+
192
+ <li><a href="../MIDI/Utils.html">MIDI::Utils</a>
193
+
194
+ <li><a href="../IO.html">IO</a>
195
+
196
+ </ul>
197
+ </nav>
198
+
199
+ </div>
200
+ </nav>
201
+
202
+ <div id="documentation">
203
+ <h1 class="class">class MIDI::MetaEvent</h1>
204
+
205
+ <div id="description" class="description">
206
+
207
+ </div><!-- description -->
208
+
209
+
210
+
211
+
212
+ <section id="5Buntitled-5D" class="documentation-section">
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+ <!-- Attributes -->
221
+ <section id="attribute-method-details" class="method-section section">
222
+ <h3 class="section-header">Attributes</h3>
223
+
224
+
225
+ <div id="attribute-i-data" class="method-detail">
226
+ <div class="method-heading attribute-method-heading">
227
+ <span class="method-name">data</span><span
228
+ class="attribute-access-type">[R]</span>
229
+ </div>
230
+
231
+ <div class="method-description">
232
+
233
+
234
+
235
+ </div>
236
+ </div>
237
+
238
+ <div id="attribute-i-meta_type" class="method-detail">
239
+ <div class="method-heading attribute-method-heading">
240
+ <span class="method-name">meta_type</span><span
241
+ class="attribute-access-type">[R]</span>
242
+ </div>
243
+
244
+ <div class="method-description">
245
+
246
+
247
+
248
+ </div>
249
+ </div>
250
+
251
+ </section><!-- attribute-method-details -->
252
+
253
+
254
+ <!-- Methods -->
255
+
256
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
257
+ <h3 class="section-header">Public Class Methods</h3>
258
+
259
+
260
+ <div id="method-c-bytes_as_str" class="method-detail ">
261
+
262
+ <div class="method-heading">
263
+ <span class="method-name">bytes_as_str</span><span
264
+ class="method-args">(bytes)</span>
265
+ <span class="method-click-advice">click to toggle source</span>
266
+ </div>
267
+
268
+
269
+ <div class="method-description">
270
+
271
+
272
+
273
+
274
+
275
+ <div class="method-source-code" id="bytes_as_str-source">
276
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 415</span>
277
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">bytes_as_str</span>(<span class="ruby-identifier">bytes</span>)
278
+ <span class="ruby-identifier">bytes</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">byte</span><span class="ruby-operator">|</span> <span class="ruby-identifier">byte</span>.<span class="ruby-identifier">chr</span> }.<span class="ruby-identifier">join</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
279
+ <span class="ruby-keyword">end</span></pre>
280
+ </div><!-- bytes_as_str-source -->
281
+
282
+ </div>
283
+
284
+
285
+
286
+
287
+ </div><!-- bytes_as_str-method -->
288
+
289
+
290
+ <div id="method-c-new" class="method-detail ">
291
+
292
+ <div class="method-heading">
293
+ <span class="method-name">new</span><span
294
+ class="method-args">(meta_type, data = nil, delta_time = 0)</span>
295
+ <span class="method-click-advice">click to toggle source</span>
296
+ </div>
297
+
298
+
299
+ <div class="method-description">
300
+
301
+
302
+
303
+
304
+
305
+ <div class="method-source-code" id="new-source">
306
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 429</span>
307
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">meta_type</span>, <span class="ruby-identifier">data</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
308
+ <span class="ruby-keyword">super</span>(<span class="ruby-constant">META_EVENT</span>, <span class="ruby-identifier">delta_time</span>)
309
+ <span class="ruby-ivar">@meta_type</span> = <span class="ruby-identifier">meta_type</span>
310
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">data</span>=(<span class="ruby-identifier">data</span>)
311
+ <span class="ruby-keyword">end</span></pre>
312
+ </div><!-- new-source -->
313
+
314
+ </div>
315
+
316
+
317
+
318
+
319
+ </div><!-- new-method -->
320
+
321
+
322
+ <div id="method-c-str_as_bytes" class="method-detail ">
323
+
324
+ <div class="method-heading">
325
+ <span class="method-name">str_as_bytes</span><span
326
+ class="method-args">(str)</span>
327
+ <span class="method-click-advice">click to toggle source</span>
328
+ </div>
329
+
330
+
331
+ <div class="method-description">
332
+
333
+
334
+
335
+
336
+
337
+ <div class="method-source-code" id="str_as_bytes-source">
338
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 420</span>
339
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">str_as_bytes</span>(<span class="ruby-identifier">str</span>)
340
+ <span class="ruby-identifier">str</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r/</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">chr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">chr</span>.<span class="ruby-identifier">ord</span> }
341
+ <span class="ruby-keyword">end</span></pre>
342
+ </div><!-- str_as_bytes-source -->
343
+
344
+ </div>
345
+
346
+
347
+
348
+
349
+ </div><!-- str_as_bytes-method -->
350
+
351
+
352
+ </section><!-- public-class-method-details -->
353
+
354
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
355
+ <h3 class="section-header">Public Instance Methods</h3>
356
+
357
+
358
+ <div id="method-i-data-3D" class="method-detail ">
359
+
360
+ <div class="method-heading">
361
+ <span class="method-name">data=</span><span
362
+ class="method-args">(data)</span>
363
+ <span class="method-click-advice">click to toggle source</span>
364
+ </div>
365
+
366
+
367
+ <div class="method-description">
368
+
369
+ <p>Stores bytes. If data is a string, splits it into an array of bytes.</p>
370
+
371
+
372
+
373
+ <div class="method-source-code" id="data-3D-source">
374
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 449</span>
375
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">data=</span>(<span class="ruby-identifier">data</span>)
376
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">data</span>
377
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
378
+ <span class="ruby-ivar">@data</span> = <span class="ruby-constant">MetaEvent</span>.<span class="ruby-identifier">str_as_bytes</span>(<span class="ruby-identifier">data</span>)
379
+ <span class="ruby-keyword">else</span>
380
+ <span class="ruby-ivar">@data</span> = <span class="ruby-identifier">data</span>
381
+ <span class="ruby-keyword">end</span>
382
+ <span class="ruby-keyword">end</span></pre>
383
+ </div><!-- data-3D-source -->
384
+
385
+ </div>
386
+
387
+
388
+
389
+
390
+ </div><!-- data-3D-method -->
391
+
392
+
393
+ <div id="method-i-data_as_bytes" class="method-detail ">
394
+
395
+ <div class="method-heading">
396
+ <span class="method-name">data_as_bytes</span><span
397
+ class="method-args">()</span>
398
+ <span class="method-click-advice">click to toggle source</span>
399
+ </div>
400
+
401
+
402
+ <div class="method-description">
403
+
404
+
405
+
406
+
407
+
408
+ <div class="method-source-code" id="data_as_bytes-source">
409
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 435</span>
410
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_bytes</span>
411
+ <span class="ruby-identifier">data</span> = []
412
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@status</span>
413
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@meta_type</span>
414
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-ivar">@data</span> <span class="ruby-operator">?</span> <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">as_var_len</span>(<span class="ruby-ivar">@data</span>.<span class="ruby-identifier">length</span>) <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
415
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@data</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@data</span>
416
+ <span class="ruby-identifier">data</span>.<span class="ruby-identifier">flatten</span>
417
+ <span class="ruby-keyword">end</span></pre>
418
+ </div><!-- data_as_bytes-source -->
419
+
420
+ </div>
421
+
422
+
423
+
424
+
425
+ </div><!-- data_as_bytes-method -->
426
+
427
+
428
+ <div id="method-i-data_as_str" class="method-detail ">
429
+
430
+ <div class="method-heading">
431
+ <span class="method-name">data_as_str</span><span
432
+ class="method-args">()</span>
433
+ <span class="method-click-advice">click to toggle source</span>
434
+ </div>
435
+
436
+
437
+ <div class="method-description">
438
+
439
+
440
+
441
+
442
+
443
+ <div class="method-source-code" id="data_as_str-source">
444
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 444</span>
445
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_str</span>
446
+ <span class="ruby-constant">MetaEvent</span>.<span class="ruby-identifier">bytes_as_str</span>(<span class="ruby-ivar">@data</span>)
447
+ <span class="ruby-keyword">end</span></pre>
448
+ </div><!-- data_as_str-source -->
449
+
450
+ </div>
451
+
452
+
453
+
454
+
455
+ </div><!-- data_as_str-method -->
456
+
457
+
458
+ <div id="method-i-to_s" class="method-detail ">
459
+
460
+ <div class="method-heading">
461
+ <span class="method-name">to_s</span><span
462
+ class="method-args">()</span>
463
+ <span class="method-click-advice">click to toggle source</span>
464
+ </div>
465
+
466
+
467
+ <div class="method-description">
468
+
469
+
470
+
471
+
472
+
473
+ <div class="method-source-code" id="to_s-source">
474
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 458</span>
475
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
476
+ <span class="ruby-identifier">str</span> = <span class="ruby-keyword">super</span>()
477
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;meta #{number_to_s(@meta_type)} &quot;</span>
478
+ <span class="ruby-comment"># I know, I know...this isn't OO.</span>
479
+ <span class="ruby-keyword">case</span> <span class="ruby-ivar">@meta_type</span>
480
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_SEQ_NUM</span>
481
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;sequence number&quot;</span>
482
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_TEXT</span>
483
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;text: #{data_as_str}&quot;</span>
484
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_COPYRIGHT</span>
485
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;copyright: #{data_as_str}&quot;</span>
486
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_SEQ_NAME</span>
487
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;sequence or track name: #{data_as_str}&quot;</span>
488
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_INSTRUMENT</span>
489
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;instrument name: #{data_as_str}&quot;</span>
490
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_LYRIC</span>
491
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;lyric: #{data_as_str}&quot;</span>
492
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_MARKER</span>
493
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;marker: #{data_as_str}&quot;</span>
494
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_CUE</span>
495
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;cue point: #{@data}&quot;</span>
496
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_TRACK_END</span>
497
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;track end&quot;</span>
498
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_SMPTE</span>
499
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;smpte&quot;</span>
500
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_TIME_SIG</span>
501
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;time signature&quot;</span>
502
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_KEY_SIG</span>
503
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;key signature&quot;</span>
504
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">META_SEQ_SPECIF</span>
505
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;sequence specific&quot;</span>
506
+ <span class="ruby-keyword">else</span>
507
+ <span class="ruby-comment"># Some other possible @meta_type values are handled by subclasses.</span>
508
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;(other)&quot;</span>
509
+ <span class="ruby-keyword">end</span>
510
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">str</span>
511
+ <span class="ruby-keyword">end</span></pre>
512
+ </div><!-- to_s-source -->
513
+
514
+ </div>
515
+
516
+
517
+
518
+
519
+ </div><!-- to_s-method -->
520
+
521
+
522
+ </section><!-- public-instance-method-details -->
523
+
524
+ </section><!-- 5Buntitled-5D -->
525
+
526
+ </div><!-- documentation -->
527
+
528
+
529
+ <footer id="validator-badges">
530
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
531
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
532
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
533
+ </footer>
534
+