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/Tempo.html
CHANGED
@@ -2,473 +2,291 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class MIDI::Tempo - midilib</title>
|
8
8
|
|
9
|
-
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
-
|
11
9
|
<script type="text/javascript">
|
12
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
13
12
|
</script>
|
14
13
|
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
<script
|
18
|
-
<script
|
19
|
-
<script
|
20
|
-
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
21
23
|
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
22
31
|
|
23
|
-
<
|
24
|
-
<
|
25
|
-
<nav id="home-section" class="section">
|
26
|
-
<h3 class="section-header">
|
27
|
-
<a href="../index.html">Home</a>
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
28
34
|
<a href="../table_of_contents.html#classes">Classes</a>
|
29
35
|
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
-
</
|
31
|
-
</
|
32
|
-
|
36
|
+
</div>
|
37
|
+
</div>
|
33
38
|
|
34
|
-
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
35
40
|
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<
|
37
|
-
<input
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
38
45
|
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
-
</
|
40
|
-
</form>
|
41
|
-
|
42
|
-
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
-
</nav>
|
46
|
+
</div>
|
44
47
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
45
53
|
|
46
|
-
<div id="file-metadata">
|
47
|
-
<nav id="file-list-section" class="section">
|
48
|
-
<h3 class="section-header">Defined In</h3>
|
49
|
-
<ul>
|
50
|
-
<li>lib/midilib/event.rb
|
51
|
-
</ul>
|
52
|
-
</nav>
|
53
|
-
|
54
|
-
|
55
54
|
</div>
|
56
55
|
|
57
|
-
<div id="class-metadata">
|
58
|
-
|
59
|
-
<nav id="parent-class-section" class="section">
|
60
|
-
<h3 class="section-header">Parent</h3>
|
61
|
-
|
62
|
-
<p class="link"><a href="MetaEvent.html">MIDI::MetaEvent</a>
|
63
56
|
|
64
|
-
</nav>
|
65
|
-
|
66
|
-
|
67
|
-
<!-- Method Quickref -->
|
68
|
-
<nav id="method-list-section" class="section">
|
69
|
-
<h3 class="section-header">Methods</h3>
|
70
57
|
|
71
|
-
<
|
72
|
-
|
73
|
-
<li><a href="#method-c-bpm_to_mpq">::bpm_to_mpq</a>
|
74
|
-
|
75
|
-
<li><a href="#method-c-mpq_to_bpm">::mpq_to_bpm</a>
|
76
|
-
|
77
|
-
<li><a href="#method-c-new">::new</a>
|
58
|
+
<div id="class-metadata">
|
78
59
|
|
79
|
-
<li><a href="#method-i-data_as_bytes">#data_as_bytes</a>
|
80
60
|
|
81
|
-
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="MetaEvent.html">MIDI::MetaEvent</a>
|
65
|
+
</div>
|
66
|
+
|
82
67
|
|
83
|
-
<li><a href="#method-i-tempo-3D">#tempo=</a>
|
84
68
|
|
85
|
-
<li><a href="#method-i-to_s">#to_s</a>
|
86
69
|
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-c-bpm_to_mpq">::bpm_to_mpq</a>
|
76
|
+
<li ><a href="#method-c-mpq_to_bpm">::mpq_to_bpm</a>
|
77
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
78
|
+
<li ><a href="#method-i-data_as_bytes">#data_as_bytes</a>
|
79
|
+
<li ><a href="#method-i-tempo">#tempo</a>
|
80
|
+
<li ><a href="#method-i-tempo-3D">#tempo=</a>
|
81
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
87
82
|
</ul>
|
88
|
-
</
|
89
|
-
|
90
|
-
</div>
|
91
|
-
|
92
|
-
<div id="project-metadata">
|
93
|
-
<nav id="fileindex-section" class="section project-section">
|
94
|
-
<h3 class="section-header">Pages</h3>
|
95
|
-
|
96
|
-
<ul>
|
97
|
-
|
98
|
-
<li class="file"><a href="../README_rdoc.html">README</a>
|
99
|
-
|
100
|
-
<li class="file"><a href="../TODO_rdoc.html">TODO</a>
|
101
|
-
|
102
|
-
</ul>
|
103
|
-
</nav>
|
104
|
-
|
105
|
-
<nav id="classindex-section" class="section project-section">
|
106
|
-
<h3 class="section-header">Class and Module Index</h3>
|
107
|
-
|
108
|
-
<ul class="link-list">
|
109
|
-
|
110
|
-
<li><a href="../MIDI.html">MIDI</a>
|
111
|
-
|
112
|
-
<li><a href="../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
|
113
|
-
|
114
|
-
<li><a href="../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
|
115
|
-
|
116
|
-
<li><a href="../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
|
117
|
-
|
118
|
-
<li><a href="../MIDI/Clock.html">MIDI::Clock</a>
|
119
|
-
|
120
|
-
<li><a href="../MIDI/Continue.html">MIDI::Continue</a>
|
121
|
-
|
122
|
-
<li><a href="../MIDI/Controller.html">MIDI::Controller</a>
|
123
|
-
|
124
|
-
<li><a href="../MIDI/Event.html">MIDI::Event</a>
|
125
|
-
|
126
|
-
<li><a href="../MIDI/IO.html">MIDI::IO</a>
|
127
|
-
|
128
|
-
<li><a href="../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
|
129
|
-
|
130
|
-
<li><a href="../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
|
131
|
-
|
132
|
-
<li><a href="../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
|
133
|
-
|
134
|
-
<li><a href="../MIDI/KeySig.html">MIDI::KeySig</a>
|
135
|
-
|
136
|
-
<li><a href="../MIDI/MIDI.html">MIDI::MIDI</a>
|
137
|
-
|
138
|
-
<li><a href="../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
|
139
|
-
|
140
|
-
<li><a href="../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
|
141
|
-
|
142
|
-
<li><a href="../MIDI/Marker.html">MIDI::Marker</a>
|
143
|
-
|
144
|
-
<li><a href="../MIDI/Measure.html">MIDI::Measure</a>
|
145
|
-
|
146
|
-
<li><a href="../MIDI/Measures.html">MIDI::Measures</a>
|
147
|
-
|
148
|
-
<li><a href="../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
|
149
|
-
|
150
|
-
<li><a href="../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
|
151
|
-
|
152
|
-
<li><a href="../MIDI/NoteOff.html">MIDI::NoteOff</a>
|
153
|
-
|
154
|
-
<li><a href="../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
|
155
|
-
|
156
|
-
<li><a href="../MIDI/NoteOn.html">MIDI::NoteOn</a>
|
157
|
-
|
158
|
-
<li><a href="../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
|
159
|
-
|
160
|
-
<li><a href="../MIDI/PitchBend.html">MIDI::PitchBend</a>
|
161
|
-
|
162
|
-
<li><a href="../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
|
163
|
-
|
164
|
-
<li><a href="../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
|
165
|
-
|
166
|
-
<li><a href="../MIDI/Realtime.html">MIDI::Realtime</a>
|
167
|
-
|
168
|
-
<li><a href="../MIDI/Sequence.html">MIDI::Sequence</a>
|
169
|
-
|
170
|
-
<li><a href="../MIDI/SongPointer.html">MIDI::SongPointer</a>
|
171
|
-
|
172
|
-
<li><a href="../MIDI/SongSelect.html">MIDI::SongSelect</a>
|
173
|
-
|
174
|
-
<li><a href="../MIDI/Start.html">MIDI::Start</a>
|
175
|
-
|
176
|
-
<li><a href="../MIDI/Stop.html">MIDI::Stop</a>
|
177
|
-
|
178
|
-
<li><a href="../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
|
179
|
-
|
180
|
-
<li><a href="../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
|
181
|
-
|
182
|
-
<li><a href="../MIDI/SystemReset.html">MIDI::SystemReset</a>
|
183
|
-
|
184
|
-
<li><a href="../MIDI/Tempo.html">MIDI::Tempo</a>
|
185
|
-
|
186
|
-
<li><a href="../MIDI/TimeSig.html">MIDI::TimeSig</a>
|
187
|
-
|
188
|
-
<li><a href="../MIDI/Track.html">MIDI::Track</a>
|
189
|
-
|
190
|
-
<li><a href="../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
|
191
|
-
|
192
|
-
<li><a href="../MIDI/Utils.html">MIDI::Utils</a>
|
193
|
-
|
194
|
-
<li><a href="../IO.html">IO</a>
|
195
|
-
|
196
|
-
</ul>
|
197
|
-
</nav>
|
83
|
+
</div>
|
198
84
|
|
199
85
|
</div>
|
200
86
|
</nav>
|
201
87
|
|
202
|
-
<
|
203
|
-
<h1
|
88
|
+
<main role="main" aria-labelledby="class-MIDI::Tempo">
|
89
|
+
<h1 id="class-MIDI::Tempo" class="class">
|
90
|
+
class MIDI::Tempo
|
91
|
+
</h1>
|
204
92
|
|
205
|
-
<
|
93
|
+
<section class="description">
|
206
94
|
|
207
|
-
</
|
95
|
+
</section>
|
208
96
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
97
|
<section id="5Buntitled-5D" class="documentation-section">
|
213
|
-
|
214
98
|
|
215
|
-
|
216
99
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
100
|
+
<section class="constants-list">
|
101
|
+
<header>
|
102
|
+
<h3>Constants</h3>
|
103
|
+
</header>
|
221
104
|
<dl>
|
222
|
-
|
223
105
|
<dt id="MICROSECS_PER_MINUTE">MICROSECS_PER_MINUTE
|
224
|
-
|
225
|
-
<dd class="description">
|
226
|
-
|
227
|
-
|
106
|
+
<dd>
|
228
107
|
</dl>
|
229
108
|
</section>
|
230
|
-
|
231
109
|
|
232
|
-
|
233
110
|
|
234
|
-
<!-- Methods -->
|
235
|
-
|
236
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
237
|
-
<h3 class="section-header">Public Class Methods</h3>
|
238
111
|
|
239
|
-
|
112
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
113
|
+
<header>
|
114
|
+
<h3>Public Class Methods</h3>
|
115
|
+
</header>
|
116
|
+
|
240
117
|
<div id="method-c-bpm_to_mpq" class="method-detail ">
|
241
|
-
|
242
118
|
<div class="method-heading">
|
243
119
|
<span class="method-name">bpm_to_mpq</span><span
|
244
120
|
class="method-args">(bpm)</span>
|
245
121
|
<span class="method-click-advice">click to toggle source</span>
|
246
122
|
</div>
|
247
|
-
|
248
123
|
|
249
124
|
<div class="method-description">
|
250
|
-
|
251
125
|
<p>Translates beats per minute to microseconds per quarter note (beat).</p>
|
252
|
-
|
253
126
|
|
254
|
-
|
255
127
|
<div class="method-source-code" id="bpm_to_mpq-source">
|
256
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
257
|
-
<span class="ruby-keyword">def</span> <span class="ruby-
|
258
|
-
|
128
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 509</span>
|
129
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">bpm_to_mpq</span>(<span class="ruby-identifier">bpm</span>)
|
130
|
+
<span class="ruby-constant">MICROSECS_PER_MINUTE</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">bpm</span>
|
259
131
|
<span class="ruby-keyword">end</span></pre>
|
260
|
-
</div
|
261
|
-
|
132
|
+
</div>
|
262
133
|
</div>
|
263
134
|
|
264
|
-
|
265
135
|
|
266
|
-
|
267
|
-
</div><!-- bpm_to_mpq-method -->
|
136
|
+
</div>
|
268
137
|
|
269
|
-
|
270
138
|
<div id="method-c-mpq_to_bpm" class="method-detail ">
|
271
|
-
|
272
139
|
<div class="method-heading">
|
273
140
|
<span class="method-name">mpq_to_bpm</span><span
|
274
141
|
class="method-args">(mpq)</span>
|
275
142
|
<span class="method-click-advice">click to toggle source</span>
|
276
143
|
</div>
|
277
|
-
|
278
144
|
|
279
145
|
<div class="method-description">
|
280
|
-
|
281
146
|
<p>Translates microseconds per quarter note (beat) to beats per minute.</p>
|
282
|
-
|
283
147
|
|
284
|
-
|
285
148
|
<div class="method-source-code" id="mpq_to_bpm-source">
|
286
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
287
|
-
<span class="ruby-keyword">def</span> <span class="ruby-
|
288
|
-
|
149
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 514</span>
|
150
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">mpq_to_bpm</span>(<span class="ruby-identifier">mpq</span>)
|
151
|
+
<span class="ruby-constant">MICROSECS_PER_MINUTE</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">mpq</span>.<span class="ruby-identifier">to_f</span>
|
289
152
|
<span class="ruby-keyword">end</span></pre>
|
290
|
-
</div
|
291
|
-
|
153
|
+
</div>
|
292
154
|
</div>
|
293
155
|
|
294
|
-
|
295
156
|
|
296
|
-
|
297
|
-
</div><!-- mpq_to_bpm-method -->
|
157
|
+
</div>
|
298
158
|
|
299
|
-
|
300
159
|
<div id="method-c-new" class="method-detail ">
|
301
|
-
|
302
160
|
<div class="method-heading">
|
303
161
|
<span class="method-name">new</span><span
|
304
162
|
class="method-args">(msecs_per_qnote, delta_time = 0)</span>
|
305
163
|
<span class="method-click-advice">click to toggle source</span>
|
306
164
|
</div>
|
307
|
-
|
308
165
|
|
309
166
|
<div class="method-description">
|
310
167
|
|
311
|
-
|
312
|
-
|
168
|
+
<div class="method-calls-super">
|
169
|
+
Calls superclass method
|
170
|
+
<a href="MetaEvent.html#method-c-new"><code>MIDI::MetaEvent::new</code></a>
|
171
|
+
</div>
|
313
172
|
|
314
|
-
|
315
173
|
<div class="method-source-code" id="new-source">
|
316
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
317
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msecs_per_qnote</span>, <span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
|
318
|
-
|
174
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 518</span>
|
175
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">msecs_per_qnote</span>, <span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
|
176
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-constant">META_SET_TEMPO</span>, <span class="ruby-identifier">msecs_per_qnote</span>, <span class="ruby-identifier">delta_time</span>)
|
319
177
|
<span class="ruby-keyword">end</span></pre>
|
320
|
-
</div
|
321
|
-
|
178
|
+
</div>
|
322
179
|
</div>
|
323
180
|
|
324
|
-
|
325
181
|
|
326
|
-
|
327
|
-
</div><!-- new-method -->
|
182
|
+
</div>
|
328
183
|
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
184
|
+
</section>
|
185
|
+
|
186
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
187
|
+
<header>
|
188
|
+
<h3>Public Instance Methods</h3>
|
189
|
+
</header>
|
334
190
|
|
335
|
-
|
336
191
|
<div id="method-i-data_as_bytes" class="method-detail ">
|
337
|
-
|
338
192
|
<div class="method-heading">
|
339
193
|
<span class="method-name">data_as_bytes</span><span
|
340
194
|
class="method-args">()</span>
|
341
195
|
<span class="method-click-advice">click to toggle source</span>
|
342
196
|
</div>
|
343
|
-
|
344
197
|
|
345
198
|
<div class="method-description">
|
346
199
|
|
347
|
-
|
348
|
-
|
349
200
|
|
350
|
-
|
351
201
|
<div class="method-source-code" id="data_as_bytes-source">
|
352
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
353
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_bytes</span>
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
202
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 530</span>
|
203
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">data_as_bytes</span>
|
204
|
+
<span class="ruby-identifier">data</span> = []
|
205
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@status</span>
|
206
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@meta_type</span>
|
207
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-value">3</span>
|
208
|
+
<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-value">16</span>) <span class="ruby-operator">&</span> <span class="ruby-value">0xff</span>)
|
209
|
+
<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-value">8</span>) <span class="ruby-operator">&</span> <span class="ruby-value">0xff</span>)
|
210
|
+
<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-value">0xff</span>)
|
361
211
|
<span class="ruby-keyword">end</span></pre>
|
362
|
-
</div
|
363
|
-
|
212
|
+
</div>
|
364
213
|
</div>
|
365
214
|
|
366
|
-
|
367
215
|
|
368
|
-
|
369
|
-
</div><!-- data_as_bytes-method -->
|
216
|
+
</div>
|
370
217
|
|
371
|
-
|
372
218
|
<div id="method-i-tempo" class="method-detail ">
|
373
|
-
|
374
219
|
<div class="method-heading">
|
375
220
|
<span class="method-name">tempo</span><span
|
376
221
|
class="method-args">()</span>
|
377
222
|
<span class="method-click-advice">click to toggle source</span>
|
378
223
|
</div>
|
379
|
-
|
380
224
|
|
381
225
|
<div class="method-description">
|
382
226
|
|
383
|
-
|
384
|
-
|
385
227
|
|
386
|
-
|
387
228
|
<div class="method-source-code" id="tempo-source">
|
388
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
389
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">tempo</span>
|
390
|
-
|
229
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 522</span>
|
230
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tempo</span>
|
231
|
+
<span class="ruby-ivar">@data</span>
|
391
232
|
<span class="ruby-keyword">end</span></pre>
|
392
|
-
</div
|
393
|
-
|
233
|
+
</div>
|
394
234
|
</div>
|
395
235
|
|
396
|
-
|
397
236
|
|
398
|
-
|
399
|
-
</div><!-- tempo-method -->
|
237
|
+
</div>
|
400
238
|
|
401
|
-
|
402
239
|
<div id="method-i-tempo-3D" class="method-detail ">
|
403
|
-
|
404
240
|
<div class="method-heading">
|
405
241
|
<span class="method-name">tempo=</span><span
|
406
242
|
class="method-args">(val)</span>
|
407
243
|
<span class="method-click-advice">click to toggle source</span>
|
408
244
|
</div>
|
409
|
-
|
410
245
|
|
411
246
|
<div class="method-description">
|
412
247
|
|
413
|
-
|
414
|
-
|
415
248
|
|
416
|
-
|
417
249
|
<div class="method-source-code" id="tempo-3D-source">
|
418
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
419
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">tempo=</span>(<span class="ruby-identifier">val</span>)
|
420
|
-
|
250
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 526</span>
|
251
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tempo=</span>(<span class="ruby-identifier">val</span>)
|
252
|
+
<span class="ruby-ivar">@data</span> = <span class="ruby-identifier">val</span>
|
421
253
|
<span class="ruby-keyword">end</span></pre>
|
422
|
-
</div
|
423
|
-
|
254
|
+
</div>
|
424
255
|
</div>
|
425
256
|
|
426
|
-
|
427
257
|
|
428
|
-
|
429
|
-
</div><!-- tempo-3D-method -->
|
258
|
+
</div>
|
430
259
|
|
431
|
-
|
432
260
|
<div id="method-i-to_s" class="method-detail ">
|
433
|
-
|
434
261
|
<div class="method-heading">
|
435
262
|
<span class="method-name">to_s</span><span
|
436
263
|
class="method-args">()</span>
|
437
264
|
<span class="method-click-advice">click to toggle source</span>
|
438
265
|
</div>
|
439
|
-
|
440
266
|
|
441
267
|
<div class="method-description">
|
442
268
|
|
443
|
-
|
444
|
-
|
445
269
|
|
446
|
-
|
447
270
|
<div class="method-source-code" id="to_s-source">
|
448
|
-
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line
|
449
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
450
|
-
|
271
|
+
<pre><span class="ruby-comment"># File lib/midilib/event.rb, line 540</span>
|
272
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
273
|
+
<span class="ruby-node">"tempo #{@data} msecs per qnote (#{Tempo.mpq_to_bpm(@data)} bpm)"</span>
|
451
274
|
<span class="ruby-keyword">end</span></pre>
|
452
|
-
</div
|
453
|
-
|
275
|
+
</div>
|
454
276
|
</div>
|
455
277
|
|
456
|
-
|
457
278
|
|
458
|
-
|
459
|
-
</div><!-- to_s-method -->
|
279
|
+
</div>
|
460
280
|
|
461
|
-
|
462
|
-
</section><!-- public-instance-method-details -->
|
463
|
-
|
464
|
-
</section><!-- 5Buntitled-5D -->
|
281
|
+
</section>
|
465
282
|
|
466
|
-
</
|
283
|
+
</section>
|
284
|
+
</main>
|
467
285
|
|
468
286
|
|
469
|
-
<footer id="validator-badges">
|
470
|
-
<p><a href="
|
471
|
-
<p>Generated by <a href="https://github.
|
472
|
-
<p>
|
287
|
+
<footer id="validator-badges" role="contentinfo">
|
288
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
289
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
290
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
473
291
|
</footer>
|
474
292
|
|