midilib 2.0.4 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +2 -1
  3. data/Credits +44 -2
  4. data/README.rdoc +13 -9
  5. data/Rakefile +36 -53
  6. data/TODO.rdoc +13 -2
  7. data/examples/from_scratch.rb +4 -6
  8. data/examples/measures_mbt.rb +11 -11
  9. data/examples/print_program_changes.rb +11 -11
  10. data/examples/reader2text.rb +191 -191
  11. data/examples/seq2text.rb +18 -18
  12. data/examples/split.rb +21 -20
  13. data/examples/strings.rb +15 -15
  14. data/examples/transpose.rb +41 -42
  15. data/html/MIDI/ActiveSense.html +89 -213
  16. data/html/MIDI/ChannelEvent.html +95 -224
  17. data/html/MIDI/ChannelPressure.html +103 -241
  18. data/html/MIDI/Clock.html +89 -213
  19. data/html/MIDI/Continue.html +89 -213
  20. data/html/MIDI/Controller.html +105 -246
  21. data/html/MIDI/Event.html +134 -358
  22. data/html/MIDI/IO/MIDIFile.html +544 -1148
  23. data/html/MIDI/IO/SeqReader.html +273 -577
  24. data/html/MIDI/IO/SeqWriter.html +233 -439
  25. data/html/MIDI/IO.html +48 -164
  26. data/html/MIDI/KeySig.html +148 -291
  27. data/html/MIDI/Marker.html +73 -192
  28. data/html/MIDI/Measure.html +104 -267
  29. data/html/MIDI/Measures.html +106 -259
  30. data/html/MIDI/MetaEvent.html +171 -352
  31. data/html/MIDI/NoteEvent.html +114 -276
  32. data/html/MIDI/NoteOff.html +95 -223
  33. data/html/MIDI/NoteOn.html +95 -223
  34. data/html/MIDI/PitchBend.html +104 -242
  35. data/html/MIDI/PolyPressure.html +102 -246
  36. data/html/MIDI/ProgramChange.html +103 -241
  37. data/html/MIDI/Realtime.html +96 -230
  38. data/html/MIDI/Sequence.html +256 -576
  39. data/html/MIDI/SongPointer.html +104 -242
  40. data/html/MIDI/SongSelect.html +103 -241
  41. data/html/MIDI/Start.html +89 -213
  42. data/html/MIDI/Stop.html +89 -213
  43. data/html/MIDI/SystemCommon.html +73 -192
  44. data/html/MIDI/SystemExclusive.html +106 -244
  45. data/html/MIDI/SystemReset.html +89 -213
  46. data/html/MIDI/Tempo.html +127 -309
  47. data/html/MIDI/TimeSig.html +119 -300
  48. data/html/MIDI/Track.html +214 -494
  49. data/html/MIDI/TuneRequest.html +96 -230
  50. data/html/MIDI/Utils.html +91 -233
  51. data/html/MIDI.html +142 -526
  52. data/html/Object.html +197 -0
  53. data/html/README_rdoc.html +280 -486
  54. data/html/TODO_rdoc.html +68 -145
  55. data/html/created.rid +15 -14
  56. data/html/css/fonts.css +167 -0
  57. data/html/css/rdoc.css +639 -0
  58. data/html/fonts/Lato-Light.ttf +0 -0
  59. data/html/fonts/Lato-LightItalic.ttf +0 -0
  60. data/html/fonts/Lato-Regular.ttf +0 -0
  61. data/html/fonts/Lato-RegularItalic.ttf +0 -0
  62. data/html/fonts/SourceCodePro-Bold.ttf +0 -0
  63. data/html/fonts/SourceCodePro-Regular.ttf +0 -0
  64. data/html/images/add.png +0 -0
  65. data/html/images/arrow_up.png +0 -0
  66. data/html/images/delete.png +0 -0
  67. data/html/images/tag_blue.png +0 -0
  68. data/html/index.html +230 -446
  69. data/html/js/darkfish.js +22 -91
  70. data/html/js/navigation.js +4 -41
  71. data/html/js/navigation.js.gz +0 -0
  72. data/html/js/search.js +41 -25
  73. data/html/js/search_index.js +1 -1
  74. data/html/js/search_index.js.gz +0 -0
  75. data/html/js/searcher.js +9 -8
  76. data/html/js/searcher.js.gz +0 -0
  77. data/html/table_of_contents.html +1111 -505
  78. data/install.rb +53 -34
  79. data/lib/midilib/consts.rb +406 -408
  80. data/lib/midilib/event.rb +335 -306
  81. data/lib/midilib/info.rb +5 -7
  82. data/lib/midilib/io/midifile.rb +424 -452
  83. data/lib/midilib/io/seqreader.rb +200 -192
  84. data/lib/midilib/io/seqwriter.rb +151 -147
  85. data/lib/midilib/measure.rb +78 -80
  86. data/lib/midilib/mergesort.rb +39 -0
  87. data/lib/midilib/sequence.rb +93 -87
  88. data/lib/midilib/track.rb +71 -118
  89. data/lib/midilib/utils.rb +17 -20
  90. data/lib/midilib.rb +5 -5
  91. data/test/event_equality.rb +50 -52
  92. data/test/test_event.rb +120 -124
  93. data/test/test_io.rb +118 -38
  94. data/test/test_mergesort.rb +37 -0
  95. data/test/test_midifile.rb +6 -19
  96. data/test/test_sequence.rb +62 -61
  97. data/test/test_track.rb +126 -155
  98. data/test/test_varlen.rb +23 -27
  99. metadata +67 -62
  100. data/html/IO.html +0 -259
  101. data/html/MIDI/MIDI/MIDI/Array.html +0 -353
  102. data/html/MIDI/MIDI/MIDI.html +0 -204
  103. data/html/MIDI/MIDI.html +0 -204
  104. data/html/js/jquery.js +0 -18
  105. data/html/rdoc.css +0 -543
