midilib 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +9 -4
- data/Rakefile +2 -6
- data/examples/from_scratch.rb +3 -5
- data/examples/measures_mbt.rb +4 -4
- data/examples/print_program_changes.rb +9 -9
- data/examples/reader2text.rb +188 -188
- data/examples/seq2text.rb +17 -17
- data/examples/split.rb +19 -19
- data/examples/strings.rb +14 -14
- data/examples/transpose.rb +31 -31
- data/html/IO.html +65 -169
- data/html/MIDI.html +138 -256
- data/html/MIDI/ActiveSense.html +89 -178
- data/html/MIDI/ChannelEvent.html +95 -183
- data/html/MIDI/ChannelPressure.html +105 -190
- data/html/MIDI/Clock.html +89 -178
- data/html/MIDI/Continue.html +89 -178
- data/html/MIDI/Controller.html +107 -192
- data/html/MIDI/Event.html +138 -222
- data/html/MIDI/IO.html +45 -157
- data/html/MIDI/IO/MIDIFile.html +596 -568
- data/html/MIDI/IO/SeqReader.html +272 -314
- data/html/MIDI/IO/SeqWriter.html +229 -305
- data/html/MIDI/KeySig.html +129 -211
- data/html/MIDI/MIDI.html +45 -154
- data/html/MIDI/MIDI/MIDI.html +45 -154
- data/html/MIDI/MIDI/MIDI/Array.html +87 -185
- data/html/MIDI/Marker.html +71 -170
- data/html/MIDI/Measure.html +95 -190
- data/html/MIDI/Measures.html +103 -193
- data/html/MIDI/MetaEvent.html +180 -253
- data/html/MIDI/NoteEvent.html +118 -204
- data/html/MIDI/NoteOff.html +95 -183
- data/html/MIDI/NoteOn.html +95 -183
- data/html/MIDI/PitchBend.html +106 -191
- data/html/MIDI/PolyPressure.html +106 -189
- data/html/MIDI/ProgramChange.html +105 -190
- data/html/MIDI/Realtime.html +98 -184
- data/html/MIDI/Sequence.html +246 -311
- data/html/MIDI/SongPointer.html +106 -191
- data/html/MIDI/SongSelect.html +105 -190
- data/html/MIDI/Start.html +89 -178
- data/html/MIDI/Stop.html +89 -178
- data/html/MIDI/SystemCommon.html +71 -170
- data/html/MIDI/SystemExclusive.html +108 -193
- data/html/MIDI/SystemReset.html +89 -178
- data/html/MIDI/Tempo.html +135 -213
- data/html/MIDI/TimeSig.html +135 -214
- data/html/MIDI/Track.html +217 -291
- data/html/MIDI/TuneRequest.html +98 -184
- data/html/MIDI/Utils.html +89 -189
- data/html/README_rdoc.html +237 -257
- data/html/TODO_rdoc.html +64 -139
- data/html/created.rid +14 -14
- data/html/css/fonts.css +167 -0
- data/html/{rdoc.css → css/rdoc.css} +265 -218
- 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 +187 -169
- data/html/js/darkfish.js +41 -33
- data/html/js/jquery.js +4 -18
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +20 -5
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +1111 -498
- data/install.rb +43 -32
- data/lib/midilib/consts.rb +407 -407
- data/lib/midilib/event.rb +295 -294
- data/lib/midilib/info.rb +5 -5
- data/lib/midilib/io/midifile.rb +266 -267
- data/lib/midilib/io/seqreader.rb +106 -106
- data/lib/midilib/io/seqwriter.rb +59 -60
- data/lib/midilib/measure.rb +69 -69
- data/lib/midilib/sequence.rb +68 -70
- data/lib/midilib/track.rb +96 -102
- data/lib/midilib/utils.rb +15 -15
- data/test/event_equality.rb +50 -50
- data/test/test_event.rb +120 -122
- data/test/test_io.rb +35 -48
- data/test/test_sequence.rb +60 -60
- data/test/test_track.rb +154 -154
- data/test/test_varlen.rb +23 -25
- metadata +65 -57
data/html/MIDI/Measure.html
CHANGED
@@ -2,205 +2,98 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class MIDI::Measure - 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 = "../";
|
13
11
|
</script>
|
14
12
|
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
|
18
|
-
<
|
19
|
-
<
|
20
|
-
|
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
|
+
|
21
19
|
|
22
20
|
|
23
|
-
<body id="top" class="class">
|
24
|
-
<nav
|
25
|
-
<
|
26
|
-
|
27
|
-
|
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>
|
28
31
|
<a href="../table_of_contents.html#classes">Classes</a>
|
29
32
|
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
-
</
|
31
|
-
</
|
32
|
-
|
33
|
+
</div>
|
34
|
+
</div>
|
33
35
|
|
34
|
-
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
35
37
|
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<
|
37
|
-
<input
|
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"
|
38
42
|
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>
|
44
|
-
|
43
|
+
</div>
|
45
44
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
</ul>
|
52
|
-
</nav>
|
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>
|
53
50
|
|
54
|
-
|
55
51
|
</div>
|
56
52
|
|
53
|
+
|
54
|
+
|
57
55
|
<div id="class-metadata">
|
58
56
|
|
59
|
-
<
|
60
|
-
<h3
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
61
60
|
|
62
61
|
<p class="link">Object
|
63
62
|
|
64
|
-
</
|
63
|
+
</div>
|
65
64
|
|
66
65
|
|
66
|
+
|
67
67
|
<!-- Method Quickref -->
|
68
|
-
<
|
69
|
-
<h3
|
68
|
+
<div id="method-list-section" class="nav-section">
|
69
|
+
<h3>Methods</h3>
|
70
70
|
|
71
|
-
<ul class="link-list">
|
71
|
+
<ul class="link-list" role="directory">
|
72
72
|
|
73
|
-
<li><a href="#method-c-new">::new</a>
|
73
|
+
<li ><a href="#method-c-new">::new</a>
|
74
74
|
|
75
|
-
<li><a href="#method-i-contains_event-3F">#contains_event?</a>
|
75
|
+
<li ><a href="#method-i-contains_event-3F">#contains_event?</a>
|
76
76
|
|
77
|
-
<li><a href="#method-i-to_s">#to_s</a>
|
77
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
78
78
|
|
79
79
|
</ul>
|
80
|
-
</
|
80
|
+
</div>
|
81
81
|
|
82
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
83
|
</nav>
|
96
84
|
|
97
|
-
|
98
|
-
<
|
85
|
+
<main role="main" aria-labelledby="class-MIDI::Measure">
|
86
|
+
<h1 id="class-MIDI::Measure" class="class">
|
87
|
+
class MIDI::Measure
|
88
|
+
</h1>
|
99
89
|
|
100
|
-
<
|
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::Measure</h1>
|
196
|
-
|
197
|
-
<div id="description" class="description">
|
90
|
+
<section class="description">
|
198
91
|
|
199
92
|
<p>The <a href="Measure.html">Measure</a> class contains information about a
|
200
93
|
measure from the sequence. The measure data is based on the time signature
|
201
94
|
information from the sequence and is not stored in the sequence itself</p>
|
202
95
|
|
203
|
-
</
|
96
|
+
</section>
|
204
97
|
|
205
98
|
|
206
99
|
|
@@ -213,9 +106,10 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
213
106
|
|
214
107
|
|
215
108
|
|
216
|
-
|
217
|
-
|
218
|
-
|
109
|
+
<section class="attribute-method-details" class="method-section">
|
110
|
+
<header>
|
111
|
+
<h3>Attributes</h3>
|
112
|
+
</header>
|
219
113
|
|
220
114
|
|
221
115
|
<div id="attribute-i-denominator" class="method-detail">
|
@@ -226,7 +120,7 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
226
120
|
|
227
121
|
<div class="method-description">
|
228
122
|
|
229
|
-
<p>The denominator for the measure
|
123
|
+
<p>The denominator for the measure's time signature</p>
|
230
124
|
|
231
125
|
</div>
|
232
126
|
</div>
|
@@ -278,7 +172,7 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
278
172
|
|
279
173
|
<div class="method-description">
|
280
174
|
|
281
|
-
<p>The numerator (top digit) for the measure
|
175
|
+
<p>The numerator (top digit) for the measure's time signature</p>
|
282
176
|
|
283
177
|
</div>
|
284
178
|
</div>
|
@@ -296,13 +190,14 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
296
190
|
</div>
|
297
191
|
</div>
|
298
192
|
|
299
|
-
</section
|
193
|
+
</section>
|
300
194
|
|
301
195
|
|
302
|
-
<!-- Methods -->
|
303
196
|
|
304
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section
|
305
|
-
|
197
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
198
|
+
<header>
|
199
|
+
<h3>Public Class Methods</h3>
|
200
|
+
</header>
|
306
201
|
|
307
202
|
|
308
203
|
<div id="method-c-new" class="method-detail ">
|
@@ -310,7 +205,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
310
205
|
<div class="method-heading">
|
311
206
|
<span class="method-name">new</span><span
|
312
207
|
class="method-args">(meas_no, start_time, duration, numer, denom, met_ticks)</span>
|
208
|
+
|
313
209
|
<span class="method-click-advice">click to toggle source</span>
|
210
|
+
|
314
211
|
</div>
|
315
212
|
|
316
213
|
|
@@ -318,32 +215,35 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
318
215
|
|
319
216
|
<p>Constructor</p>
|
320
217
|
|
218
|
+
|
321
219
|
|
322
220
|
|
323
221
|
<div class="method-source-code" id="new-source">
|
324
222
|
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 23</span>
|
325
223
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">meas_no</span>, <span class="ruby-identifier">start_time</span>, <span class="ruby-identifier">duration</span>, <span class="ruby-identifier">numer</span>, <span class="ruby-identifier">denom</span>, <span class="ruby-identifier">met_ticks</span>)
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
224
|
+
<span class="ruby-ivar">@measure_number</span> = <span class="ruby-identifier">meas_no</span>
|
225
|
+
<span class="ruby-ivar">@start</span> = <span class="ruby-identifier">start_time</span>
|
226
|
+
<span class="ruby-ivar">@end</span> = <span class="ruby-identifier">start_time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
227
|
+
<span class="ruby-ivar">@numerator</span> = <span class="ruby-identifier">numer</span>
|
228
|
+
<span class="ruby-ivar">@denominator</span> = <span class="ruby-identifier">denom</span>
|
229
|
+
<span class="ruby-ivar">@metronome_ticks</span> = <span class="ruby-identifier">met_ticks</span>
|
332
230
|
<span class="ruby-keyword">end</span></pre>
|
333
|
-
</div
|
231
|
+
</div>
|
334
232
|
|
335
233
|
</div>
|
336
234
|
|
337
235
|
|
338
236
|
|
339
237
|
|
340
|
-
</div
|
238
|
+
</div>
|
341
239
|
|
342
240
|
|
343
|
-
</section
|
241
|
+
</section>
|
344
242
|
|
345
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
346
|
-
|
243
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
244
|
+
<header>
|
245
|
+
<h3>Public Instance Methods</h3>
|
246
|
+
</header>
|
347
247
|
|
348
248
|
|
349
249
|
<div id="method-i-contains_event-3F" class="method-detail ">
|
@@ -351,7 +251,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
351
251
|
<div class="method-heading">
|
352
252
|
<span class="method-name">contains_event?</span><span
|
353
253
|
class="method-args">(e)</span>
|
254
|
+
|
354
255
|
<span class="method-click-advice">click to toggle source</span>
|
256
|
+
|
355
257
|
</div>
|
356
258
|
|
357
259
|
|
@@ -359,21 +261,22 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
359
261
|
|
360
262
|
<p>Returns <code>true</code> if the event is in the measure</p>
|
361
263
|
|
264
|
+
|
362
265
|
|
363
266
|
|
364
267
|
<div class="method-source-code" id="contains_event-3F-source">
|
365
268
|
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 40</span>
|
366
269
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">contains_event?</span>(<span class="ruby-identifier">e</span>)
|
367
|
-
|
270
|
+
(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">time_from_start</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@start</span>) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">e</span>.<span class="ruby-identifier">time_from_start</span> <span class="ruby-operator"><=</span> <span class="ruby-ivar">@end</span>)
|
368
271
|
<span class="ruby-keyword">end</span></pre>
|
369
|
-
</div
|
272
|
+
</div>
|
370
273
|
|
371
274
|
</div>
|
372
275
|
|
373
276
|
|
374
277
|
|
375
278
|
|
376
|
-
</div
|
279
|
+
</div>
|
377
280
|
|
378
281
|
|
379
282
|
<div id="method-i-to_s" class="method-detail ">
|
@@ -381,7 +284,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
381
284
|
<div class="method-heading">
|
382
285
|
<span class="method-name">to_s</span><span
|
383
286
|
class="method-args">()</span>
|
287
|
+
|
384
288
|
<span class="method-click-advice">click to toggle source</span>
|
289
|
+
|
385
290
|
</div>
|
386
291
|
|
387
292
|
|
@@ -389,6 +294,7 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
389
294
|
|
390
295
|
<p>Returns a detailed string with information about the measure</p>
|
391
296
|
|
297
|
+
|
392
298
|
|
393
299
|
|
394
300
|
<div class="method-source-code" id="to_s-source">
|
@@ -398,26 +304,25 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
398
304
|
<span class="ruby-identifier">m</span> = <span class="ruby-ivar">@metronome_ticks</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-value">24</span>
|
399
305
|
<span class="ruby-node">"measure #{@measure_number} #{@start}-#{@end} #{t} #{m} qs metronome"</span>
|
400
306
|
<span class="ruby-keyword">end</span></pre>
|
401
|
-
</div
|
307
|
+
</div>
|
402
308
|
|
403
309
|
</div>
|
404
310
|
|
405
311
|
|
406
312
|
|
407
313
|
|
408
|
-
</div
|
314
|
+
</div>
|
409
315
|
|
410
316
|
|
411
|
-
</section
|
317
|
+
</section>
|
412
318
|
|
413
|
-
</section
|
414
|
-
|
415
|
-
</div><!-- documentation -->
|
319
|
+
</section>
|
320
|
+
</main>
|
416
321
|
|
417
322
|
|
418
|
-
<footer id="validator-badges">
|
419
|
-
<p><a href="http://validator.w3.org/check/referer">
|
420
|
-
<p>Generated by <a href="
|
421
|
-
<p>
|
323
|
+
<footer id="validator-badges" role="contentinfo">
|
324
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
325
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
326
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
422
327
|
</footer>
|
423
328
|
|
data/html/MIDI/Measures.html
CHANGED
@@ -2,206 +2,99 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class MIDI::Measures - 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 = "../";
|
13
11
|
</script>
|
14
12
|
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
|
18
|
-
<
|
19
|
-
<
|
20
|
-
|
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
|
+
|
21
19
|
|
22
20
|
|
23
|
-
<body id="top" class="class">
|
24
|
-
<nav
|
25
|
-
<
|
26
|
-
|
27
|
-
|
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>
|
28
31
|
<a href="../table_of_contents.html#classes">Classes</a>
|
29
32
|
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
-
</
|
31
|
-
</
|
32
|
-
|
33
|
+
</div>
|
34
|
+
</div>
|
33
35
|
|
34
|
-
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
35
37
|
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<
|
37
|
-
<input
|
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"
|
38
42
|
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>
|
44
|
-
|
43
|
+
</div>
|
45
44
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
</ul>
|
52
|
-
</nav>
|
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>
|
53
50
|
|
54
|
-
|
55
51
|
</div>
|
56
52
|
|
53
|
+
|
54
|
+
|
57
55
|
<div id="class-metadata">
|
58
56
|
|
59
|
-
<
|
60
|
-
<h3
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
61
60
|
|
62
61
|
<p class="link">Array
|
63
62
|
|
64
|
-
</
|
63
|
+
</div>
|
65
64
|
|
66
65
|
|
66
|
+
|
67
67
|
<!-- Method Quickref -->
|
68
|
-
<
|
69
|
-
<h3
|
68
|
+
<div id="method-list-section" class="nav-section">
|
69
|
+
<h3>Methods</h3>
|
70
70
|
|
71
|
-
<ul class="link-list">
|
71
|
+
<ul class="link-list" role="directory">
|
72
72
|
|
73
|
-
<li><a href="#method-c-new">::new</a>
|
73
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
74
74
|
|
75
|
-
<li><a href="#method-i-measure_for_event">#measure_for_event</a>
|
75
|
+
<li ><a href="#method-i-measure_for_event">#measure_for_event</a>
|
76
76
|
|
77
|
-
<li><a href="#method-i-to_mbt">#to_mbt</a>
|
77
|
+
<li ><a href="#method-i-to_mbt">#to_mbt</a>
|
78
78
|
|
79
79
|
</ul>
|
80
|
-
</
|
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>
|
80
|
+
</div>
|
190
81
|
|
191
82
|
</div>
|
192
83
|
</nav>
|
193
84
|
|
194
|
-
<
|
195
|
-
<h1
|
85
|
+
<main role="main" aria-labelledby="class-MIDI::Measures">
|
86
|
+
<h1 id="class-MIDI::Measures" class="class">
|
87
|
+
class MIDI::Measures
|
88
|
+
</h1>
|
196
89
|
|
197
|
-
<
|
90
|
+
<section class="description">
|
198
91
|
|
199
92
|
<p>A specialized container for <a href="Measure.html">MIDI::Measure</a>
|
200
93
|
objects, which can be use to map event times to measure numbers. Please
|
201
94
|
note that this object has to be remade when events are deleted/added in the
|
202
95
|
sequence.</p>
|
203
96
|
|
204
|
-
</
|
97
|
+
</section>
|
205
98
|
|
206
99
|
|
207
100
|
|
@@ -214,9 +107,10 @@ sequence.</p>
|
|
214
107
|
|
215
108
|
|
216
109
|
|
217
|
-
|
218
|
-
|
219
|
-
|
110
|
+
<section class="attribute-method-details" class="method-section">
|
111
|
+
<header>
|
112
|
+
<h3>Attributes</h3>
|
113
|
+
</header>
|
220
114
|
|
221
115
|
|
222
116
|
<div id="attribute-i-max_time" class="method-detail">
|
@@ -246,13 +140,14 @@ created)</p>
|
|
246
140
|
</div>
|
247
141
|
</div>
|
248
142
|
|
249
|
-
</section
|
143
|
+
</section>
|
250
144
|
|
251
145
|
|
252
|
-
<!-- Methods -->
|
253
146
|
|
254
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section
|
255
|
-
|
147
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
148
|
+
<header>
|
149
|
+
<h3>Public Class Methods</h3>
|
150
|
+
</header>
|
256
151
|
|
257
152
|
|
258
153
|
<div id="method-c-new" class="method-detail ">
|
@@ -260,7 +155,9 @@ created)</p>
|
|
260
155
|
<div class="method-heading">
|
261
156
|
<span class="method-name">new</span><span
|
262
157
|
class="method-args">(max_time, ppqd)</span>
|
158
|
+
|
263
159
|
<span class="method-click-advice">click to toggle source</span>
|
160
|
+
|
264
161
|
</div>
|
265
162
|
|
266
163
|
|
@@ -268,29 +165,37 @@ created)</p>
|
|
268
165
|
|
269
166
|
<p>Constructor</p>
|
270
167
|
|
168
|
+
|
169
|
+
<div class="method-calls-super">
|
170
|
+
Calls superclass method
|
171
|
+
|
172
|
+
</div>
|
173
|
+
|
271
174
|
|
272
175
|
|
273
176
|
<div class="method-source-code" id="new-source">
|
274
177
|
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 57</span>
|
275
178
|
<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
|
-
|
277
|
-
|
278
|
-
|
179
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-value">0</span>)
|
180
|
+
<span class="ruby-ivar">@max_time</span> = <span class="ruby-identifier">max_time</span>
|
181
|
+
<span class="ruby-ivar">@ppqd</span> = <span class="ruby-identifier">ppqd</span>
|
279
182
|
<span class="ruby-keyword">end</span></pre>
|
280
|
-
</div
|
183
|
+
</div>
|
281
184
|
|
282
185
|
</div>
|
283
186
|
|
284
187
|
|
285
188
|
|
286
189
|
|
287
|
-
</div
|
190
|
+
</div>
|
288
191
|
|
289
192
|
|
290
|
-
</section
|
193
|
+
</section>
|
291
194
|
|
292
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
293
|
-
|
195
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
196
|
+
<header>
|
197
|
+
<h3>Public Instance Methods</h3>
|
198
|
+
</header>
|
294
199
|
|
295
200
|
|
296
201
|
<div id="method-i-measure_for_event" class="method-detail ">
|
@@ -298,32 +203,35 @@ created)</p>
|
|
298
203
|
<div class="method-heading">
|
299
204
|
<span class="method-name">measure_for_event</span><span
|
300
205
|
class="method-args">(e)</span>
|
206
|
+
|
301
207
|
<span class="method-click-advice">click to toggle source</span>
|
208
|
+
|
302
209
|
</div>
|
303
210
|
|
304
211
|
|
305
212
|
<div class="method-description">
|
306
213
|
|
307
214
|
<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
|
215
|
+
is located. Returns <code>nil</code> if the event isn't found in the
|
309
216
|
container (should never happen if the <a
|
310
217
|
href="Measures.html">MIDI::Measures</a> object is up to date).</p>
|
311
218
|
|
219
|
+
|
312
220
|
|
313
221
|
|
314
222
|
<div class="method-source-code" id="measure_for_event-source">
|
315
223
|
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 66</span>
|
316
224
|
<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
|
225
|
+
<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
226
|
<span class="ruby-keyword">end</span></pre>
|
319
|
-
</div
|
227
|
+
</div>
|
320
228
|
|
321
229
|
</div>
|
322
230
|
|
323
231
|
|
324
232
|
|
325
233
|
|
326
|
-
</div
|
234
|
+
</div>
|
327
235
|
|
328
236
|
|
329
237
|
<div id="method-i-to_mbt" class="method-detail ">
|
@@ -331,45 +239,47 @@ href="Measures.html">MIDI::Measures</a> object is up to date).</p>
|
|
331
239
|
<div class="method-heading">
|
332
240
|
<span class="method-name">to_mbt</span><span
|
333
241
|
class="method-args">(e)</span>
|
242
|
+
|
334
243
|
<span class="method-click-advice">click to toggle source</span>
|
244
|
+
|
335
245
|
</div>
|
336
246
|
|
337
247
|
|
338
248
|
<div class="method-description">
|
339
249
|
|
340
|
-
<p>Returns the event
|
341
|
-
found in <a href="MIDI.html">MIDI</a> sequencers.</p>
|
250
|
+
<p>Returns the event's time as a formatted MBT string (Measure:Beat:Ticks)
|
251
|
+
as found in <a href="MIDI.html">MIDI</a> sequencers.</p>
|
252
|
+
|
342
253
|
|
343
254
|
|
344
255
|
|
345
256
|
<div class="method-source-code" id="to_mbt-source">
|
346
257
|
<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
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
258
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_mbt</span>(<span class="ruby-identifier">e</span>)
|
259
|
+
<span class="ruby-identifier">m</span> = <span class="ruby-identifier">measure_for_event</span>(<span class="ruby-identifier">e</span>)
|
260
|
+
<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>
|
261
|
+
<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>
|
262
|
+
<span class="ruby-identifier">sprintf</span>(<span class="ruby-string">"%d:%02d:%03d"</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-operator">*</span> <span class="ruby-ivar">@ppqd</span>)
|
352
263
|
<span class="ruby-keyword">end</span></pre>
|
353
|
-
</div
|
264
|
+
</div>
|
354
265
|
|
355
266
|
</div>
|
356
267
|
|
357
268
|
|
358
269
|
|
359
270
|
|
360
|
-
</div
|
271
|
+
</div>
|
361
272
|
|
362
273
|
|
363
|
-
</section
|
274
|
+
</section>
|
364
275
|
|
365
|
-
</section
|
366
|
-
|
367
|
-
</div><!-- documentation -->
|
276
|
+
</section>
|
277
|
+
</main>
|
368
278
|
|
369
279
|
|
370
|
-
<footer id="validator-badges">
|
371
|
-
<p><a href="http://validator.w3.org/check/referer">
|
372
|
-
<p>Generated by <a href="
|
373
|
-
<p>
|
280
|
+
<footer id="validator-badges" role="contentinfo">
|
281
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
282
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
283
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
374
284
|
</footer>
|
375
285
|
|