midilib 1.2.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/ChangeLog +3 -1
  2. data/Credits +6 -1
  3. data/README.rdoc +41 -15
  4. data/Rakefile +3 -11
  5. data/TODO.rdoc +4 -7
  6. data/examples/from_scratch.rb +2 -2
  7. data/examples/measures_mbt.rb +1 -1
  8. data/examples/print_program_changes.rb +1 -1
  9. data/examples/strings.rb +1 -1
  10. data/examples/transpose.rb +1 -1
  11. data/html/Array.html +382 -0
  12. data/html/IO.html +277 -0
  13. data/html/MIDI.html +829 -0
  14. data/html/MIDI/ActiveSense.html +317 -0
  15. data/html/MIDI/ChannelEvent.html +347 -0
  16. data/html/MIDI/ChannelPressure.html +379 -0
  17. data/html/MIDI/Clock.html +317 -0
  18. data/html/MIDI/Continue.html +317 -0
  19. data/html/MIDI/Controller.html +398 -0
  20. data/html/MIDI/Event.html +659 -0
  21. data/html/MIDI/IO.html +238 -0
  22. data/html/MIDI/IO/MIDIFile.html +2269 -0
  23. data/html/MIDI/IO/SeqReader.html +1051 -0
  24. data/html/MIDI/IO/SeqWriter.html +706 -0
  25. data/html/MIDI/KeySig.html +487 -0
  26. data/html/MIDI/Marker.html +275 -0
  27. data/html/MIDI/Measure.html +479 -0
  28. data/html/MIDI/Measures.html +416 -0
  29. data/html/MIDI/MetaEvent.html +617 -0
  30. data/html/MIDI/NoteEvent.html +459 -0
  31. data/html/MIDI/NoteOff.html +341 -0
  32. data/html/MIDI/NoteOn.html +341 -0
  33. data/html/MIDI/PitchBend.html +380 -0
  34. data/html/MIDI/PolyPressure.html +390 -0
  35. data/html/MIDI/ProgramChange.html +379 -0
  36. data/html/MIDI/Realtime.html +354 -0
  37. data/html/MIDI/Sequence.html +1063 -0
  38. data/html/MIDI/SongPointer.html +380 -0
  39. data/html/MIDI/SongSelect.html +379 -0
  40. data/html/MIDI/Start.html +317 -0
  41. data/html/MIDI/Stop.html +317 -0
  42. data/html/MIDI/SystemCommon.html +275 -0
  43. data/html/MIDI/SystemExclusive.html +382 -0
  44. data/html/MIDI/SystemReset.html +317 -0
  45. data/html/MIDI/Tempo.html +519 -0
  46. data/html/MIDI/TimeSig.html +524 -0
  47. data/html/MIDI/Track.html +859 -0
  48. data/html/MIDI/TuneRequest.html +354 -0
  49. data/html/MIDI/Utils.html +350 -0
  50. data/html/README_rdoc.html +882 -0
  51. data/html/TODO_rdoc.html +215 -0
  52. data/html/created.rid +14 -0
  53. data/html/images/brick.png +0 -0
  54. data/html/images/brick_link.png +0 -0
  55. data/html/images/bug.png +0 -0
  56. data/html/images/bullet_black.png +0 -0
  57. data/html/images/bullet_toggle_minus.png +0 -0
  58. data/html/images/bullet_toggle_plus.png +0 -0
  59. data/html/images/date.png +0 -0
  60. data/html/images/find.png +0 -0
  61. data/html/images/loadingAnimation.gif +0 -0
  62. data/html/images/macFFBgHack.png +0 -0
  63. data/html/images/package.png +0 -0
  64. data/html/images/page_green.png +0 -0
  65. data/html/images/page_white_text.png +0 -0
  66. data/html/images/page_white_width.png +0 -0
  67. data/html/images/plugin.png +0 -0
  68. data/html/images/ruby.png +0 -0
  69. data/html/images/tag_green.png +0 -0
  70. data/html/images/wrench.png +0 -0
  71. data/html/images/wrench_orange.png +0 -0
  72. data/html/images/zoom.png +0 -0
  73. data/html/index.html +1266 -0
  74. data/html/js/darkfish.js +116 -0
  75. data/html/js/jquery.js +32 -0
  76. data/html/js/quicksearch.js +114 -0
  77. data/html/js/thickbox-compressed.js +10 -0
  78. data/html/lib/midilib/consts_rb.html +55 -0
  79. data/html/lib/midilib/event_rb.html +56 -0
  80. data/html/lib/midilib/info_rb.html +52 -0
  81. data/html/lib/midilib/io/midifile_rb.html +54 -0
  82. data/html/lib/midilib/io/seqreader_rb.html +58 -0
  83. data/html/lib/midilib/io/seqwriter_rb.html +59 -0
  84. data/html/lib/midilib/measure_rb.html +54 -0
  85. data/html/lib/midilib/sequence_rb.html +58 -0
  86. data/html/lib/midilib/track_rb.html +54 -0
  87. data/html/lib/midilib/utils_rb.html +52 -0
  88. data/html/lib/midilib_rb.html +71 -0
  89. data/html/rdoc.css +706 -0
  90. data/install.rb +1 -1
  91. data/lib/midilib/event.rb +11 -77
  92. data/lib/midilib/info.rb +4 -4
  93. data/lib/midilib/io/seqreader.rb +2 -2
  94. data/lib/midilib/io/seqwriter.rb +1 -1
  95. data/lib/midilib/sequence.rb +1 -1
  96. data/lib/midilib/track.rb +54 -8
  97. data/test/test_event.rb +4 -62
  98. data/test/test_sequence.rb +1 -1
  99. data/test/test_track.rb +39 -5
  100. metadata +102 -9
