midilib 3.0.1 → 3.1.0
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 +4 -4
- data/Credits +5 -0
- data/html/MIDI/ActiveSense.html +171 -0
- data/html/MIDI/ChannelEvent.html +190 -0
- data/html/MIDI/ChannelPressure.html +212 -0
- data/html/MIDI/Clock.html +171 -0
- data/html/MIDI/Continue.html +171 -0
- data/html/MIDI/Controller.html +224 -0
- data/html/MIDI/Event.html +349 -0
- data/html/MIDI/IO/MIDIFile.html +1392 -0
- data/html/MIDI/IO/SeqReader.html +642 -0
- data/html/MIDI/IO/SeqWriter.html +442 -0
- data/html/MIDI/IO.html +91 -0
- data/html/MIDI/KeySig.html +292 -0
- data/html/MIDI/Marker.html +138 -0
- data/html/MIDI/Measure.html +260 -0
- data/html/MIDI/Measures.html +222 -0
- data/html/MIDI/MetaEvent.html +353 -0
- data/html/MIDI/NoteEvent.html +255 -0
- data/html/MIDI/NoteOff.html +188 -0
- data/html/MIDI/NoteOn.html +188 -0
- data/html/MIDI/PitchBend.html +213 -0
- data/html/MIDI/PolyPressure.html +216 -0
- data/html/MIDI/ProgramChange.html +212 -0
- data/html/MIDI/Realtime.html +194 -0
- data/html/MIDI/Sequence.html +641 -0
- data/html/MIDI/SongPointer.html +213 -0
- data/html/MIDI/SongSelect.html +212 -0
- data/html/MIDI/Start.html +171 -0
- data/html/MIDI/Stop.html +171 -0
- data/html/MIDI/SystemCommon.html +138 -0
- data/html/MIDI/SystemExclusive.html +215 -0
- data/html/MIDI/SystemReset.html +171 -0
- data/html/MIDI/Tempo.html +292 -0
- data/html/MIDI/TimeSig.html +286 -0
- data/html/MIDI/Track.html +489 -0
- data/html/MIDI/TuneRequest.html +194 -0
- data/html/MIDI/Utils.html +178 -0
- data/html/MIDI.html +281 -0
- data/html/Object.html +197 -0
- data/html/README_rdoc.html +545 -0
- data/html/TODO_rdoc.html +123 -0
- data/html/created.rid +15 -0
- 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/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +534 -0
- data/html/js/darkfish.js +84 -0
- data/html/js/navigation.js +105 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +110 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +1258 -0
- data/lib/midilib/info.rb +2 -2
- data/lib/midilib/io/seqreader.rb +18 -5
- data/test/test_io.rb +18 -5
- metadata +85 -1
data/html/Object.html
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Object - midilib</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
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
|
+
|
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>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
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"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
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>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">BasicObject
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
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-i-mergesort">#mergesort</a>
|
76
|
+
<li ><a href="#method-i-mergesort_merge">#mergesort_merge</a>
|
77
|
+
<li ><a href="#method-i-mergesort_split">#mergesort_split</a>
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
<main role="main" aria-labelledby="class-Object">
|
85
|
+
<h1 id="class-Object" class="class">
|
86
|
+
class Object
|
87
|
+
</h1>
|
88
|
+
|
89
|
+
<section class="description">
|
90
|
+
|
91
|
+
</section>
|
92
|
+
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
100
|
+
<header>
|
101
|
+
<h3>Public Instance Methods</h3>
|
102
|
+
</header>
|
103
|
+
|
104
|
+
<div id="method-i-mergesort" class="method-detail ">
|
105
|
+
<div class="method-heading">
|
106
|
+
<span class="method-name">mergesort</span><span
|
107
|
+
class="method-args">(arr, &cmp)</span>
|
108
|
+
<span class="method-click-advice">click to toggle source</span>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div class="method-description">
|
112
|
+
<p>A stable sorting algorithm that maintains the relative order of equal elements.</p>
|
113
|
+
|
114
|
+
<p>This code used to be in a new subclass of Array, but that started causing problems in Ruby 3.0, apparently due to the return type of the ‘[]` operator which was the parent Array class.</p>
|
115
|
+
|
116
|
+
<p>This code borrowed from ‘Moser’ <a href="http://codesnippets.joyent.com/posts/show/1699">codesnippets.joyent.com/posts/show/1699</a></p>
|
117
|
+
|
118
|
+
<div class="method-source-code" id="mergesort-source">
|
119
|
+
<pre><span class="ruby-comment"># File lib/midilib/mergesort.rb, line 14</span>
|
120
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mergesort</span>(<span class="ruby-identifier">arr</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">cmp</span>)
|
121
|
+
<span class="ruby-identifier">cmp</span> = <span class="ruby-operator">-></span>(<span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span>) { <span class="ruby-identifier">a</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">b</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">cmp</span>.<span class="ruby-identifier">nil?</span>
|
122
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><=</span> <span class="ruby-value">1</span>
|
123
|
+
<span class="ruby-identifier">arr</span>.<span class="ruby-identifier">dup</span>
|
124
|
+
<span class="ruby-keyword">else</span>
|
125
|
+
<span class="ruby-identifier">halves</span> = <span class="ruby-identifier">mergesort_split</span>(<span class="ruby-identifier">arr</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">half</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mergesort</span>(<span class="ruby-identifier">half</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">cmp</span>) }
|
126
|
+
<span class="ruby-identifier">mergesort_merge</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">halves</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">cmp</span>)
|
127
|
+
<span class="ruby-keyword">end</span>
|
128
|
+
<span class="ruby-keyword">end</span></pre>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div id="method-i-mergesort_merge" class="method-detail ">
|
136
|
+
<div class="method-heading">
|
137
|
+
<span class="method-name">mergesort_merge</span><span
|
138
|
+
class="method-args">(first, second, &predicate)</span>
|
139
|
+
<span class="method-click-advice">click to toggle source</span>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
|
144
|
+
|
145
|
+
<div class="method-source-code" id="mergesort_merge-source">
|
146
|
+
<pre><span class="ruby-comment"># File lib/midilib/mergesort.rb, line 29</span>
|
147
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mergesort_merge</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">predicate</span>)
|
148
|
+
<span class="ruby-identifier">result</span> = []
|
149
|
+
<span class="ruby-keyword">until</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">second</span>.<span class="ruby-identifier">empty?</span>
|
150
|
+
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">predicate</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">first</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>.<span class="ruby-identifier">first</span>) <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
151
|
+
<span class="ruby-identifier">first</span>.<span class="ruby-identifier">shift</span>
|
152
|
+
<span class="ruby-keyword">else</span>
|
153
|
+
<span class="ruby-identifier">second</span>.<span class="ruby-identifier">shift</span>
|
154
|
+
<span class="ruby-keyword">end</span>
|
155
|
+
<span class="ruby-keyword">end</span>
|
156
|
+
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">first</span>).<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">second</span>)
|
157
|
+
<span class="ruby-keyword">end</span></pre>
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
|
164
|
+
<div id="method-i-mergesort_split" class="method-detail ">
|
165
|
+
<div class="method-heading">
|
166
|
+
<span class="method-name">mergesort_split</span><span
|
167
|
+
class="method-args">(arr)</span>
|
168
|
+
<span class="method-click-advice">click to toggle source</span>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div class="method-description">
|
172
|
+
|
173
|
+
|
174
|
+
<div class="method-source-code" id="mergesort_split-source">
|
175
|
+
<pre><span class="ruby-comment"># File lib/midilib/mergesort.rb, line 24</span>
|
176
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mergesort_split</span>(<span class="ruby-identifier">arr</span>)
|
177
|
+
<span class="ruby-identifier">n</span> = (<span class="ruby-identifier">arr</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span>).<span class="ruby-identifier">floor</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
178
|
+
[<span class="ruby-identifier">arr</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">n</span>], <span class="ruby-identifier">arr</span>[<span class="ruby-identifier">n</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]]
|
179
|
+
<span class="ruby-keyword">end</span></pre>
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
|
184
|
+
</div>
|
185
|
+
|
186
|
+
</section>
|
187
|
+
|
188
|
+
</section>
|
189
|
+
</main>
|
190
|
+
|
191
|
+
|
192
|
+
<footer id="validator-badges" role="contentinfo">
|
193
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
194
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
195
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
196
|
+
</footer>
|
197
|
+
|