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/Measure.html
CHANGED
@@ -2,222 +2,105 @@
|
|
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 = "../";
|
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">
|
21
22
|
|
22
23
|
|
23
|
-
<body id="top" class="class">
|
24
|
-
<nav
|
25
|
-
<
|
26
|
-
|
27
|
-
|
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>
|
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>
|
46
|
+
</div>
|
41
47
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<nav id="file-list-section" class="section">
|
48
|
-
<h3 class="section-header">Defined In</h3>
|
49
|
-
<ul>
|
50
|
-
<li>lib/midilib/measure.rb
|
51
|
-
</ul>
|
52
|
-
</nav>
|
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
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
|
-
|
62
|
-
<p class="link">Object
|
63
56
|
|
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
60
|
|
73
|
-
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="../Object.html">Object</a>
|
65
|
+
</div>
|
66
|
+
|
74
67
|
|
75
|
-
<li><a href="#method-i-contains_event-3F">#contains_event?</a>
|
76
68
|
|
77
|
-
<li><a href="#method-i-to_s">#to_s</a>
|
78
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-new">::new</a>
|
76
|
+
<li ><a href="#method-i-contains_event-3F">#contains_event?</a>
|
77
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
79
78
|
</ul>
|
80
|
-
</
|
79
|
+
</div>
|
81
80
|
|
82
81
|
</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
82
|
</nav>
|
96
83
|
|
97
|
-
|
98
|
-
<
|
84
|
+
<main role="main" aria-labelledby="class-MIDI::Measure">
|
85
|
+
<h1 id="class-MIDI::Measure" class="class">
|
86
|
+
class MIDI::Measure
|
87
|
+
</h1>
|
99
88
|
|
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">
|
89
|
+
<section class="description">
|
198
90
|
|
199
|
-
<p>The <a href="Measure.html">Measure</a> class contains information about a
|
200
|
-
measure from the sequence. The measure data is based on the time signature
|
201
|
-
information from the sequence and is not stored in the sequence itself</p>
|
91
|
+
<p>The <a href="Measure.html"><code>Measure</code></a> class contains information about a measure from the sequence. The measure data is based on the time signature information from the sequence and is not stored in the sequence itself</p>
|
202
92
|
|
203
|
-
</
|
93
|
+
</section>
|
204
94
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
95
|
<section id="5Buntitled-5D" class="documentation-section">
|
209
|
-
|
210
96
|
|
211
|
-
|
212
97
|
|
213
|
-
|
214
98
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
99
|
+
<section class="attribute-method-details" class="method-section">
|
100
|
+
<header>
|
101
|
+
<h3>Attributes</h3>
|
102
|
+
</header>
|
219
103
|
|
220
|
-
|
221
104
|
<div id="attribute-i-denominator" class="method-detail">
|
222
105
|
<div class="method-heading attribute-method-heading">
|
223
106
|
<span class="method-name">denominator</span><span
|
@@ -225,12 +108,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
225
108
|
</div>
|
226
109
|
|
227
110
|
<div class="method-description">
|
228
|
-
|
229
|
-
<p>The denominator for the measure's time signature</p>
|
230
|
-
|
111
|
+
<p>The denominator for the measure’s time signature</p>
|
231
112
|
</div>
|
232
113
|
</div>
|
233
|
-
|
234
114
|
<div id="attribute-i-end" class="method-detail">
|
235
115
|
<div class="method-heading attribute-method-heading">
|
236
116
|
<span class="method-name">end</span><span
|
@@ -238,12 +118,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
238
118
|
</div>
|
239
119
|
|
240
120
|
<div class="method-description">
|
241
|
-
|
242
121
|
<p>End clock tick for the measure (inclusive)</p>
|
243
|
-
|
244
122
|
</div>
|
245
123
|
</div>
|
246
|
-
|
247
124
|
<div id="attribute-i-measure_number" class="method-detail">
|
248
125
|
<div class="method-heading attribute-method-heading">
|
249
126
|
<span class="method-name">measure_number</span><span
|
@@ -251,12 +128,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
251
128
|
</div>
|
252
129
|
|
253
130
|
<div class="method-description">
|
254
|
-
|
255
131
|
<p>The measure number (1-based)</p>
|
256
|
-
|
257
132
|
</div>
|
258
133
|
</div>
|
259
|
-
|
260
134
|
<div id="attribute-i-metronome_ticks" class="method-detail">
|
261
135
|
<div class="method-heading attribute-method-heading">
|
262
136
|
<span class="method-name">metronome_ticks</span><span
|
@@ -264,12 +138,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
264
138
|
</div>
|
265
139
|
|
266
140
|
<div class="method-description">
|
267
|
-
|
268
141
|
<p>The metronome tick for the measure</p>
|
269
|
-
|
270
142
|
</div>
|
271
143
|
</div>
|
272
|
-
|
273
144
|
<div id="attribute-i-numerator" class="method-detail">
|
274
145
|
<div class="method-heading attribute-method-heading">
|
275
146
|
<span class="method-name">numerator</span><span
|
@@ -277,12 +148,9 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
277
148
|
</div>
|
278
149
|
|
279
150
|
<div class="method-description">
|
280
|
-
|
281
|
-
<p>The numerator (top digit) for the measure's time signature</p>
|
282
|
-
|
151
|
+
<p>The numerator (top digit) for the measure’s time signature</p>
|
283
152
|
</div>
|
284
153
|
</div>
|
285
|
-
|
286
154
|
<div id="attribute-i-start" class="method-detail">
|
287
155
|
<div class="method-heading attribute-method-heading">
|
288
156
|
<span class="method-name">start</span><span
|
@@ -290,134 +158,103 @@ information from the sequence and is not stored in the sequence itself</p>
|
|
290
158
|
</div>
|
291
159
|
|
292
160
|
<div class="method-description">
|
293
|
-
|
294
|
-
<p><a href="Start.html">Start</a> clock tick for the measure</p>
|
295
|
-
|
161
|
+
<p><a href="Start.html"><code>Start</code></a> clock tick for the measure</p>
|
296
162
|
</div>
|
297
163
|
</div>
|
298
|
-
|
299
|
-
</section><!-- attribute-method-details -->
|
300
|
-
|
164
|
+
</section>
|
301
165
|
|
302
|
-
<!-- Methods -->
|
303
|
-
|
304
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
305
|
-
<h3 class="section-header">Public Class Methods</h3>
|
306
166
|
|
307
|
-
|
167
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
168
|
+
<header>
|
169
|
+
<h3>Public Class Methods</h3>
|
170
|
+
</header>
|
171
|
+
|
308
172
|
<div id="method-c-new" class="method-detail ">
|
309
|
-
|
310
173
|
<div class="method-heading">
|
311
174
|
<span class="method-name">new</span><span
|
312
175
|
class="method-args">(meas_no, start_time, duration, numer, denom, met_ticks)</span>
|
313
176
|
<span class="method-click-advice">click to toggle source</span>
|
314
177
|
</div>
|
315
|
-
|
316
178
|
|
317
179
|
<div class="method-description">
|
318
|
-
|
319
180
|
<p>Constructor</p>
|
320
|
-
|
321
181
|
|
322
|
-
|
323
182
|
<div class="method-source-code" id="new-source">
|
324
|
-
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line
|
325
|
-
<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
|
-
|
183
|
+
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 22</span>
|
184
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
185
|
+
<span class="ruby-ivar">@measure_number</span> = <span class="ruby-identifier">meas_no</span>
|
186
|
+
<span class="ruby-ivar">@start</span> = <span class="ruby-identifier">start_time</span>
|
187
|
+
<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>
|
188
|
+
<span class="ruby-ivar">@numerator</span> = <span class="ruby-identifier">numer</span>
|
189
|
+
<span class="ruby-ivar">@denominator</span> = <span class="ruby-identifier">denom</span>
|
190
|
+
<span class="ruby-ivar">@metronome_ticks</span> = <span class="ruby-identifier">met_ticks</span>
|
332
191
|
<span class="ruby-keyword">end</span></pre>
|
333
|
-
</div
|
334
|
-
|
192
|
+
</div>
|
335
193
|
</div>
|
336
194
|
|
337
|
-
|
338
195
|
|
339
|
-
|
340
|
-
</div><!-- new-method -->
|
196
|
+
</div>
|
341
197
|
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
198
|
+
</section>
|
199
|
+
|
200
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
201
|
+
<header>
|
202
|
+
<h3>Public Instance Methods</h3>
|
203
|
+
</header>
|
347
204
|
|
348
|
-
|
349
205
|
<div id="method-i-contains_event-3F" class="method-detail ">
|
350
|
-
|
351
206
|
<div class="method-heading">
|
352
207
|
<span class="method-name">contains_event?</span><span
|
353
208
|
class="method-args">(e)</span>
|
354
209
|
<span class="method-click-advice">click to toggle source</span>
|
355
210
|
</div>
|
356
|
-
|
357
211
|
|
358
212
|
<div class="method-description">
|
359
|
-
|
360
213
|
<p>Returns <code>true</code> if the event is in the measure</p>
|
361
|
-
|
362
214
|
|
363
|
-
|
364
215
|
<div class="method-source-code" id="contains_event-3F-source">
|
365
|
-
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line
|
366
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">contains_event?</span>(<span class="ruby-identifier">e</span>)
|
367
|
-
|
216
|
+
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 39</span>
|
217
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">contains_event?</span>(<span class="ruby-identifier">e</span>)
|
218
|
+
(<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
219
|
<span class="ruby-keyword">end</span></pre>
|
369
|
-
</div
|
370
|
-
|
220
|
+
</div>
|
371
221
|
</div>
|
372
222
|
|
373
|
-
|
374
223
|
|
375
|
-
|
376
|
-
</div><!-- contains_event-3F-method -->
|
224
|
+
</div>
|
377
225
|
|
378
|
-
|
379
226
|
<div id="method-i-to_s" class="method-detail ">
|
380
|
-
|
381
227
|
<div class="method-heading">
|
382
228
|
<span class="method-name">to_s</span><span
|
383
229
|
class="method-args">()</span>
|
384
230
|
<span class="method-click-advice">click to toggle source</span>
|
385
231
|
</div>
|
386
|
-
|
387
232
|
|
388
233
|
<div class="method-description">
|
389
|
-
|
390
234
|
<p>Returns a detailed string with information about the measure</p>
|
391
|
-
|
392
235
|
|
393
|
-
|
394
236
|
<div class="method-source-code" id="to_s-source">
|
395
|
-
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line
|
396
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
397
|
-
<span class="ruby-identifier">t</span> = <span class="ruby-node">"#{@numerator}/#{2**@denominator}"</span>
|
398
|
-
<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
|
-
<span class="ruby-node">"measure #{@measure_number} #{@start}-#{@end} #{t} #{m} qs metronome"</span>
|
237
|
+
<pre><span class="ruby-comment"># File lib/midilib/measure.rb, line 32</span>
|
238
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
239
|
+
<span class="ruby-identifier">t</span> = <span class="ruby-node">"#{@numerator}/#{2**@denominator}"</span>
|
240
|
+
<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>
|
241
|
+
<span class="ruby-node">"measure #{@measure_number} #{@start}-#{@end} #{t} #{m} qs metronome"</span>
|
400
242
|
<span class="ruby-keyword">end</span></pre>
|
401
|
-
</div
|
402
|
-
|
243
|
+
</div>
|
403
244
|
</div>
|
404
245
|
|
405
|
-
|
406
246
|
|
407
|
-
|
408
|
-
</div><!-- to_s-method -->
|
247
|
+
</div>
|
409
248
|
|
410
|
-
|
411
|
-
</section><!-- public-instance-method-details -->
|
412
|
-
|
413
|
-
</section><!-- 5Buntitled-5D -->
|
249
|
+
</section>
|
414
250
|
|
415
|
-
</
|
251
|
+
</section>
|
252
|
+
</main>
|
416
253
|
|
417
254
|
|
418
|
-
<footer id="validator-badges">
|
419
|
-
<p><a href="
|
420
|
-
<p>Generated by <a href="https://github.
|
421
|
-
<p>
|
255
|
+
<footer id="validator-badges" role="contentinfo">
|
256
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
257
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
258
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
422
259
|
</footer>
|
423
260
|
|