@@ -2,434 +2,291 @@
2
2
 
3
3
  <html>
4
4
  <head>
5
- <meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
5
+ <meta charset="UTF-8">
6
6
 
7
7
  <title>class MIDI::KeySig - 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 type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
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 id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="../index.html">Home</a>
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
- </h3>
31
- </nav>
32
-
36
+ </div>
37
+ </div>
33
38
 
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
35
40
  <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
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
- </h3>
40
- </form>
46
+ </div>
41
47
 
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
44
-
45
-
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>
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"><a href="MetaEvent.html">MIDI::MetaEvent</a>
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
-
73
- <li><a href="#method-c-new">::new</a>
74
-
75
- <li><a href="#method-i-data_as_bytes">#data_as_bytes</a>
76
-
77
- <li><a href="#method-i-major_key-3F">#major_key?</a>
78
60
 
79
- <li><a href="#method-i-minor_key-3F">#minor_key?</a>
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
+
80
67
 
81
- <li><a href="#method-i-sharpflat">#sharpflat</a>
82
68
 
83
- <li><a href="#method-i-to_s">#to_s</a>
84
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 class="calls-super" ><a href="#method-c-new">::new</a>
76
+ <li ><a href="#method-i-data_as_bytes">#data_as_bytes</a>
77
+ <li ><a href="#method-i-major_key-3F">#major_key?</a>
78
+ <li ><a href="#method-i-minor_key-3F">#minor_key?</a>
79
+ <li ><a href="#method-i-sharpflat">#sharpflat</a>
80
+ <li ><a href="#method-i-to_code">#to_code</a>
81
+ <li ><a href="#method-i-to_s">#to_s</a>
85
82
  </ul>
