midilib 2.0.2 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Credits +5 -0
- data/README.rdoc +35 -30
- data/examples/reader2text.rb +1 -0
- data/html/IO.html +259 -0
- data/html/MIDI.html +665 -0
- data/html/MIDI/ActiveSense.html +295 -0
- data/html/MIDI/ChannelEvent.html +319 -0
- data/html/MIDI/ChannelPressure.html +350 -0
- data/html/MIDI/Clock.html +295 -0
- data/html/MIDI/Continue.html +295 -0
- data/html/MIDI/Controller.html +365 -0
- data/html/MIDI/Event.html +573 -0
- data/html/MIDI/IO.html +207 -0
- data/html/MIDI/IO/MIDIFile.html +1996 -0
- data/html/MIDI/IO/SeqReader.html +946 -0
- data/html/MIDI/IO/SeqWriter.html +648 -0
- data/html/MIDI/KeySig.html +435 -0
- data/html/MIDI/MIDI.html +204 -0
- data/html/MIDI/MIDI/MIDI.html +204 -0
- data/html/MIDI/MIDI/MIDI/Array.html +353 -0
- data/html/MIDI/Marker.html +257 -0
- data/html/MIDI/Measure.html +423 -0
- data/html/MIDI/Measures.html +375 -0
- data/html/MIDI/MetaEvent.html +534 -0
- data/html/MIDI/NoteEvent.html +417 -0
- data/html/MIDI/NoteOff.html +316 -0
- data/html/MIDI/NoteOn.html +316 -0
- data/html/MIDI/PitchBend.html +351 -0
- data/html/MIDI/PolyPressure.html +360 -0
- data/html/MIDI/ProgramChange.html +350 -0
- data/html/MIDI/Realtime.html +328 -0
- data/html/MIDI/Sequence.html +961 -0
- data/html/MIDI/SongPointer.html +351 -0
- data/html/MIDI/SongSelect.html +350 -0
- data/html/MIDI/Start.html +295 -0
- data/html/MIDI/Stop.html +295 -0
- data/html/MIDI/SystemCommon.html +257 -0
- data/html/MIDI/SystemExclusive.html +353 -0
- data/html/MIDI/SystemReset.html +295 -0
- data/html/MIDI/Tempo.html +474 -0
- data/html/MIDI/TimeSig.html +467 -0
- data/html/MIDI/Track.html +769 -0
- data/html/MIDI/TuneRequest.html +328 -0
- data/html/MIDI/Utils.html +320 -0
- data/html/README_rdoc.html +751 -0
- data/html/TODO_rdoc.html +200 -0
- data/html/created.rid +14 -0
- data/html/images/add.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 +750 -0
- data/html/js/darkfish.js +153 -0
- data/html/js/jquery.js +18 -0
- data/html/js/navigation.js +142 -0
- data/html/js/search.js +94 -0
- data/html/js/search_index.js +1 -0
- data/html/js/searcher.js +228 -0
- data/html/rdoc.css +543 -0
- data/html/table_of_contents.html +652 -0
- data/lib/midilib/info.rb +1 -1
- data/lib/midilib/io/seqreader.rb +1 -1
- data/lib/midilib/sequence.rb +7 -0
- data/test/test_sequence.rb +11 -0
- metadata +80 -3
@@ -0,0 +1,204 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>module MIDI::MIDI::MIDI - midilib</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../../";
|
13
|
+
</script>
|
14
|
+
|
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>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="module">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../../index.html">Home</a>
|
28
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
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
|
+
</ul>
|
51
|
+
</nav>
|
52
|
+
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div id="project-metadata">
|
64
|
+
<nav id="fileindex-section" class="section project-section">
|
65
|
+
<h3 class="section-header">Pages</h3>
|
66
|
+
|
67
|
+
<ul>
|
68
|
+
|
69
|
+
<li class="file"><a href="../../README_rdoc.html">README</a>
|
70
|
+
|
71
|
+
<li class="file"><a href="../../TODO_rdoc.html">TODO</a>
|
72
|
+
|
73
|
+
</ul>
|
74
|
+
</nav>
|
75
|
+
|
76
|
+
<nav id="classindex-section" class="section project-section">
|
77
|
+
<h3 class="section-header">Class and Module Index</h3>
|
78
|
+
|
79
|
+
<ul class="link-list">
|
80
|
+
|
81
|
+
<li><a href="../../MIDI.html">MIDI</a>
|
82
|
+
|
83
|
+
<li><a href="../../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
|
84
|
+
|
85
|
+
<li><a href="../../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
|
86
|
+
|
87
|
+
<li><a href="../../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
|
88
|
+
|
89
|
+
<li><a href="../../MIDI/Clock.html">MIDI::Clock</a>
|
90
|
+
|
91
|
+
<li><a href="../../MIDI/Continue.html">MIDI::Continue</a>
|
92
|
+
|
93
|
+
<li><a href="../../MIDI/Controller.html">MIDI::Controller</a>
|
94
|
+
|
95
|
+
<li><a href="../../MIDI/Event.html">MIDI::Event</a>
|
96
|
+
|
97
|
+
<li><a href="../../MIDI/IO.html">MIDI::IO</a>
|
98
|
+
|
99
|
+
<li><a href="../../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
|
100
|
+
|
101
|
+
<li><a href="../../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
|
102
|
+
|
103
|
+
<li><a href="../../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
|
104
|
+
|
105
|
+
<li><a href="../../MIDI/KeySig.html">MIDI::KeySig</a>
|
106
|
+
|
107
|
+
<li><a href="../../MIDI/MIDI.html">MIDI::MIDI</a>
|
108
|
+
|
109
|
+
<li><a href="../../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
|
110
|
+
|
111
|
+
<li><a href="../../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
|
112
|
+
|
113
|
+
<li><a href="../../MIDI/Marker.html">MIDI::Marker</a>
|
114
|
+
|
115
|
+
<li><a href="../../MIDI/Measure.html">MIDI::Measure</a>
|
116
|
+
|
117
|
+
<li><a href="../../MIDI/Measures.html">MIDI::Measures</a>
|
118
|
+
|
119
|
+
<li><a href="../../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
|
120
|
+
|
121
|
+
<li><a href="../../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
|
122
|
+
|
123
|
+
<li><a href="../../MIDI/NoteOff.html">MIDI::NoteOff</a>
|
124
|
+
|
125
|
+
<li><a href="../../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
|
126
|
+
|
127
|
+
<li><a href="../../MIDI/NoteOn.html">MIDI::NoteOn</a>
|
128
|
+
|
129
|
+
<li><a href="../../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
|
130
|
+
|
131
|
+
<li><a href="../../MIDI/PitchBend.html">MIDI::PitchBend</a>
|
132
|
+
|
133
|
+
<li><a href="../../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
|
134
|
+
|
135
|
+
<li><a href="../../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
|
136
|
+
|
137
|
+
<li><a href="../../MIDI/Realtime.html">MIDI::Realtime</a>
|
138
|
+
|
139
|
+
<li><a href="../../MIDI/Sequence.html">MIDI::Sequence</a>
|
140
|
+
|
141
|
+
<li><a href="../../MIDI/SongPointer.html">MIDI::SongPointer</a>
|
142
|
+
|
143
|
+
<li><a href="../../MIDI/SongSelect.html">MIDI::SongSelect</a>
|
144
|
+
|
145
|
+
<li><a href="../../MIDI/Start.html">MIDI::Start</a>
|
146
|
+
|
147
|
+
<li><a href="../../MIDI/Stop.html">MIDI::Stop</a>
|
148
|
+
|
149
|
+
<li><a href="../../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
|
150
|
+
|
151
|
+
<li><a href="../../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
|
152
|
+
|
153
|
+
<li><a href="../../MIDI/SystemReset.html">MIDI::SystemReset</a>
|
154
|
+
|
155
|
+
<li><a href="../../MIDI/Tempo.html">MIDI::Tempo</a>
|
156
|
+
|
157
|
+
<li><a href="../../MIDI/TimeSig.html">MIDI::TimeSig</a>
|
158
|
+
|
159
|
+
<li><a href="../../MIDI/Track.html">MIDI::Track</a>
|
160
|
+
|
161
|
+
<li><a href="../../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
|
162
|
+
|
163
|
+
<li><a href="../../MIDI/Utils.html">MIDI::Utils</a>
|
164
|
+
|
165
|
+
<li><a href="../../IO.html">IO</a>
|
166
|
+
|
167
|
+
</ul>
|
168
|
+
</nav>
|
169
|
+
|
170
|
+
</div>
|
171
|
+
</nav>
|
172
|
+
|
173
|
+
<div id="documentation">
|
174
|
+
<h1 class="module">module MIDI::MIDI::MIDI</h1>
|
175
|
+
|
176
|
+
<div id="description" class="description">
|
177
|
+
|
178
|
+
</div><!-- description -->
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
<!-- Methods -->
|
193
|
+
|
194
|
+
</section><!-- 5Buntitled-5D -->
|
195
|
+
|
196
|
+
</div><!-- documentation -->
|
197
|
+
|
198
|
+
|
199
|
+
<footer id="validator-badges">
|
200
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
201
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
202
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
203
|
+
</footer>
|
204
|
+
|
@@ -0,0 +1,353 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class MIDI::MIDI::MIDI::Array - midilib</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../../../";
|
13
|
+
</script>
|
14
|
+
|
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>
|
21
|
+
|
22
|
+
|
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>
|
28
|
+
<a href="../../../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../../../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
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/track.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
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">Array
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
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-i-merge">#merge</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-mergesort">#mergesort</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-split">#split</a>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<div id="project-metadata">
|
85
|
+
<nav id="fileindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Pages</h3>
|
87
|
+
|
88
|
+
<ul>
|
89
|
+
|
90
|
+
<li class="file"><a href="../../../README_rdoc.html">README</a>
|
91
|
+
|
92
|
+
<li class="file"><a href="../../../TODO_rdoc.html">TODO</a>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</nav>
|
96
|
+
|
97
|
+
<nav id="classindex-section" class="section project-section">
|
98
|
+
<h3 class="section-header">Class and Module Index</h3>
|
99
|
+
|
100
|
+
<ul class="link-list">
|
101
|
+
|
102
|
+
<li><a href="../../../MIDI.html">MIDI</a>
|
103
|
+
|
104
|
+
<li><a href="../../../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
|
105
|
+
|
106
|
+
<li><a href="../../../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
|
107
|
+
|
108
|
+
<li><a href="../../../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
|
109
|
+
|
110
|
+
<li><a href="../../../MIDI/Clock.html">MIDI::Clock</a>
|
111
|
+
|
112
|
+
<li><a href="../../../MIDI/Continue.html">MIDI::Continue</a>
|
113
|
+
|
114
|
+
<li><a href="../../../MIDI/Controller.html">MIDI::Controller</a>
|
115
|
+
|
116
|
+
<li><a href="../../../MIDI/Event.html">MIDI::Event</a>
|
117
|
+
|
118
|
+
<li><a href="../../../MIDI/IO.html">MIDI::IO</a>
|
119
|
+
|
120
|
+
<li><a href="../../../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
|
121
|
+
|
122
|
+
<li><a href="../../../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
|
123
|
+
|
124
|
+
<li><a href="../../../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
|
125
|
+
|
126
|
+
<li><a href="../../../MIDI/KeySig.html">MIDI::KeySig</a>
|
127
|
+
|
128
|
+
<li><a href="../../../MIDI/MIDI.html">MIDI::MIDI</a>
|
129
|
+
|
130
|
+
<li><a href="../../../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
|
131
|
+
|
132
|
+
<li><a href="../../../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
|
133
|
+
|
134
|
+
<li><a href="../../../MIDI/Marker.html">MIDI::Marker</a>
|
135
|
+
|
136
|
+
<li><a href="../../../MIDI/Measure.html">MIDI::Measure</a>
|
137
|
+
|
138
|
+
<li><a href="../../../MIDI/Measures.html">MIDI::Measures</a>
|
139
|
+
|
140
|
+
<li><a href="../../../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
|
141
|
+
|
142
|
+
<li><a href="../../../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
|
143
|
+
|
144
|
+
<li><a href="../../../MIDI/NoteOff.html">MIDI::NoteOff</a>
|
145
|
+
|
146
|
+
<li><a href="../../../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
|
147
|
+
|
148
|
+
<li><a href="../../../MIDI/NoteOn.html">MIDI::NoteOn</a>
|
149
|
+
|
150
|
+
<li><a href="../../../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
|
151
|
+
|
152
|
+
<li><a href="../../../MIDI/PitchBend.html">MIDI::PitchBend</a>
|
153
|
+
|
154
|
+
<li><a href="../../../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
|
155
|
+
|
156
|
+
<li><a href="../../../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
|
157
|
+
|
158
|
+
<li><a href="../../../MIDI/Realtime.html">MIDI::Realtime</a>
|
159
|
+
|
160
|
+
<li><a href="../../../MIDI/Sequence.html">MIDI::Sequence</a>
|
161
|
+
|
162
|
+
<li><a href="../../../MIDI/SongPointer.html">MIDI::SongPointer</a>
|
163
|
+
|
164
|
+
<li><a href="../../../MIDI/SongSelect.html">MIDI::SongSelect</a>
|
165
|
+
|
166
|
+
<li><a href="../../../MIDI/Start.html">MIDI::Start</a>
|
167
|
+
|
168
|
+
<li><a href="../../../MIDI/Stop.html">MIDI::Stop</a>
|
169
|
+
|
170
|
+
<li><a href="../../../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
|
171
|
+
|
172
|
+
<li><a href="../../../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
|
173
|
+
|
174
|
+
<li><a href="../../../MIDI/SystemReset.html">MIDI::SystemReset</a>
|
175
|
+
|
176
|
+
<li><a href="../../../MIDI/Tempo.html">MIDI::Tempo</a>
|
177
|
+
|
178
|
+
<li><a href="../../../MIDI/TimeSig.html">MIDI::TimeSig</a>
|
179
|
+
|
180
|
+
<li><a href="../../../MIDI/Track.html">MIDI::Track</a>
|
181
|
+
|
182
|
+
<li><a href="../../../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
|
183
|
+
|
184
|
+
<li><a href="../../../MIDI/Utils.html">MIDI::Utils</a>
|
185
|
+
|
186
|
+
<li><a href="../../../IO.html">IO</a>
|
187
|
+
|
188
|
+
</ul>
|
189
|
+
</nav>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
</nav>
|
193
|
+
|
194
|
+
<div id="documentation">
|
195
|
+
<h1 class="class">class MIDI::MIDI::MIDI::Array</h1>
|
196
|
+
|
197
|
+
<div id="description" class="description">
|
198
|
+
|
199
|
+
<p>This is taken from <a
|
200
|
+
href="http://github.com/adamjmurray/cosy/blob/master/lib/cosy/helper/midi_file_renderer_helper.rb">github.com/adamjmurray/cosy/blob/master/lib/cosy/helper/midi_file_renderer_helper.rb</a>
|
201
|
+
with permission from Adam Murray, who originally suggested this fix. See <a
|
202
|
+
href="http://wiki.github.com/adamjmurray/cosy/midilib-notes">wiki.github.com/adamjmurray/cosy/midilib-notes</a>
|
203
|
+
for details. First we need to add some API infrastructure:</p>
|
204
|
+
|
205
|
+
</div><!-- description -->
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<!-- Methods -->
|
220
|
+
|
221
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
222
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
223
|
+
|
224
|
+
|
225
|
+
<div id="method-i-mergesort" class="method-detail ">
|
226
|
+
|
227
|
+
<div class="method-heading">
|
228
|
+
<span class="method-name">mergesort</span><span
|
229
|
+
class="method-args">(&cmp)</span>
|
230
|
+
<span class="method-click-advice">click to toggle source</span>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
|
234
|
+
<div class="method-description">
|
235
|
+
|
236
|
+
<p>A stable sorting algorithm that maintains the relative order of equal
|
237
|
+
elements</p>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<div class="method-source-code" id="mergesort-source">
|
242
|
+
<pre><span class="ruby-comment"># File lib/midilib/track.rb, line 14</span>
|
243
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">mergesort</span>(&<span class="ruby-identifier">cmp</span>)
|
244
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cmp</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
|
245
|
+
<span class="ruby-identifier">cmp</span> = <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">b</span> }
|
246
|
+
<span class="ruby-keyword">end</span>
|
247
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">size</span> <span class="ruby-operator"><=</span> <span class="ruby-value">1</span>
|
248
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">dup</span>
|
249
|
+
<span class="ruby-keyword">else</span>
|
250
|
+
<span class="ruby-identifier">halves</span> = <span class="ruby-identifier">split</span>.<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">half</span><span class="ruby-operator">|</span>
|
251
|
+
<span class="ruby-identifier">half</span>.<span class="ruby-identifier">mergesort</span>(&<span class="ruby-identifier">cmp</span>)
|
252
|
+
}
|
253
|
+
<span class="ruby-identifier">merge</span>(*<span class="ruby-identifier">halves</span>, &<span class="ruby-identifier">cmp</span>)
|
254
|
+
<span class="ruby-keyword">end</span>
|
255
|
+
<span class="ruby-keyword">end</span></pre>
|
256
|
+
</div><!-- mergesort-source -->
|
257
|
+
|
258
|
+
</div>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
</div><!-- mergesort-method -->
|
264
|
+
|
265
|
+
|
266
|
+
</section><!-- public-instance-method-details -->
|
267
|
+
|
268
|
+
<section id="protected-instance-5Buntitled-5D-method-details" class="method-section section">
|
269
|
+
<h3 class="section-header">Protected Instance Methods</h3>
|
270
|
+
|
271
|
+
|
272
|
+
<div id="method-i-merge" class="method-detail ">
|
273
|
+
|
274
|
+
<div class="method-heading">
|
275
|
+
<span class="method-name">merge</span><span
|
276
|
+
class="method-args">(first, second, &predicate)</span>
|
277
|
+
<span class="method-click-advice">click to toggle source</span>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
<div class="method-description">
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<div class="method-source-code" id="merge-source">
|
288
|
+
<pre><span class="ruby-comment"># File lib/midilib/track.rb, line 34</span>
|
289
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">merge</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>, &<span class="ruby-identifier">predicate</span>)
|
290
|
+
<span class="ruby-identifier">result</span> = []
|
291
|
+
<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>
|
292
|
+
<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>
|
293
|
+
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">shift</span>
|
294
|
+
<span class="ruby-keyword">else</span>
|
295
|
+
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">second</span>.<span class="ruby-identifier">shift</span>
|
296
|
+
<span class="ruby-keyword">end</span>
|
297
|
+
<span class="ruby-keyword">end</span>
|
298
|
+
<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>)
|
299
|
+
<span class="ruby-keyword">end</span></pre>
|
300
|
+
</div><!-- merge-source -->
|
301
|
+
|
302
|
+
</div>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</div><!-- merge-method -->
|
308
|
+
|
309
|
+
|
310
|
+
<div id="method-i-split" class="method-detail ">
|
311
|
+
|
312
|
+
<div class="method-heading">
|
313
|
+
<span class="method-name">split</span><span
|
314
|
+
class="method-args">()</span>
|
315
|
+
<span class="method-click-advice">click to toggle source</span>
|
316
|
+
</div>
|
317
|
+
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
<div class="method-source-code" id="split-source">
|
326
|
+
<pre><span class="ruby-comment"># File lib/midilib/track.rb, line 29</span>
|
327
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">split</span>
|
328
|
+
<span class="ruby-identifier">n</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>
|
329
|
+
[<span class="ruby-keyword">self</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">n</span>], <span class="ruby-keyword">self</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>]]
|
330
|
+
<span class="ruby-keyword">end</span></pre>
|
331
|
+
</div><!-- split-source -->
|
332
|
+
|
333
|
+
</div>
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
</div><!-- split-method -->
|
339
|
+
|
340
|
+
|
341
|
+
</section><!-- protected-instance-method-details -->
|
342
|
+
|
343
|
+
</section><!-- 5Buntitled-5D -->
|
344
|
+
|
345
|
+
</div><!-- documentation -->
|
346
|
+
|
347
|
+
|
348
|
+
<footer id="validator-badges">
|
349
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
350
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
351
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
352
|
+
</footer>
|
353
|
+
|