@@ -0,0 +1,659 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: MIDI::Event</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="../js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="../js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body class="class">
23
+
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="../index.html">Home</a>
29
+ <a href="../index.html#classes">Classes</a>
30
+ <a href="../index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="file-metadata">
36
+ <div id="file-list-section" class="section">
37
+ <h3 class="section-header">In Files</h3>
38
+ <div class="section-body">
39
+ <ul>
40
+
41
+ <li><a href="../lib/midilib/event_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
+ class="thickbox" title="lib/midilib/event.rb">lib/midilib/event.rb</a></li>
43
+
44
+ </ul>
45
+ </div>
46
+ </div>
47
+
48
+
49
+ </div>
50
+
51
+ <div id="class-metadata">
52
+
53
+ <!-- Parent Class -->
54
+
55
+ <div id="parent-class-section" class="section">
56
+ <h3 class="section-header">Parent</h3>
57
+
58
+ <p class="link">Object</p>
59
+
60
+ </div>
61
+
62
+
63
+ <!-- Namespace Contents -->
64
+
65
+
66
+ <!-- Method Quickref -->
67
+
68
+ <div id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+ <ul class="link-list">
71
+
72
+ <li><a href="#method-c-new">::new</a></li>
73
+
74
+ <li><a href="#method-i-%3C%3D%3E">#<=></a></li>
75
+
76
+ <li><a href="#method-i-channel_to_s">#channel_to_s</a></li>
77
+
78
+ <li><a href="#method-i-data_as_bytes">#data_as_bytes</a></li>
79
+
80
+ <li><a href="#method-i-number_to_s">#number_to_s</a></li>
81
+
82
+ <li><a href="#method-i-quantize_to">#quantize_to</a></li>
83
+
84
+ <li><a href="#method-i-to_s">#to_s</a></li>
85
+
86
+ </ul>
87
+ </div>
88
+
89
+
90
+ <!-- Included Modules -->
91
+
92
+ </div>
93
+
94
+ <div id="project-metadata">
95
+
96
+
97
+ <div id="fileindex-section" class="section project-section">
98
+ <h3 class="section-header">Files</h3>
99
+ <ul>
100
+
101
+ <li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
102
+
103
+ <li class="file"><a href="../TODO_rdoc.html">TODO.rdoc</a></li>
104
+
105
+ </ul>
106
+ </div>
107
+
108
+
109
+ <div id="classindex-section" class="section project-section">
110
+ <h3 class="section-header">Class Index
111
+ <span class="search-toggle"><img src="../images/find.png"
112
+ height="16" width="16" alt="[+]"
113
+ title="show/hide quicksearch" /></span></h3>
114
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
115
+ <fieldset>
116
+ <legend>Quicksearch</legend>
117
+ <input type="text" name="quicksearch" value=""
118
+ class="quicksearch-field" />
119
+ </fieldset>
120
+ </form>
121
+
122
+ <ul class="link-list">
123
+
124
+ <li><a href="../MIDI.html">MIDI</a></li>
125
+
126
+ <li><a href="../MIDI/ActiveSense.html">MIDI::ActiveSense</a></li>
127
+
128
+ <li><a href="../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a></li>
129
+
130
+ <li><a href="../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a></li>
131
+
132
+ <li><a href="../MIDI/Clock.html">MIDI::Clock</a></li>
133
+
134
+ <li><a href="../MIDI/Continue.html">MIDI::Continue</a></li>
135
+
136
+ <li><a href="../MIDI/Controller.html">MIDI::Controller</a></li>
137
+
138
+ <li><a href="../MIDI/Event.html">MIDI::Event</a></li>
139
+
140
+ <li><a href="../MIDI/IO.html">MIDI::IO</a></li>
141
+
142
+ <li><a href="../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a></li>
143
+
144
+ <li><a href="../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a></li>
145
+
146
+ <li><a href="../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a></li>
147
+
148
+ <li><a href="../MIDI/KeySig.html">MIDI::KeySig</a></li>
149
+
150
+ <li><a href="../MIDI/Marker.html">MIDI::Marker</a></li>
151
+
152
+ <li><a href="../MIDI/Measure.html">MIDI::Measure</a></li>
153
+
154
+ <li><a href="../MIDI/Measures.html">MIDI::Measures</a></li>
155
+
156
+ <li><a href="../MIDI/MetaEvent.html">MIDI::MetaEvent</a></li>
157
+
158
+ <li><a href="../MIDI/NoteEvent.html">MIDI::NoteEvent</a></li>
159
+
160
+ <li><a href="../MIDI/NoteOff.html">MIDI::NoteOff</a></li>
161
+
162
+ <li><a href="../MIDI/NoteOff.html">MIDI::NoteOff</a></li>
163
+
164
+ <li><a href="../MIDI/NoteOn.html">MIDI::NoteOn</a></li>
165
+
166
+ <li><a href="../MIDI/NoteOn.html">MIDI::NoteOn</a></li>
167
+
168
+ <li><a href="../MIDI/PitchBend.html">MIDI::PitchBend</a></li>
169
+
170
+ <li><a href="../MIDI/PolyPressure.html">MIDI::PolyPressure</a></li>
171
+
172
+ <li><a href="../MIDI/ProgramChange.html">MIDI::ProgramChange</a></li>
173
+
174
+ <li><a href="../MIDI/Realtime.html">MIDI::Realtime</a></li>
175
+
176
+ <li><a href="../MIDI/Sequence.html">MIDI::Sequence</a></li>
177
+
178
+ <li><a href="../MIDI/SongPointer.html">MIDI::SongPointer</a></li>
179
+
180
+ <li><a href="../MIDI/SongSelect.html">MIDI::SongSelect</a></li>
181
+
182
+ <li><a href="../MIDI/Start.html">MIDI::Start</a></li>
183
+
184
+ <li><a href="../MIDI/Stop.html">MIDI::Stop</a></li>
185
+
186
+ <li><a href="../MIDI/SystemCommon.html">MIDI::SystemCommon</a></li>
187
+
188
+ <li><a href="../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a></li>
189
+
190
+ <li><a href="../MIDI/SystemReset.html">MIDI::SystemReset</a></li>
191
+
192
+ <li><a href="../MIDI/Tempo.html">MIDI::Tempo</a></li>
193
+
194
+ <li><a href="../MIDI/TimeSig.html">MIDI::TimeSig</a></li>
195
+
196
+ <li><a href="../MIDI/Track.html">MIDI::Track</a></li>
197
+
198
+ <li><a href="../MIDI/TuneRequest.html">MIDI::TuneRequest</a></li>
199
+
200
+ <li><a href="../MIDI/Utils.html">MIDI::Utils</a></li>
201
+
202
+ <li><a href="../Array.html">Array</a></li>
203
+
204
+ <li><a href="../IO.html">IO</a></li>
205
+
206
+ </ul>
207
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
208
+ </div>
209
+
210
+
211
+ </div>
212
+ </div>
213
+
214
+ <div id="documentation">
215
+ <h1 class="class">MIDI::Event</h1>
216
+
217
+ <div id="description">
218
+ <p>
219
+ The abstract superclass of all <a href="../MIDI.html">MIDI</a> events.
220
+ </p>
221
+
222
+ </div>
223
+
224
+ <!-- Constants -->
225
+
226
+
227
+ <!-- Attributes -->
228
+
229
+ <div id="attribute-method-details" class="method-section section">
230
+ <h3 class="section-header">Attributes</h3>
231
+
232
+
233
+ <div id="delta-time-attribute-method" class="method-detail">
234
+ <a name="delta_time"></a>
235
+
236
+ <a name="delta_time="></a>
237
+
238
+ <div class="method-heading attribute-method-heading">
239
+ <span class="method-name">delta_time</span><span
240
+ class="attribute-access-type">[RW]</span>
241
+ </div>
242
+
243
+ <div class="method-description">
244
+
245
+ <p>
246
+ Modifying <a href="Event.html#delta_time">delta_time</a> does not affect
247
+ time_from_start. You need to call the event&#8217;s track&#8217;s
248
+ <tt>recalc_time</tt> method.
249
+ </p>
250
+
251
+ </div>
252
+ </div>
253
+
254
+ <div id="time-from-start-attribute-method" class="method-detail">
255
+ <a name="time_from_start"></a>
256
+
257
+ <a name="time_from_start="></a>
258
+
259
+ <div class="method-heading attribute-method-heading">
260
+ <span class="method-name">time_from_start</span><span
261
+ class="attribute-access-type">[RW]</span>
262
+ </div>
263
+
264
+ <div class="method-description">
265
+
266
+ <p>
267
+ The start time of this event from the beginning of the track. This value is
268
+ held here but is maintained by the track.
269
+ </p>
270
+
271
+ </div>
272
+ </div>
273
+
274
+ <div id="status-attribute-method" class="method-detail">
275
+ <a name="status"></a>
276
+
277
+ <div class="method-heading attribute-method-heading">
278
+ <span class="method-name">status</span><span
279
+ class="attribute-access-type">[R]</span>
280
+ </div>
281
+
282
+ <div class="method-description">
283
+
284
+ <p>
285
+ The <a href="../MIDI.html">MIDI</a> status byte. Never includes the
286
+ channel, which is held separately by <a
287
+ href="ChannelEvent.html">MIDI::ChannelEvent</a>.
288
+ </p>
289
+
290
+ </div>
291
+ </div>
292
+
293
+ <div id="print-note-names-attribute-method" class="method-detail">
294
+ <a name="print_note_names"></a>
295
+
296
+ <a name="print_note_names="></a>
297
+
298
+ <div class="method-heading attribute-method-heading">
299
+ <span class="method-name">print_note_names</span><span
300
+ class="attribute-access-type">[RW]</span>
301
+ </div>
302
+
303
+ <div class="method-description">
304
+
305
+ <p>
306
+ Determines if <a href="Event.html#method-i-to_s">to_s</a> outputs hex note
307
+ numbers (false, the default) or decimal note names (true).
308
+ </p>
309
+
310
+ </div>
311
+ </div>
312
+
313
+ <div id="print-decimal-numbers-attribute-method" class="method-detail">
314
+ <a name="print_decimal_numbers"></a>
315
+
316
+ <a name="print_decimal_numbers="></a>
317
+
318
+ <div class="method-heading attribute-method-heading">
319
+ <span class="method-name">print_decimal_numbers</span><span
320
+ class="attribute-access-type">[RW]</span>
321
+ </div>
322
+
323
+ <div class="method-description">
324
+
325
+ <p>
326
+ Determines if <a href="Event.html#method-i-to_s">to_s</a> outputs numbers
327
+ as hex (false, the default) or decimal # (true). Delta times are always
328
+ printed as decimal.
329
+ </p>
330
+
331
+ </div>
332
+ </div>
333
+
334
+ <div id="print-channel-numbers-from-one-attribute-method" class="method-detail">
335
+ <a name="print_channel_numbers_from_one"></a>
336
+
337
+ <a name="print_channel_numbers_from_one="></a>
338
+
339
+ <div class="method-heading attribute-method-heading">
340
+ <span class="method-name">print_channel_numbers_from_one</span><span
341
+ class="attribute-access-type">[RW]</span>
342
+ </div>
343
+
344
+ <div class="method-description">
345
+
346
+ <p>
347
+ Determines if <a href="Event.html#method-i-to_s">to_s</a> outputs <a
348
+ href="../MIDI.html">MIDI</a> channel numbers from 1-16 instead of the
349
+ default 0-15.
350
+ </p>
351
+
352
+ </div>
353
+ </div>
354
+
355
+ </div>
356
+
357
+
358
+ <!-- Methods -->
359
+
360
+ <div id="public-class-method-details" class="method-section section">
361
+ <h3 class="section-header">Public Class Methods</h3>
362
+
363
+
364
+ <div id="new-method" class="method-detail ">
365
+ <a name="method-c-new"></a>
366
+
367
+ <div class="method-heading">
368
+
369
+ <span class="method-name">new</span><span
370
+ class="method-args">(status = 0, delta_time = 0)</span>
371
+ <span class="method-click-advice">click to toggle source</span>
372
+
373
+ </div>
374
+
375
+ <div class="method-description">
376
+
377
+
378
+
379
+
380
+
381
+ <div class="method-source-code"
382
+ id="new-source">
383
+ <pre>
384
+ <span class="ruby-comment cmt"># File lib/midilib/event.rb, line 30</span>
385
+ 30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">status</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
386
+ 31: <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">status</span>
387
+ 32: <span class="ruby-ivar">@delta_time</span> = <span class="ruby-identifier">delta_time</span>
388
+ 33: <span class="ruby-ivar">@time_from_start</span> = <span class="ruby-value">0</span> <span class="ruby-comment cmt"># maintained by tracks</span>
389
+ 34: <span class="ruby-keyword kw">end</span></pre>
390
+ </div>
391
+
392
+ </div>
393
+
394
+
395
+
396
+
397
+ </div>
398
+
399
+
400
+ </div>
401
+
402
+ <div id="public-instance-method-details" class="method-section section">
403
+ <h3 class="section-header">Public Instance Methods</h3>
404
+
405
+
406
+ <div id="--method" class="method-detail ">
407
+ <a name="method-i-%3C%3D%3E"></a>
408
+
409
+ <div class="method-heading">
410
+
411
+ <span class="method-name">&lt;=&gt;</span><span
412
+ class="method-args">(an_event)</span>
413
+ <span class="method-click-advice">click to toggle source</span>
414
+
415
+ </div>
416
+
417
+ <div class="method-description">
418
+
419
+ <p>
420
+ For sorting. Uses @<a
421
+ href="Event.html#time_from_start">time_from_start</a>, which is maintained
422
+ by this event&#8217;s track. I&#8217;m not sure this is necessary, since
423
+ each track has to maintain its events&#8217; time-from-start values anyway.
424
+ </p>
425
+
426
+
427
+
428
+ <div class="method-source-code"
429
+ id="--source">
430
+ <pre>
431
+ <span class="ruby-comment cmt"># File lib/midilib/event.rb, line 59</span>
432
+ 59: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=&gt;</span>(<span class="ruby-identifier">an_event</span>)
433
+ 60: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@time_from_start</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">an_event</span>.<span class="ruby-identifier">time_from_start</span>
434
+ 61: <span class="ruby-keyword kw">end</span></pre>
435
+ </div>
436
+
437
+ </div>
438
+
439
+
440
+
441
+
442
+ </div>
443
+
444
+
445
+ <div id="channel-to-s-method" class="method-detail ">
446
+ <a name="method-i-channel_to_s"></a>
447
+
448
+ <div class="method-heading">
449
+
450
+ <span class="method-name">channel_to_s</span><span
451
+ class="method-args">(val)</span>
452
+ <span class="method-click-advice">click to toggle source</span>
453
+
454
+ </div>
455
+
456
+ <div class="method-description">
457
+
458
+ <p>
459
+ Returns <tt>val</tt> as a decimal or hex string, depending upon the value
460
+ of @print_decimal_numbers.
461
+ </p>
462
+
463
+
464
+
465
+ <div class="method-source-code"
466
+ id="channel-to-s-source">
467
+ <pre>
468
+ <span class="ruby-comment cmt"># File lib/midilib/event.rb, line 71</span>
469
+ 71: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">channel_to_s</span>(<span class="ruby-identifier">val</span>)
470
+ 72: <span class="ruby-identifier">val</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@print_channel_numbers_from_one</span>
471
+ 73: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">number_to_s</span>(<span class="ruby-identifier">val</span>)
472
+ 74: <span class="ruby-keyword kw">end</span></pre>
473
+ </div>
474
+
475
+ </div>
476
+
477
+
478
+
479
+
480
+ </div>
481
+
482
+
483
+ <div id="data-as-bytes-method" class="method-detail ">
484
+ <a name="method-i-data_as_bytes"></a>
485
+
486
+ <div class="method-heading">
487
+
488
+ <span class="method-name">data_as_bytes</span><span
489
+ class="method-args">()</span>
490
+ <span class="method-click-advice">click to toggle source</span>
491
+
492
+ </div>
493
+
494
+ <div class="method-description">
495
+
496
+ <p>
497
+ Returns the raw bytes that are written to a <a href="../MIDI.html">MIDI</a>
498
+ file or output to a <a href="../MIDI.html">MIDI</a> stream. In MIDI::EVENT
499
+ this raises a &#8220;subclass responsibility&#8221; exception.
500
+ </p>
501
+
502
+
503
+
504
+ <div class="method-source-code"
505
+ id="data-as-bytes-source">
506
+ <pre>
507
+ <span class="ruby-comment cmt"># File lib/midilib/event.rb, line 40</span>
508
+ 40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">data_as_bytes</span>
509
+ 41: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;subclass responsibility&quot;</span>
510
+ 42: <span class="ruby-keyword kw">end</span></pre>
511
+ </div>
512
+
513
+ </div>
514
+
515
+
516
+
517
+
518
+ </div>
519
+
520
+
521
+ <div id="number-to-s-method" class="method-detail ">
522
+ <a name="method-i-number_to_s"></a>
523
+
524
+ <div class="method-heading">
525
+
526
+ <span class="method-name">number_to_s</span><span
527
+ class="method-args">(val)</span>
528
+ <span class="method-click-advice">click to toggle source</span>
529
+
530
+ </div>
531
+
532
+ <div class="method-description">
533
+
534
+ <p>
535
+ Returns <tt>val</tt> as a decimal or hex string, depending upon the value
536
+ of @print_decimal_numbers.
537
+ </p>
538
+
539
+
540
+
541
+ <div class="method-source-code"
542
+ id="number-to-s-source">
543
+ <pre>
544
+ <span class="ruby-comment cmt"># File lib/midilib/event.rb, line 65</span>
545
+ 65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">number_to_s</span>(<span class="ruby-identifier">val</span>)
546
+ 66: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@print_decimal_numbers</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> (<span class="ruby-value str">'%02x'</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">val</span>)
547
+ 67: <span class="ruby-keyword kw">end</span></pre>
548
+ </div>
549
+
550
+ </div>
551
+
552
+
553
+
554
+
555
+ </div>
556
+
557
+
558
+ <div id="quantize-to-method" class="method-detail ">
559
+ <a name="method-i-quantize_to"></a>
560
+
561
+ <div class="method-heading">
562
+
563
+ <span class="method-name">quantize_to</span><span
564
+ class="method-args">(boundary)</span>
565
+ <span class="method-click-advice">click to toggle source</span>
566
+
567
+ </div>
568
+
569
+ <div class="method-description">
570
+
571
+ <p>
572
+ Quantize this event&#8217;s <a
573
+ href="Event.html#time_from_start">time_from_start</a> by moving it to the
574
+ nearest multiple of <tt>boundary</tt>. See <a
575
+ href="Track.html#method-i-quantize">MIDI::Track#quantize</a>. <b>Note</b>:
576
+ does not modify the event&#8217;s <a
577
+ href="Event.html#delta_time">delta_time</a>, though <a
578
+ href="Track.html#method-i-quantize">MIDI::Track#quantize</a> calls
579
+ recalc_delta_from_times after it asks each event to quantize itself.
580
+ </p>
581
+
582
+
583
+
584
+ <div class="method-source-code"
585
+ id="quantize-to-source">
586
+ <pre>
587
+ <span class="ruby-comment cmt"># File lib/midilib/event.rb, line 48</span>
588
+ 48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quantize_to</span>(<span class="ruby-identifier">boundary</span>)
589
+ 49: <span class="ruby-identifier">diff</span> = <span class="ruby-ivar">@time_from_start</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">boundary</span>
590
+ 50: <span class="ruby-ivar">@time_from_start</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">diff</span>
591
+ 51: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">diff</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">boundary</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span>
592
+ 52: <span class="ruby-ivar">@time_from_start</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">boundary</span>
593
+ 53: <span class="ruby-keyword kw">end</span>
594
+ 54: <span class="ruby-keyword kw">end</span></pre>
595
+ </div>
596
+
597
+ </div>
598
+
599
+
600
+
601
+
602
+ </div>
603
+
604
+
605
+ <div id="to-s-method" class="method-detail ">
606
+ <a name="method-i-to_s"></a>
607
+
608
+ <div class="method-heading">
609
+
610
+ <span class="method-name">to_s</span><span
611
+ class="method-args">()</span>
612
+ <span class="method-click-advice">click to toggle source</span>
613
+
614
+ </div>
615
+
616
+ <div class="method-description">
617
+
618
+
619
+
620
+
621
+
622
+ <div class="method-source-code"
623
+ id="to-s-source">
624
+ <pre>
625
+ <span class="ruby-comment cmt"># File lib/midilib/event.rb, line 76</span>
626
+ 76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
627
+ 77: <span class="ruby-node">&quot;#{@delta_time}: &quot;</span>
628
+ 78: <span class="ruby-keyword kw">end</span></pre>
629
+ </div>
630
+
631
+ </div>
632
+
633
+
634
+
635
+
636
+ </div>
637
+
638
+
639
+ </div>
640
+
641
+
642
+ </div>
643
+
644
+
645
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
646
+
647
+ <p>Disabled; run with --debug to generate this.</p>
648
+
649
+ </div>
650
+
651
+ <div id="validator-badges">
652
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
653
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
654
+ Rdoc Generator</a> 1.1.6</small>.</p>
655
+ </div>
656
+
657
+ </body>
658
+ </html>
659
+