86
- </nav>
87
-
88
- </div>
89
-
90
- <div id="project-metadata">
91
- <nav id="fileindex-section" class="section project-section">
92
- <h3 class="section-header">Pages</h3>
93
-
94
- <ul>
95
-
96
- <li class="file"><a href="../README_rdoc.html">README</a>
97
-
98
- <li class="file"><a href="../TODO_rdoc.html">TODO</a>
99
-
100
- </ul>
101
- </nav>
102
-
103
- <nav id="classindex-section" class="section project-section">
104
- <h3 class="section-header">Class and Module Index</h3>
105
-
106
- <ul class="link-list">
107
-
108
- <li><a href="../MIDI.html">MIDI</a>
109
-
110
- <li><a href="../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
111
-
112
- <li><a href="../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
113
-
114
- <li><a href="../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
115
-
116
- <li><a href="../MIDI/Clock.html">MIDI::Clock</a>
117
-
118
- <li><a href="../MIDI/Continue.html">MIDI::Continue</a>
119
-
120
- <li><a href="../MIDI/Controller.html">MIDI::Controller</a>
121
-
122
- <li><a href="../MIDI/Event.html">MIDI::Event</a>
123
-
124
- <li><a href="../MIDI/IO.html">MIDI::IO</a>
125
-
126
- <li><a href="../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
127
-
128
- <li><a href="../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
129
-
130
- <li><a href="../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
131
-
132
- <li><a href="../MIDI/KeySig.html">MIDI::KeySig</a>
133
-
134
- <li><a href="../MIDI/MIDI.html">MIDI::MIDI</a>
135
-
136
- <li><a href="../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
137
-
138
- <li><a href="../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
139
-
140
- <li><a href="../MIDI/Marker.html">MIDI::Marker</a>
141
-
142
- <li><a href="../MIDI/Measure.html">MIDI::Measure</a>
143
-
144
- <li><a href="../MIDI/Measures.html">MIDI::Measures</a>
145
-
146
- <li><a href="../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
147
-
148
- <li><a href="../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
149
-
150
- <li><a href="../MIDI/NoteOff.html">MIDI::NoteOff</a>
151
-
152
- <li><a href="../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
153
-
154
- <li><a href="../MIDI/NoteOn.html">MIDI::NoteOn</a>
155
-
156
- <li><a href="../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
157
-
158
- <li><a href="../MIDI/PitchBend.html">MIDI::PitchBend</a>
159
-
160
- <li><a href="../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
161
-
162
- <li><a href="../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
163
-
164
- <li><a href="../MIDI/Realtime.html">MIDI::Realtime</a>
165
-
166
- <li><a href="../MIDI/Sequence.html">MIDI::Sequence</a>
167
-
168
- <li><a href="../MIDI/SongPointer.html">MIDI::SongPointer</a>
169
-
170
- <li><a href="../MIDI/SongSelect.html">MIDI::SongSelect</a>
171
-
172
- <li><a href="../MIDI/Start.html">MIDI::Start</a>
173
-
174
- <li><a href="../MIDI/Stop.html">MIDI::Stop</a>
175
-
176
- <li><a href="../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
177
-
178
- <li><a href="../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
179
-
180
- <li><a href="../MIDI/SystemReset.html">MIDI::SystemReset</a>
181
-
182
- <li><a href="../MIDI/Tempo.html">MIDI::Tempo</a>
183
-
184
- <li><a href="../MIDI/TimeSig.html">MIDI::TimeSig</a>
185
-
186
- <li><a href="../MIDI/Track.html">MIDI::Track</a>
187
-
188
- <li><a href="../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
189
-
190
- <li><a href="../MIDI/Utils.html">MIDI::Utils</a>
191
-
192
- <li><a href="../IO.html">IO</a>
193
-
194
- </ul>
195
- </nav>
83
+ </div>
196
84
 
197
85
  </div>
198
86
  </nav>
199
87
 
200
- <div id="documentation">
201
- <h1 class="class">class MIDI::KeySig</h1>
88
+ <main role="main" aria-labelledby="class-MIDI::KeySig">
89
+ <h1 id="class-MIDI::KeySig" class="class">
90
+ class MIDI::KeySig
91
+ </h1>
202
92
 
203
- <div id="description" class="description">
93
+ <section class="description">
204
94
 
205
95
  <p>Container for key signature events</p>
206
96
 
207
- </div><!-- description -->
97
+ </section>
208
98
 
