midilib 2.0.4 → 2.0.5
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 +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/TimeSig.html
CHANGED
@@ -2,211 +2,104 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class MIDI::TimeSig - 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
|
+
|
19
|
+
|
21
20
|
|
21
|
+
<body id="top" role="document" class="class">
|
22
|
+
<nav role="navigation">
|
23
|
+
<div id="project-navigation">
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
+
<h2>
|
26
|
+
<a href="../index.html" rel="home">Home</a>
|
27
|
+
</h2>
|
22
28
|
|
23
|
-
<
|
24
|
-
<
|
25
|
-
<nav id="home-section" class="section">
|
26
|
-
<h3 class="section-header">
|
27
|
-
<a href="../index.html">Home</a>
|
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>
|
43
|
+
</div>
|
44
44
|
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
46
|
+
aria-busy="false" aria-expanded="false"
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
+
</form>
|
49
|
+
</div>
|
45
50
|
|
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
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"><a href="MetaEvent.html">MIDI::MetaEvent</a>
|
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-data_as_bytes">#data_as_bytes</a>
|
75
|
+
<li ><a href="#method-i-data_as_bytes">#data_as_bytes</a>
|
76
76
|
|
77
|
-
<li><a href="#method-i-denominator">#denominator</a>
|
77
|
+
<li ><a href="#method-i-denominator">#denominator</a>
|
78
78
|
|
79
|
-
<li><a href="#method-i-measure_duration">#measure_duration</a>
|
79
|
+
<li ><a href="#method-i-measure_duration">#measure_duration</a>
|
80
80
|
|
81
|
-
<li><a href="#method-i-metronome_ticks">#metronome_ticks</a>
|
81
|
+
<li ><a href="#method-i-metronome_ticks">#metronome_ticks</a>
|
82
82
|
|
83
|
-
<li><a href="#method-i-numerator">#numerator</a>
|
83
|
+
<li ><a href="#method-i-numerator">#numerator</a>
|
84
84
|
|
85
|
-
<li><a href="#method-i-to_s">#to_s</a>
|
85
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
86
86
|
|
87
87
|
</ul>
|
88
|
-
</
|
88
|
+
</div>
|
89
89
|
|
90
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
91
|
</nav>
|
104
92
|
|
105
|
-
|
106
|
-
<
|
93
|
+
<main role="main" aria-labelledby="class-MIDI::TimeSig">
|
94
|
+
<h1 id="class-MIDI::TimeSig" class="class">
|
95
|
+
class MIDI::TimeSig
|
96
|
+
</h1>
|
107
97
|
|
108
|
-
<
|
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>
|
198
|
-
|
199
|
-
</div>
|
200
|
-
</nav>
|
201
|
-
|
202
|
-
<div id="documentation">
|
203
|
-
<h1 class="class">class MIDI::TimeSig</h1>
|
204
|
-
|
205
|
-
<div id="description" class="description">
|
98
|
+
<section class="description">
|
206
99
|
|
207
100
|
<p>Container for time signature events</p>
|
208
101
|
|
209
|
-
</
|
102
|
+
</section>
|
210
103
|
|
211
104
|
|
212
105
|
|
@@ -220,10 +113,11 @@
|
|
220
113
|
|
221
114
|
|
222
115
|
|
223
|
-
<!-- Methods -->
|
224
116
|
|
225
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section
|
226
|
-
|
117
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
118
|
+
<header>
|
119
|
+
<h3>Public Class Methods</h3>
|
120
|
+
</header>
|
227
121
|
|
228
122
|
|
229
123
|
<div id="method-c-new" class="method-detail ">
|
@@ -231,7 +125,9 @@
|
|
231
125
|
<div class="method-heading">
|
232
126
|
<span class="method-name">new</span><span
|
233
127
|
class="method-args">(numer, denom, clocks, qnotes, delta_time = 0)</span>
|
128
|
+
|
234
129
|
<span class="method-click-advice">click to toggle source</span>
|
130
|
+
|
235
131
|
</div>
|
236
132
|
|
237
133
|
|
@@ -239,27 +135,35 @@
|
|
239
135
|
|
240
136
|
<p>Constructor</p>
|
241
137
|
|
138
|
+
|
139
|
+
<div class="method-calls-super">
|
140
|
+
Calls superclass method
|
141
|
+
<a href="MetaEvent.html#method-c-new">MIDI::MetaEvent.new</a>
|
142
|
+
</div>
|
143
|
+
|
242
144
|
|
243
145
|
|
244
146
|
<div class="method-source-code" id="new-source">
|
245
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
147
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 549</span>
|
246
148
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">numer</span>, <span class="ruby-identifier">denom</span>, <span class="ruby-identifier">clocks</span>, <span class="ruby-identifier">qnotes</span>, <span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
|
247
|
-
|
149
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-constant">META_TIME_SIG</span>, [<span class="ruby-identifier">numer</span>, <span class="ruby-identifier">denom</span>, <span class="ruby-identifier">clocks</span>, <span class="ruby-identifier">qnotes</span>], <span class="ruby-identifier">delta_time</span>)
|
248
150
|
<span class="ruby-keyword">end</span></pre>
|
249
|
-
</div
|
151
|
+
</div>
|
250
152
|
|
251
153
|
</div>
|
252
154
|
|
253
155
|
|
254
156
|
|
255
157
|
|
256
|
-
</div
|
158
|
+
</div>
|
257
159
|
|
258
160
|
|
259
|
-
</section
|
161
|
+
</section>
|
260
162
|
|
261
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
262
|
-
|
163
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
164
|
+
<header>
|
165
|
+
<h3>Public Instance Methods</h3>
|
166
|
+
</header>
|
263
167
|
|
264
168
|
|
265
169
|
<div id="method-i-data_as_bytes" class="method-detail ">
|
@@ -267,7 +171,9 @@
|
|
267
171
|
<div class="method-heading">
|
268
172
|
<span class="method-name">data_as_bytes</span><span
|
269
173
|
class="method-args">()</span>
|
174
|
+
|
270
175
|
<span class="method-click-advice">click to toggle source</span>
|
176
|
+
|
271
177
|
</div>
|
272
178
|
|
273
179
|
|
@@ -275,28 +181,29 @@
|
|
275
181
|
|
276
182
|
<p>Returns the complete event as stored in the sequence</p>
|
277
183
|
|
184
|
+
|
278
185
|
|
279
186
|
|
280
187
|
<div class="method-source-code" id="data_as_bytes-source">
|
281
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
188
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 554</span>
|
282
189
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_bytes</span>
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
190
|
+
<span class="ruby-identifier">data</span> = []
|
191
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@status</span>
|
192
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@meta_type</span>
|
193
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-value">4</span>
|
194
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>]
|
195
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>]
|
196
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">2</span>]
|
197
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">3</span>]
|
291
198
|
<span class="ruby-keyword">end</span></pre>
|
292
|
-
</div
|
199
|
+
</div>
|
293
200
|
|
294
201
|
</div>
|
295
202
|
|
296
203
|
|
297
204
|
|
298
205
|
|
299
|
-
</div
|
206
|
+
</div>
|
300
207
|
|
301
208
|
|
302
209
|
<div id="method-i-denominator" class="method-detail ">
|
@@ -304,7 +211,9 @@
|
|
304
211
|
<div class="method-heading">
|
305
212
|
<span class="method-name">denominator</span><span
|
306
213
|
class="method-args">()</span>
|
214
|
+
|
307
215
|
<span class="method-click-advice">click to toggle source</span>
|
216
|
+
|
308
217
|
</div>
|
309
218
|
|
310
219
|
|
@@ -313,21 +222,22 @@
|
|
313
222
|
<p>Returns the denominator of the time signature. Use it as a power of 2 to
|
314
223
|
get the displayed (lower-part) digit of the time signature.</p>
|
315
224
|
|
225
|
+
|
316
226
|
|
317
227
|
|
318
228
|
<div class="method-source-code" id="denominator-source">
|
319
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
229
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 577</span>
|
320
230
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">denominator</span>
|
321
|
-
|
231
|
+
<span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>]
|
322
232
|
<span class="ruby-keyword">end</span></pre>
|
323
|
-
</div
|
233
|
+
</div>
|
324
234
|
|
325
235
|
</div>
|
326
236
|
|
327
237
|
|
328
238
|
|
329
239
|
|
330
|
-
</div
|
240
|
+
</div>
|
331
241
|
|
332
242
|
|
333
243
|
<div id="method-i-measure_duration" class="method-detail ">
|
@@ -335,7 +245,9 @@ get the displayed (lower-part) digit of the time signature.</p>
|
|
335
245
|
<div class="method-heading">
|
336
246
|
<span class="method-name">measure_duration</span><span
|
337
247
|
class="method-args">(ppqn)</span>
|
248
|
+
|
338
249
|
<span class="method-click-advice">click to toggle source</span>
|
250
|
+
|
339
251
|
</div>
|
340
252
|
|
341
253
|
|
@@ -343,21 +255,22 @@ get the displayed (lower-part) digit of the time signature.</p>
|
|
343
255
|
|
344
256
|
<p>Calculates the duration (in ticks) for a full measure</p>
|
345
257
|
|
258
|
+
|
346
259
|
|
347
260
|
|
348
261
|
<div class="method-source-code" id="measure_duration-source">
|
349
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
350
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">measure_duration</span>(<span class="ruby-identifier">ppqn</span>)
|
351
|
-
|
262
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 566</span>
|
263
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">measure_duration</span>(<span class="ruby-identifier">ppqn</span>)
|
264
|
+
(<span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">ppqn</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>]) <span class="ruby-operator">/</span> (<span class="ruby-value">2</span><span class="ruby-operator">**</span><span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>])
|
352
265
|
<span class="ruby-keyword">end</span></pre>
|
353
|
-
</div
|
266
|
+
</div>
|
354
267
|
|
355
268
|
</div>
|
356
269
|
|
357
270
|
|
358
271
|
|
359
272
|
|
360
|
-
</div
|
273
|
+
</div>
|
361
274
|
|
362
275
|
|
363
276
|
<div id="method-i-metronome_ticks" class="method-detail ">
|
@@ -365,30 +278,33 @@ get the displayed (lower-part) digit of the time signature.</p>
|
|
365
278
|
<div class="method-heading">
|
366
279
|
<span class="method-name">metronome_ticks</span><span
|
367
280
|
class="method-args">()</span>
|
281
|
+
|
368
282
|
<span class="method-click-advice">click to toggle source</span>
|
283
|
+
|
369
284
|
</div>
|
370
285
|
|
371
286
|
|
372
287
|
<div class="method-description">
|
373
288
|
|
374
289
|
<p>Returns the metronome tick duration for the time signature. On each quarter
|
375
|
-
note, there
|
290
|
+
note, there's 24 ticks.</p>
|
291
|
+
|
376
292
|
|
377
293
|
|
378
294
|
|
379
295
|
<div class="method-source-code" id="metronome_ticks-source">
|
380
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
296
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 583</span>
|
381
297
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">metronome_ticks</span>
|
382
|
-
|
298
|
+
<span class="ruby-ivar">@data</span>[<span class="ruby-value">2</span>]
|
383
299
|
<span class="ruby-keyword">end</span></pre>
|
384
|
-
</div
|
300
|
+
</div>
|
385
301
|
|
386
302
|
</div>
|
387
303
|
|
388
304
|
|
389
305
|
|
390
306
|
|
391
|
-
</div
|
307
|
+
</div>
|
392
308
|
|
393
309
|
|
394
310
|
<div id="method-i-numerator" class="method-detail ">
|
@@ -396,7 +312,9 @@ note, there's 24 ticks.</p>
|
|
396
312
|
<div class="method-heading">
|
397
313
|
<span class="method-name">numerator</span><span
|
398
314
|
class="method-args">()</span>
|
315
|
+
|
399
316
|
<span class="method-click-advice">click to toggle source</span>
|
317
|
+
|
400
318
|
</div>
|
401
319
|
|
402
320
|
|
@@ -404,21 +322,22 @@ note, there's 24 ticks.</p>
|
|
404
322
|
|
405
323
|
<p>Returns the numerator (the top digit) for the time signature</p>
|
406
324
|
|
325
|
+
|
407
326
|
|
408
327
|
|
409
328
|
<div class="method-source-code" id="numerator-source">
|
410
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
329
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 571</span>
|
411
330
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">numerator</span>
|
412
|
-
|
331
|
+
<span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>]
|
413
332
|
<span class="ruby-keyword">end</span></pre>
|
414
|
-
</div
|
333
|
+
</div>
|
415
334
|
|
416
335
|
</div>
|
417
336
|
|
418
337
|
|
419
338
|
|
420
339
|
|
421
|
-
</div
|
340
|
+
</div>
|
422
341
|
|
423
342
|
|
424
343
|
<div id="method-i-to_s" class="method-detail ">
|
@@ -426,42 +345,44 @@ note, there's 24 ticks.</p>
|
|
426
345
|
<div class="method-heading">
|
427
346
|
<span class="method-name">to_s</span><span
|
428
347
|
class="method-args">()</span>
|
348
|
+
|
429
349
|
<span class="method-click-advice">click to toggle source</span>
|
350
|
+
|
430
351
|
</div>
|
431
352
|
|
432
353
|
|
433
354
|
<div class="method-description">
|
434
355
|
|
435
|
-
<p>Returns the time signature for the event as a string. Example:
|
436
|
-
3/4
|
356
|
+
<p>Returns the time signature for the event as a string. Example: “time sig
|
357
|
+
3/4”</p>
|
358
|
+
|
437
359
|
|
438
360
|
|
439
361
|
|
440
362
|
<div class="method-source-code" id="to_s-source">
|
441
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
363
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 589</span>
|
442
364
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
443
|
-
|
365
|
+
<span class="ruby-node">"time sig #{@data[0]}/#{2**@data[1]}"</span>
|
444
366
|
<span class="ruby-keyword">end</span></pre>
|
445
|
-
</div
|
367
|
+
</div>
|
446
368
|
|
447
369
|
</div>
|
448
370
|
|
449
371
|
|
450
372
|
|
451
373
|
|
452
|
-
</div
|
374
|
+
</div>
|
453
375
|
|
454
376
|
|
455
|
-
</section
|
377
|
+
</section>
|
456
378
|
|
457
|
-
</section
|
458
|
-
|
459
|
-
</div><!-- documentation -->
|
379
|
+
</section>
|
380
|
+
</main>
|
460
381
|
|
461
382
|
|
462
|
-
<footer id="validator-badges">
|
463
|
-
<p><a href="http://validator.w3.org/check/referer">
|
464
|
-
<p>Generated by <a href="
|
465
|
-
<p>
|
383
|
+
<footer id="validator-badges" role="contentinfo">
|
384
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
385
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
386
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
466
387
|
</footer>
|
467
388
|
|