midilib 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Credits +5 -0
- data/html/MIDI/ActiveSense.html +171 -0
- data/html/MIDI/ChannelEvent.html +190 -0
- data/html/MIDI/ChannelPressure.html +212 -0
- data/html/MIDI/Clock.html +171 -0
- data/html/MIDI/Continue.html +171 -0
- data/html/MIDI/Controller.html +224 -0
- data/html/MIDI/Event.html +349 -0
- data/html/MIDI/IO/MIDIFile.html +1392 -0
- data/html/MIDI/IO/SeqReader.html +642 -0
- data/html/MIDI/IO/SeqWriter.html +442 -0
- data/html/MIDI/IO.html +91 -0
- data/html/MIDI/KeySig.html +292 -0
- data/html/MIDI/Marker.html +138 -0
- data/html/MIDI/Measure.html +260 -0
- data/html/MIDI/Measures.html +222 -0
- data/html/MIDI/MetaEvent.html +353 -0
- data/html/MIDI/NoteEvent.html +255 -0
- data/html/MIDI/NoteOff.html +188 -0
- data/html/MIDI/NoteOn.html +188 -0
- data/html/MIDI/PitchBend.html +213 -0
- data/html/MIDI/PolyPressure.html +216 -0
- data/html/MIDI/ProgramChange.html +212 -0
- data/html/MIDI/Realtime.html +194 -0
- data/html/MIDI/Sequence.html +641 -0
- data/html/MIDI/SongPointer.html +213 -0
- data/html/MIDI/SongSelect.html +212 -0
- data/html/MIDI/Start.html +171 -0
- data/html/MIDI/Stop.html +171 -0
- data/html/MIDI/SystemCommon.html +138 -0
- data/html/MIDI/SystemExclusive.html +215 -0
- data/html/MIDI/SystemReset.html +171 -0
- data/html/MIDI/Tempo.html +292 -0
- data/html/MIDI/TimeSig.html +286 -0
- data/html/MIDI/Track.html +489 -0
- data/html/MIDI/TuneRequest.html +194 -0
- data/html/MIDI/Utils.html +178 -0
- data/html/MIDI.html +281 -0
- data/html/Object.html +197 -0
- data/html/README_rdoc.html +545 -0
- data/html/TODO_rdoc.html +123 -0
- data/html/created.rid +15 -0
- 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/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 +534 -0
- data/html/js/darkfish.js +84 -0
- data/html/js/navigation.js +105 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +110 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +1258 -0
- data/lib/midilib/info.rb +2 -2
- data/lib/midilib/io/seqreader.rb +18 -5
- data/test/test_io.rb +18 -5
- metadata +85 -1
@@ -0,0 +1,353 @@
|
|
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
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
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
|
+
|
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>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
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"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
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>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
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
|
+
|
67
|
+
|
68
|
+
|
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>
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
</nav>
|
87
|
+
|
88
|
+
<main role="main" aria-labelledby="class-MIDI::MetaEvent">
|
89
|
+
<h1 id="class-MIDI::MetaEvent" class="class">
|
90
|
+
class MIDI::MetaEvent
|
91
|
+
</h1>
|
92
|
+
|
93
|
+
<section class="description">
|
94
|
+
|
95
|
+
</section>
|
96
|
+
|
97
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<section class="attribute-method-details" class="method-section">
|
102
|
+
<header>
|
103
|
+
<h3>Attributes</h3>
|
104
|
+
</header>
|
105
|
+
|
106
|
+
<div id="attribute-i-data" class="method-detail">
|
107
|
+
<div class="method-heading attribute-method-heading">
|
108
|
+
<span class="method-name">data</span><span
|
109
|
+
class="attribute-access-type">[R]</span>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<div class="method-description">
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div id="attribute-i-meta_type" class="method-detail">
|
117
|
+
<div class="method-heading attribute-method-heading">
|
118
|
+
<span class="method-name">meta_type</span><span
|
119
|
+
class="attribute-access-type">[R]</span>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<div class="method-description">
|
123
|
+
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
</section>
|
127
|
+
|
128
|
+
|
129
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
130
|
+
<header>
|
131
|
+
<h3>Public Class Methods</h3>
|
132
|
+
</header>
|
133
|
+
|
134
|
+
<div id="method-c-bytes_as_str" class="method-detail ">
|
135
|
+
<div class="method-heading">
|
136
|
+
<span class="method-name">bytes_as_str</span><span
|
137
|
+
class="method-args">(bytes)</span>
|
138
|
+
<span class="method-click-advice">click to toggle source</span>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div class="method-description">
|
142
|
+
|
143
|
+
|
144
|
+
<div class="method-source-code" id="bytes_as_str-source">
|
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>
|
148
|
+
<span class="ruby-keyword">end</span></pre>
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div id="method-c-new" class="method-detail ">
|
156
|
+
<div class="method-heading">
|
157
|
+
<span class="method-name">new</span><span
|
158
|
+
class="method-args">(meta_type, data = nil, delta_time = 0)</span>
|
159
|
+
<span class="method-click-advice">click to toggle source</span>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
|
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>
|
168
|
+
|
169
|
+
<div class="method-source-code" id="new-source">
|
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>)
|
175
|
+
<span class="ruby-keyword">end</span></pre>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div id="method-c-str_as_bytes" class="method-detail ">
|
183
|
+
<div class="method-heading">
|
184
|
+
<span class="method-name">str_as_bytes</span><span
|
185
|
+
class="method-args">(str)</span>
|
186
|
+
<span class="method-click-advice">click to toggle source</span>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div class="method-description">
|
190
|
+
|
191
|
+
|
192
|
+
<div class="method-source-code" id="str_as_bytes-source">
|
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> }
|
196
|
+
<span class="ruby-keyword">end</span></pre>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
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>
|
209
|
+
|
210
|
+
<div id="method-i-data-3D" class="method-detail ">
|
211
|
+
<div class="method-heading">
|
212
|
+
<span class="method-name">data=</span><span
|
213
|
+
class="method-args">(data)</span>
|
214
|
+
<span class="method-click-advice">click to toggle source</span>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
<div class="method-description">
|
218
|
+
<p>Stores bytes. If data is a string, splits it into an array of bytes.</p>
|
219
|
+
|
220
|
+
<div class="method-source-code" id="data-3D-source">
|
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>
|
229
|
+
<span class="ruby-keyword">end</span></pre>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div id="method-i-data_as_bytes" class="method-detail ">
|
237
|
+
<div class="method-heading">
|
238
|
+
<span class="method-name">data_as_bytes</span><span
|
239
|
+
class="method-args">()</span>
|
240
|
+
<span class="method-click-advice">click to toggle source</span>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div class="method-description">
|
244
|
+
|
245
|
+
|
246
|
+
<div class="method-source-code" id="data_as_bytes-source">
|
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>
|
255
|
+
<span class="ruby-keyword">end</span></pre>
|
256
|
+
</div>
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div id="method-i-data_as_str" class="method-detail ">
|
263
|
+
<div class="method-heading">
|
264
|
+
<span class="method-name">data_as_str</span><span
|
265
|
+
class="method-args">()</span>
|
266
|
+
<span class="method-click-advice">click to toggle source</span>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div class="method-description">
|
270
|
+
|
271
|
+
|
272
|
+
<div class="method-source-code" id="data_as_str-source">
|
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>)
|
276
|
+
<span class="ruby-keyword">end</span></pre>
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
</div>
|
282
|
+
|
283
|
+
<div id="method-i-to_s" class="method-detail ">
|
284
|
+
<div class="method-heading">
|
285
|
+
<span class="method-name">to_s</span><span
|
286
|
+
class="method-args">()</span>
|
287
|
+
<span class="method-click-advice">click to toggle source</span>
|
288
|
+
</div>
|
289
|
+
|
290
|
+
<div class="method-description">
|
291
|
+
|
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>
|
296
|
+
|
297
|
+
<div class="method-source-code" id="to_s-source">
|
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>
|
335
|
+
<span class="ruby-keyword">end</span></pre>
|
336
|
+
</div>
|
337
|
+
</div>
|
338
|
+
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
</section>
|
343
|
+
|
344
|
+
</section>
|
345
|
+
</main>
|
346
|
+
|
347
|
+
|
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>.
|
352
|
+
</footer>
|
353
|
+
|
@@ -0,0 +1,255 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class MIDI::NoteEvent - midilib</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
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
|
+
|
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>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
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"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
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>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="ChannelEvent.html">MIDI::ChannelEvent</a>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
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 class="calls-super" ><a href="#method-c-new">::new</a>
|
76
|
+
<li ><a href="#method-i-data_as_bytes">#data_as_bytes</a>
|
77
|
+
<li ><a href="#method-i-note_to_s">#note_to_s</a>
|
78
|
+
<li ><a href="#method-i-pch_oct">#pch_oct</a>
|
79
|
+
</ul>
|
80
|
+
</div>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
</nav>
|
84
|
+
|
85
|
+
<main role="main" aria-labelledby="class-MIDI::NoteEvent">
|
86
|
+
<h1 id="class-MIDI::NoteEvent" class="class">
|
87
|
+
class MIDI::NoteEvent
|
88
|
+
</h1>
|
89
|
+
|
90
|
+
<section class="description">
|
91
|
+
|
92
|
+
<p>The abstract superclass of all note on, and note off, and polyphonic pressure events.</p>
|
93
|
+
|
94
|
+
</section>
|
95
|
+
|
96
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
97
|
+
|
98
|
+
|
99
|
+
<section class="constants-list">
|
100
|
+
<header>
|
101
|
+
<h3>Constants</h3>
|
102
|
+
</header>
|
103
|
+
<dl>
|
104
|
+
<dt id="PITCHES">PITCHES
|
105
|
+
<dd>
|
106
|
+
</dl>
|
107
|
+
</section>
|
108
|
+
|
109
|
+
<section class="attribute-method-details" class="method-section">
|
110
|
+
<header>
|
111
|
+
<h3>Attributes</h3>
|
112
|
+
</header>
|
113
|
+
|
114
|
+
<div id="attribute-i-note" class="method-detail">
|
115
|
+
<div class="method-heading attribute-method-heading">
|
116
|
+
<span class="method-name">note</span><span
|
117
|
+
class="attribute-access-type">[RW]</span>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="method-description">
|
121
|
+
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
<div id="attribute-i-velocity" class="method-detail">
|
125
|
+
<div class="method-heading attribute-method-heading">
|
126
|
+
<span class="method-name">velocity</span><span
|
127
|
+
class="attribute-access-type">[RW]</span>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div class="method-description">
|
131
|
+
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
</section>
|
135
|
+
|
136
|
+
|
137
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
138
|
+
<header>
|
139
|
+
<h3>Public Class Methods</h3>
|
140
|
+
</header>
|
141
|
+
|
142
|
+
<div id="method-c-new" class="method-detail ">
|
143
|
+
<div class="method-heading">
|
144
|
+
<span class="method-name">new</span><span
|
145
|
+
class="method-args">(status, channel, note, velocity, delta_time)</span>
|
146
|
+
<span class="method-click-advice">click to toggle source</span>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div class="method-description">
|
150
|
+
|
151
|
+
<div class="method-calls-super">
|
152
|
+
Calls superclass method
|
153
|
+
<a href="ChannelEvent.html#method-c-new"><code>MIDI::ChannelEvent::new</code></a>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div class="method-source-code" id="new-source">
|
157
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 103</span>
|
158
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">channel</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">velocity</span>, <span class="ruby-identifier">delta_time</span>)
|
159
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">channel</span>, <span class="ruby-identifier">delta_time</span>)
|
160
|
+
<span class="ruby-ivar">@note</span> = <span class="ruby-identifier">note</span>
|
161
|
+
<span class="ruby-ivar">@velocity</span> = <span class="ruby-identifier">velocity</span>
|
162
|
+
<span class="ruby-keyword">end</span></pre>
|
163
|
+
</div>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
</section>
|
170
|
+
|
171
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
172
|
+
<header>
|
173
|
+
<h3>Public Instance Methods</h3>
|
174
|
+
</header>
|
175
|
+
|
176
|
+
<div id="method-i-data_as_bytes" class="method-detail ">
|
177
|
+
<div class="method-heading">
|
178
|
+
<span class="method-name">data_as_bytes</span><span
|
179
|
+
class="method-args">()</span>
|
180
|
+
<span class="method-click-advice">click to toggle source</span>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="method-description">
|
184
|
+
|
185
|
+
|
186
|
+
<div class="method-source-code" id="data_as_bytes-source">
|
187
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 125</span>
|
188
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">data_as_bytes</span>
|
189
|
+
<span class="ruby-identifier">data</span> = []
|
190
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> (<span class="ruby-ivar">@status</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@channel</span>)
|
191
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@note</span>
|
192
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@velocity</span>
|
193
|
+
<span class="ruby-keyword">end</span></pre>
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div id="method-i-note_to_s" class="method-detail ">
|
201
|
+
<div class="method-heading">
|
202
|
+
<span class="method-name">note_to_s</span><span
|
203
|
+
class="method-args">()</span>
|
204
|
+
<span class="method-click-advice">click to toggle source</span>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div class="method-description">
|
208
|
+
<p>If @print_note_names is true, returns <a href="NoteEvent.html#method-i-pch_oct"><code>pch_oct</code></a>(val) else returns value as a number using number_to_s.</p>
|
209
|
+
|
210
|
+
<div class="method-source-code" id="note_to_s-source">
|
211
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 121</span>
|
212
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">note_to_s</span>
|
213
|
+
<span class="ruby-ivar">@print_note_names</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">pch_oct</span>(<span class="ruby-ivar">@note</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">number_to_s</span>(<span class="ruby-ivar">@note</span>)
|
214
|
+
<span class="ruby-keyword">end</span></pre>
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div id="method-i-pch_oct" class="method-detail ">
|
222
|
+
<div class="method-heading">
|
223
|
+
<span class="method-name">pch_oct</span><span
|
224
|
+
class="method-args">(val = @note)</span>
|
225
|
+
<span class="method-click-advice">click to toggle source</span>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
<div class="method-description">
|
229
|
+
<p>Returns note name as a pitch/octave string like “C4” or “F#6”.</p>
|
230
|
+
|
231
|
+
<div class="method-source-code" id="pch_oct-source">
|
232
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 113</span>
|
233
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pch_oct</span>(<span class="ruby-identifier">val</span> = <span class="ruby-ivar">@note</span>)
|
234
|
+
<span class="ruby-identifier">pch</span> = <span class="ruby-identifier">val</span> <span class="ruby-operator">%</span> <span class="ruby-value">12</span>
|
235
|
+
<span class="ruby-identifier">oct</span> = (<span class="ruby-identifier">val</span> <span class="ruby-operator">/</span> <span class="ruby-value">12</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
236
|
+
<span class="ruby-node">"#{PITCHES[pch]}#{oct}"</span>
|
237
|
+
<span class="ruby-keyword">end</span></pre>
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
|
242
|
+
</div>
|
243
|
+
|
244
|
+
</section>
|
245
|
+
|
246
|
+
</section>
|
247
|
+
</main>
|
248
|
+
|
249
|
+
|
250
|
+
<footer id="validator-badges" role="contentinfo">
|
251
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
252
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
253
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
254
|
+
</footer>
|
255
|
+
|