209
-
210
-
211
-
212
99
  <section id="5Buntitled-5D" class="documentation-section">
213
-
214
100
 
215
-
216
101
 
217
-
218
102
 
219
-
220
103
 
221
- <!-- Methods -->
222
-
223
- <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
224
- <h3 class="section-header">Public Class Methods</h3>
225
104
 
226
-
105
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
106
+ <header>
107
+ <h3>Public Class Methods</h3>
108
+ </header>
109
+
227
110
  <div id="method-c-new" class="method-detail ">
228
-
229
111
  <div class="method-heading">
230
112
  <span class="method-name">new</span><span
231
113
  class="method-args">(sharpflat, is_minor, delta_time = 0)</span>
232
114
  <span class="method-click-advice">click to toggle source</span>
233
115
  </div>
234
-
235
116
 
236
117
  <div class="method-description">
237
-
238
118
  <p>Constructor</p>
239
-
119
+ <div class="method-calls-super">
120
+ Calls superclass method
121
+ <a href="MetaEvent.html#method-c-new"><code>MIDI::MetaEvent::new</code></a>
122
+ </div>
240
123
 
241
-
242
124
  <div class="method-source-code" id="new-source">
243
- <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 597</span>
244
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>, <span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
245
- <span class="ruby-keyword">super</span>(<span class="ruby-constant">META_KEY_SIG</span>, [<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>], <span class="ruby-identifier">delta_time</span>)
125
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 596</span>
126
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>, <span class="ruby-identifier">delta_time</span> = <span class="ruby-value">0</span>)
127
+ <span class="ruby-keyword">super</span>(<span class="ruby-constant">META_KEY_SIG</span>, [<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>], <span class="ruby-identifier">delta_time</span>)
246
128
  <span class="ruby-keyword">end</span></pre>
247
- </div><!-- new-source -->
248
-
129
+ </div>
249
130
  </div>
250
131
 
251
-
252
132
 
253
-
254
- </div><!-- new-method -->
133
+ </div>
255
134
 
256
-
257
- </section><!-- public-class-method-details -->
258
-
259
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
260
- <h3 class="section-header">Public Instance Methods</h3>
135
+ </section>
136
+
137
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
138
+ <header>
139
+ <h3>Public Instance Methods</h3>
140
+ </header>
261
141
 
262
-
263
142
  <div id="method-i-data_as_bytes" class="method-detail ">
264
-
265
143
  <div class="method-heading">
266
144
  <span class="method-name">data_as_bytes</span><span
267
145
  class="method-args">()</span>
268
146
  <span class="method-click-advice">click to toggle source</span>
269
147
  </div>
270
-
271
148
 
272
149
  <div class="method-description">
273
-
274
150
  <p>Returns the complete event as stored in the sequence</p>
275
-
276
151
 
277
-
278
152
  <div class="method-source-code" id="data_as_bytes-source">
279
- <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 602</span>
280
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">data_as_bytes</span>
281
- <span class="ruby-identifier">data</span> = []
282
- <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@status</span>
283
- <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@meta_type</span>
284
- <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">2</span>
285
- <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>]
286
- <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
153
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 601</span>
154
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">data_as_bytes</span>
155
+ <span class="ruby-identifier">data</span> = []
156
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@status</span>
157
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@meta_type</span>
158
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">2</span>
159
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>]
160
+ <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
287
161
  <span class="ruby-keyword">end</span></pre>
288
- </div><!-- data_as_bytes-source -->
289
-
162
+ </div>
290
163
  </div>
291
164
 
292
-
293
165
 
294
-
295
- </div><!-- data_as_bytes-method -->
166
+ </div>
296
167
 
297
-
298
168
  <div id="method-i-major_key-3F" class="method-detail ">
299
-
300
169
  <div class="method-heading">
301
170
  <span class="method-name">major_key?</span><span
302
171
  class="method-args">()</span>
303
172
  <span class="method-click-advice">click to toggle source</span>
304
173
  </div>
305
-
306
174
 
