midilib 2.0.5 → 3.0.1
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 +5 -5
- data/ChangeLog +2 -1
- data/Credits +39 -2
- data/README.rdoc +5 -6
- data/Rakefile +36 -49
- data/TODO.rdoc +13 -2
- data/examples/from_scratch.rb +1 -1
- data/examples/measures_mbt.rb +11 -11
- data/examples/print_program_changes.rb +2 -2
- data/examples/reader2text.rb +47 -47
- data/examples/seq2text.rb +1 -1
- data/examples/split.rb +4 -3
- data/examples/strings.rb +4 -4
- data/examples/transpose.rb +19 -20
- data/install.rb +21 -13
- data/lib/midilib/consts.rb +237 -239
- data/lib/midilib/event.rb +128 -100
- data/lib/midilib/info.rb +3 -5
- data/lib/midilib/io/midifile.rb +155 -182
- data/lib/midilib/io/seqreader.rb +80 -85
- data/lib/midilib/io/seqwriter.rb +93 -88
- data/lib/midilib/measure.rb +78 -80
- data/lib/midilib/mergesort.rb +39 -0
- data/lib/midilib/sequence.rb +40 -32
- data/lib/midilib/track.rb +16 -57
- data/lib/midilib/utils.rb +4 -7
- data/lib/midilib.rb +5 -5
- data/test/event_equality.rb +28 -30
- data/test/test_event.rb +9 -11
- data/test/test_io.rb +83 -3
- data/test/test_mergesort.rb +37 -0
- data/test/test_midifile.rb +6 -19
- data/test/test_sequence.rb +5 -4
- data/test/test_track.rb +9 -38
- data/test/test_varlen.rb +1 -3
- metadata +8 -95
- data/html/IO.html +0 -155
- data/html/MIDI/ActiveSense.html +0 -206
- data/html/MIDI/ChannelEvent.html +0 -231
- data/html/MIDI/ChannelPressure.html +0 -265
- data/html/MIDI/Clock.html +0 -206
- data/html/MIDI/Continue.html +0 -206
- data/html/MIDI/Controller.html +0 -280
- data/html/MIDI/Event.html +0 -489
- data/html/MIDI/IO/MIDIFile.html +0 -2024
- data/html/MIDI/IO/SeqReader.html +0 -904
- data/html/MIDI/IO/SeqWriter.html +0 -572
- data/html/MIDI/IO.html +0 -95
- data/html/MIDI/KeySig.html +0 -353
- data/html/MIDI/MIDI/MIDI/Array.html +0 -255
- data/html/MIDI/MIDI/MIDI.html +0 -95
- data/html/MIDI/MIDI.html +0 -95
- data/html/MIDI/Marker.html +0 -158
- data/html/MIDI/Measure.html +0 -328
- data/html/MIDI/Measures.html +0 -285
- data/html/MIDI/MetaEvent.html +0 -461
- data/html/MIDI/NoteEvent.html +0 -331
- data/html/MIDI/NoteOff.html +0 -228
- data/html/MIDI/NoteOn.html +0 -228
- data/html/MIDI/PitchBend.html +0 -266
- data/html/MIDI/PolyPressure.html +0 -277
- data/html/MIDI/ProgramChange.html +0 -265
- data/html/MIDI/Realtime.html +0 -242
- data/html/MIDI/Sequence.html +0 -896
- data/html/MIDI/SongPointer.html +0 -266
- data/html/MIDI/SongSelect.html +0 -265
- data/html/MIDI/Start.html +0 -206
- data/html/MIDI/Stop.html +0 -206
- data/html/MIDI/SystemCommon.html +0 -158
- data/html/MIDI/SystemExclusive.html +0 -268
- data/html/MIDI/SystemReset.html +0 -206
- data/html/MIDI/Tempo.html +0 -396
- data/html/MIDI/TimeSig.html +0 -388
- data/html/MIDI/Track.html +0 -695
- data/html/MIDI/TuneRequest.html +0 -242
- data/html/MIDI/Utils.html +0 -220
- data/html/MIDI.html +0 -547
- data/html/README_rdoc.html +0 -731
- data/html/TODO_rdoc.html +0 -125
- data/html/created.rid +0 -14
- data/html/css/fonts.css +0 -167
- data/html/css/rdoc.css +0 -590
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.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 +0 -768
- data/html/js/darkfish.js +0 -161
- data/html/js/jquery.js +0 -4
- data/html/js/navigation.js +0 -142
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +0 -109
- data/html/js/search_index.js +0 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +0 -228
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +0 -1265
data/html/MIDI/MetaEvent.html
DELETED
|
@@ -1,461 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
|
|
7
|
-
<title>class MIDI::MetaEvent - midilib</title>
|
|
8
|
-
|
|
9
|
-
<script type="text/javascript">
|
|
10
|
-
var rdoc_rel_prefix = "../";
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<script src="../js/jquery.js"></script>
|
|
14
|
-
<script src="../js/darkfish.js"></script>
|
|
15
|
-
|
|
16
|
-
<link href="../css/fonts.css" rel="stylesheet">
|
|
17
|
-
<link href="../css/rdoc.css" rel="stylesheet">
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<body id="top" role="document" class="class">
|
|
22
|
-
<nav role="navigation">
|
|
23
|
-
<div id="project-navigation">
|
|
24
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
25
|
-
<h2>
|
|
26
|
-
<a href="../index.html" rel="home">Home</a>
|
|
27
|
-
</h2>
|
|
28
|
-
|
|
29
|
-
<div id="table-of-contents-navigation">
|
|
30
|
-
<a href="../table_of_contents.html#pages">Pages</a>
|
|
31
|
-
<a href="../table_of_contents.html#classes">Classes</a>
|
|
32
|
-
<a href="../table_of_contents.html#methods">Methods</a>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
37
|
-
<form action="#" method="get" accept-charset="utf-8">
|
|
38
|
-
<div id="search-field-wrapper">
|
|
39
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
|
40
|
-
aria-autocomplete="list" aria-controls="search-results"
|
|
41
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
42
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<ul id="search-results" aria-label="Search Results"
|
|
46
|
-
aria-busy="false" aria-expanded="false"
|
|
47
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
|
48
|
-
</form>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<div id="class-metadata">
|
|
56
|
-
|
|
57
|
-
<div id="parent-class-section" class="nav-section">
|
|
58
|
-
<h3>Parent</h3>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<p class="link"><a href="Event.html">MIDI::Event</a>
|
|
62
|
-
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<!-- Method Quickref -->
|
|
68
|
-
<div id="method-list-section" class="nav-section">
|
|
69
|
-
<h3>Methods</h3>
|
|
70
|
-
|
|
71
|
-
<ul class="link-list" role="directory">
|
|
72
|
-
|
|
73
|
-
<li ><a href="#method-c-bytes_as_str">::bytes_as_str</a>
|
|
74
|
-
|
|
75
|
-
<li class="calls-super" ><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 class="calls-super" ><a href="#method-i-to_s">#to_s</a>
|
|
86
|
-
|
|
87
|
-
</ul>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
</div>
|
|
91
|
-
</nav>
|
|
92
|
-
|
|
93
|
-
<main role="main" aria-labelledby="class-MIDI::MetaEvent">
|
|
94
|
-
<h1 id="class-MIDI::MetaEvent" class="class">
|
|
95
|
-
class MIDI::MetaEvent
|
|
96
|
-
</h1>
|
|
97
|
-
|
|
98
|
-
<section class="description">
|
|
99
|
-
|
|
100
|
-
</section>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<section class="attribute-method-details" class="method-section">
|
|
114
|
-
<header>
|
|
115
|
-
<h3>Attributes</h3>
|
|
116
|
-
</header>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<div id="attribute-i-data" class="method-detail">
|
|
120
|
-
<div class="method-heading attribute-method-heading">
|
|
121
|
-
<span class="method-name">data</span><span
|
|
122
|
-
class="attribute-access-type">[R]</span>
|
|
123
|
-
</div>
|
|
124
|
-
|
|
125
|
-
<div class="method-description">
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<div id="attribute-i-meta_type" class="method-detail">
|
|
133
|
-
<div class="method-heading attribute-method-heading">
|
|
134
|
-
<span class="method-name">meta_type</span><span
|
|
135
|
-
class="attribute-access-type">[R]</span>
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<div class="method-description">
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
</section>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
150
|
-
<header>
|
|
151
|
-
<h3>Public Class Methods</h3>
|
|
152
|
-
</header>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
<div id="method-c-bytes_as_str" class="method-detail ">
|
|
156
|
-
|
|
157
|
-
<div class="method-heading">
|
|
158
|
-
<span class="method-name">bytes_as_str</span><span
|
|
159
|
-
class="method-args">(bytes)</span>
|
|
160
|
-
|
|
161
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
162
|
-
|
|
163
|
-
</div>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<div class="method-description">
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<div class="method-source-code" id="bytes_as_str-source">
|
|
174
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 416</span>
|
|
175
|
-
<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>)
|
|
176
|
-
<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>
|
|
177
|
-
<span class="ruby-keyword">end</span></pre>
|
|
178
|
-
</div>
|
|
179
|
-
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<div id="method-c-new" class="method-detail ">
|
|
189
|
-
|
|
190
|
-
<div class="method-heading">
|
|
191
|
-
<span class="method-name">new</span><span
|
|
192
|
-
class="method-args">(meta_type, data = nil, delta_time = 0)</span>
|
|
193
|
-
|
|
194
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
195
|
-
|
|
196
|
-
</div>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
<div class="method-description">
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<div class="method-calls-super">
|
|
205
|
-
Calls superclass method
|
|
206
|
-
<a href="Event.html#method-c-new">MIDI::Event.new</a>
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
<div class="method-source-code" id="new-source">
|
|
212
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 430</span>
|
|
213
|
-
<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>)
|
|
214
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-constant">META_EVENT</span>, <span class="ruby-identifier">delta_time</span>)
|
|
215
|
-
<span class="ruby-ivar">@meta_type</span> = <span class="ruby-identifier">meta_type</span>
|
|
216
|
-
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">data</span>=(<span class="ruby-identifier">data</span>)
|
|
217
|
-
<span class="ruby-keyword">end</span></pre>
|
|
218
|
-
</div>
|
|
219
|
-
|
|
220
|
-
</div>
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
</div>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
<div id="method-c-str_as_bytes" class="method-detail ">
|
|
229
|
-
|
|
230
|
-
<div class="method-heading">
|
|
231
|
-
<span class="method-name">str_as_bytes</span><span
|
|
232
|
-
class="method-args">(str)</span>
|
|
233
|
-
|
|
234
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
235
|
-
|
|
236
|
-
</div>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
<div class="method-description">
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
<div class="method-source-code" id="str_as_bytes-source">
|
|
247
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 421</span>
|
|
248
|
-
<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>)
|
|
249
|
-
<span class="ruby-identifier">str</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">//</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> }
|
|
250
|
-
<span class="ruby-keyword">end</span></pre>
|
|
251
|
-
</div>
|
|
252
|
-
|
|
253
|
-
</div>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
</div>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
</section>
|
|
262
|
-
|
|
263
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
264
|
-
<header>
|
|
265
|
-
<h3>Public Instance Methods</h3>
|
|
266
|
-
</header>
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
<div id="method-i-data-3D" class="method-detail ">
|
|
270
|
-
|
|
271
|
-
<div class="method-heading">
|
|
272
|
-
<span class="method-name">data=</span><span
|
|
273
|
-
class="method-args">(data)</span>
|
|
274
|
-
|
|
275
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
276
|
-
|
|
277
|
-
</div>
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
<div class="method-description">
|
|
281
|
-
|
|
282
|
-
<p>Stores bytes. If data is a string, splits it into an array of bytes.</p>
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
<div class="method-source-code" id="data-3D-source">
|
|
288
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 450</span>
|
|
289
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">data=</span>(<span class="ruby-identifier">data</span>)
|
|
290
|
-
<span class="ruby-keyword">case</span> <span class="ruby-identifier">data</span>
|
|
291
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
|
|
292
|
-
<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>)
|
|
293
|
-
<span class="ruby-keyword">else</span>
|
|
294
|
-
<span class="ruby-ivar">@data</span> = <span class="ruby-identifier">data</span>
|
|
295
|
-
<span class="ruby-keyword">end</span>
|
|
296
|
-
<span class="ruby-keyword">end</span></pre>
|
|
297
|
-
</div>
|
|
298
|
-
|
|
299
|
-
</div>
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
</div>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
<div id="method-i-data_as_bytes" class="method-detail ">
|
|
308
|
-
|
|
309
|
-
<div class="method-heading">
|
|
310
|
-
<span class="method-name">data_as_bytes</span><span
|
|
311
|
-
class="method-args">()</span>
|
|
312
|
-
|
|
313
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
314
|
-
|
|
315
|
-
</div>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
<div class="method-description">
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
<div class="method-source-code" id="data_as_bytes-source">
|
|
326
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 436</span>
|
|
327
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_bytes</span>
|
|
328
|
-
<span class="ruby-identifier">data</span> = []
|
|
329
|
-
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@status</span>
|
|
330
|
-
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@meta_type</span>
|
|
331
|
-
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</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>)
|
|
332
|
-
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@data</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@data</span>
|
|
333
|
-
<span class="ruby-identifier">data</span>.<span class="ruby-identifier">flatten</span>
|
|
334
|
-
<span class="ruby-keyword">end</span></pre>
|
|
335
|
-
</div>
|
|
336
|
-
|
|
337
|
-
</div>
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
</div>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
<div id="method-i-data_as_str" class="method-detail ">
|
|
346
|
-
|
|
347
|
-
<div class="method-heading">
|
|
348
|
-
<span class="method-name">data_as_str</span><span
|
|
349
|
-
class="method-args">()</span>
|
|
350
|
-
|
|
351
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
352
|
-
|
|
353
|
-
</div>
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
<div class="method-description">
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<div class="method-source-code" id="data_as_str-source">
|
|
364
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 445</span>
|
|
365
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_str</span>
|
|
366
|
-
<span class="ruby-constant">MetaEvent</span>.<span class="ruby-identifier">bytes_as_str</span>(<span class="ruby-ivar">@data</span>)
|
|
367
|
-
<span class="ruby-keyword">end</span></pre>
|
|
368
|
-
</div>
|
|
369
|
-
|
|
370
|
-
</div>
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
</div>
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
<div id="method-i-to_s" class="method-detail ">
|
|
379
|
-
|
|
380
|
-
<div class="method-heading">
|
|
381
|
-
<span class="method-name">to_s</span><span
|
|
382
|
-
class="method-args">()</span>
|
|
383
|
-
|
|
384
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
385
|
-
|
|
386
|
-
</div>
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
<div class="method-description">
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
<div class="method-calls-super">
|
|
395
|
-
Calls superclass method
|
|
396
|
-
<a href="Event.html#method-i-to_s">MIDI::Event#to_s</a>
|
|
397
|
-
</div>
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
<div class="method-source-code" id="to_s-source">
|
|
402
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 459</span>
|
|
403
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
|
404
|
-
<span class="ruby-identifier">str</span> = <span class="ruby-keyword">super</span>()
|
|
405
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"meta #{number_to_s(@meta_type)} "</span>
|
|
406
|
-
<span class="ruby-comment"># I know, I know...this isn't OO.</span>
|
|
407
|
-
<span class="ruby-keyword">case</span> <span class="ruby-ivar">@meta_type</span>
|
|
408
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_SEQ_NUM</span>
|
|
409
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"sequence number"</span>
|
|
410
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_TEXT</span>
|
|
411
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"text: #{data_as_str}"</span>
|
|
412
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_COPYRIGHT</span>
|
|
413
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"copyright: #{data_as_str}"</span>
|
|
414
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_SEQ_NAME</span>
|
|
415
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"sequence or track name: #{data_as_str}"</span>
|
|
416
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_INSTRUMENT</span>
|
|
417
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"instrument name: #{data_as_str}"</span>
|
|
418
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_LYRIC</span>
|
|
419
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"lyric: #{data_as_str}"</span>
|
|
420
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_MARKER</span>
|
|
421
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"marker: #{data_as_str}"</span>
|
|
422
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_CUE</span>
|
|
423
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"cue point: #{@data}"</span>
|
|
424
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_TRACK_END</span>
|
|
425
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"track end"</span>
|
|
426
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_SMPTE</span>
|
|
427
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"smpte"</span>
|
|
428
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_TIME_SIG</span>
|
|
429
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"time signature"</span>
|
|
430
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_KEY_SIG</span>
|
|
431
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"key signature"</span>
|
|
432
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_SEQ_SPECIF</span>
|
|
433
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"sequence specific"</span>
|
|
434
|
-
<span class="ruby-keyword">else</span>
|
|
435
|
-
<span class="ruby-comment"># Some other possible @meta_type values are handled by subclasses.</span>
|
|
436
|
-
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"(other)"</span>
|
|
437
|
-
<span class="ruby-keyword">end</span>
|
|
438
|
-
<span class="ruby-keyword">return</span> <span class="ruby-identifier">str</span>
|
|
439
|
-
<span class="ruby-keyword">end</span></pre>
|
|
440
|
-
</div>
|
|
441
|
-
|
|
442
|
-
</div>
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
</div>
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
</section>
|
|
451
|
-
|
|
452
|
-
</section>
|
|
453
|
-
</main>
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
<footer id="validator-badges" role="contentinfo">
|
|
457
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
458
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
|
459
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
460
|
-
</footer>
|
|
461
|
-
|