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