307
175
  <div class="method-description">
308
-
309
- <p>Returns true if it's a major key, false if minor key</p>
310
-
176
+ <p>Returns true if it’s a major key, false if minor key</p>
311
177
 
312
-
313
178
  <div class="method-source-code" id="major_key-3F-source">
314
- <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 617</span>
315
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">major_key?</span>
316
- <span class="ruby-operator">!</span><span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>]
179
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 616</span>
180
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">major_key?</span>
181
+ <span class="ruby-operator">!</span><span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>]
317
182
  <span class="ruby-keyword">end</span></pre>
318
- </div><!-- major_key-3F-source -->
319
-
183
+ </div>
320
184
  </div>
321
185
 
322
-
323
186
 
324
-
325
- </div><!-- major_key-3F-method -->
187
+ </div>
326
188
 
327
-
328
189
  <div id="method-i-minor_key-3F" class="method-detail ">
329
-
330
190
  <div class="method-heading">
331
191
  <span class="method-name">minor_key?</span><span
332
192
  class="method-args">()</span>
333
193
  <span class="method-click-advice">click to toggle source</span>
334
194
  </div>
335
-
336
195
 
337
196
  <div class="method-description">
338
-
339
- <p>Returns true if it's a minor key, false if major key</p>
340
-
197
+ <p>Returns true if it’s a minor key, false if major key</p>
341
198
 
342
-
343
199
  <div class="method-source-code" id="minor_key-3F-source">
344
- <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 612</span>
345
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">minor_key?</span>
346
- <span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>]
200
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 611</span>
201
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">minor_key?</span>
202
+ <span class="ruby-ivar">@data</span>[<span class="ruby-value">1</span>]
347
203
  <span class="ruby-keyword">end</span></pre>
348
- </div><!-- minor_key-3F-source -->
349
-
204
+ </div>
350
205
  </div>
351
206
 
352
-
353
207
 
354
-
355
- </div><!-- minor_key-3F-method -->
208
+ </div>
356
209
 
357
-
358
210
  <div id="method-i-sharpflat" class="method-detail ">
359
-
360
211
  <div class="method-heading">
361
212
  <span class="method-name">sharpflat</span><span
362
213
  class="method-args">()</span>
363
214
  <span class="method-click-advice">click to toggle source</span>
364
215
  </div>
365
-
366
216
 
367
217
  <div class="method-description">
368
-
369
218
  <p>Returns the number of sharps/flats in the key sig. Negative for flats.</p>
370
-
371
219
 
372
-
373
220
  <div class="method-source-code" id="sharpflat-source">
374
- <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 622</span>
375
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">sharpflat</span>
376
- <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-value">7</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">256</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>]
221
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 621</span>
222
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sharpflat</span>
223
+ <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-value">7</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">256</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@data</span>[<span class="ruby-value">0</span>]
377
224
  <span class="ruby-keyword">end</span></pre>
378
- </div><!-- sharpflat-source -->
379
-
225
+ </div>
380
226
  </div>
381
227
 
382
-
383
228
 
384
-
385
- </div><!-- sharpflat-method -->
229
+ </div>
230
+
231
+ <div id="method-i-to_code" class="method-detail ">
232
+ <div class="method-heading">
233
+ <span class="method-name">to_code</span><span
234
+ class="method-args">()</span>
235
+ <span class="method-click-advice">click to toggle source</span>
236
+ </div>
237
+
238
+ <div class="method-description">
239
+ <p>Returns the key signature as a code. Example: “Ab” for “key sig A flat major”</p>
240
+
241
+ <div class="method-source-code" id="to_code-source">
242
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 637</span>
243
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_code</span>
244
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">minor_key?</span>
245
+ <span class="ruby-identifier">minorkey_codes</span>[<span class="ruby-identifier">sharpflat</span> <span class="ruby-operator">+</span> <span class="ruby-value">7</span>]
246
+ <span class="ruby-keyword">else</span>
247
+ <span class="ruby-identifier">majorkey_codes</span>[<span class="ruby-identifier">sharpflat</span> <span class="ruby-operator">+</span> <span class="ruby-value">7</span>]
248
+ <span class="ruby-keyword">end</span>
249
+ <span class="ruby-keyword">end</span></pre>
250
+ </div>
251
+ </div>
252
+
253
+
254
+ </div>
386
255
 
387
-
388
256
  <div id="method-i-to_s" class="method-detail ">
389
-
390
257
  <div class="method-heading">
391
258
  <span class="method-name">to_s</span><span
392
259
  class="method-args">()</span>
393
260
  <span class="method-click-advice">click to toggle source</span>
394
261
  </div>
395
-
396
262
 
397
263
  <div class="method-description">
398
-
399
- <p>Returns the key signature as a text string. Example: "key sig A flat major"</p>
400
-
264
+ <p>Returns the key signature as a text string. Example: “key sig A flat major”</p>
401
265
 
402
-
403
266
  <div class="method-source-code" id="to_s-source">
404
- <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 628</span>
405
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
406
- <span class="ruby-identifier">majorkeys</span> = [<span class="ruby-string">'C flat'</span>, <span class="ruby-string">'G flat'</span>, <span class="ruby-string">'D flat'</span>, <span class="ruby-string">'A flat'</span>, <span class="ruby-string">'E flat'</span>, <span class="ruby-string">'B flat'</span>, <span class="ruby-string">'F'</span>,
407
- <span class="ruby-string">'C'</span>, <span class="ruby-string">'G'</span>, <span class="ruby-string">'D'</span>, <span class="ruby-string">'A'</span>, <span class="ruby-string">'E'</span>, <span class="ruby-string">'B'</span>, <span class="ruby-string">'F#'</span>, <span class="ruby-string">'C#'</span>]
408
- <span class="ruby-identifier">minorkeys</span> = [<span class="ruby-string">'a flat'</span>, <span class="ruby-string">'e flat'</span>, <span class="ruby-string">'b flat'</span>, <span class="ruby-string">'f'</span>, <span class="ruby-string">'c'</span>, <span class="ruby-string">'g'</span>, <span class="ruby-string">'d'</span>,
409
- <span class="ruby-string">'a'</span>, <span class="ruby-string">'e'</span>, <span class="ruby-string">'b'</span>, <span class="ruby-string">'f#'</span>, <span class="ruby-string">'c#'</span>, <span class="ruby-string">'g#'</span>, <span class="ruby-string">'d#'</span>, <span class="ruby-string">'a#'</span>]
410
- <span class="ruby-identifier">minor_key?</span> <span class="ruby-operator">?</span> <span class="ruby-node">&quot;key sig #{minorkeys[sharpflat + 7]} minor&quot;</span> <span class="ruby-operator">:</span>
411
- <span class="ruby-node">&quot;key sig #{majorkeys[sharpflat + 7]} major&quot;</span>
267
+ <pre><span class="ruby-comment"># File lib/midilib/event.rb, line 627</span>
268
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
269
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">minor_key?</span>
270
+ <span class="ruby-node">&quot;key sig #{minorkeys[sharpflat + 7]} minor&quot;</span>
271
+ <span class="ruby-keyword">else</span>
272
+ <span class="ruby-node">&quot;key sig #{majorkeys[sharpflat + 7]} major&quot;</span>
273
+ <span class="ruby-keyword">end</span>
412
274
  <span class="ruby-keyword">end</span></pre>
413
- </div><!-- to_s-source -->
414
-
275
+ </div>
415
276
  </div>
416
277
 
417
-
418
278
 
419
-
420
- </div><!-- to_s-method -->
279
+ </div>
421
280
 
422
-
423
- </section><!-- public-instance-method-details -->
424
-
425
- </section><!-- 5Buntitled-5D -->
281
+ </section>
426
282
 
427
- </div><!-- documentation -->
283
+ </section>
284
+ </main>
428
285
 
429
286
 
430
- <footer id="validator-badges">
431
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
432
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
433
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
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>.
434
291
  </footer>
435
292