midilib 2.0.4 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +2 -1
- data/Credits +44 -2
- data/README.rdoc +13 -9
- data/Rakefile +36 -53
- data/TODO.rdoc +13 -2
- data/examples/from_scratch.rb +4 -6
- data/examples/measures_mbt.rb +11 -11
- data/examples/print_program_changes.rb +11 -11
- data/examples/reader2text.rb +191 -191
- data/examples/seq2text.rb +18 -18
- data/examples/split.rb +21 -20
- data/examples/strings.rb +15 -15
- data/examples/transpose.rb +41 -42
- data/html/MIDI/ActiveSense.html +89 -213
- data/html/MIDI/ChannelEvent.html +95 -224
- data/html/MIDI/ChannelPressure.html +103 -241
- data/html/MIDI/Clock.html +89 -213
- data/html/MIDI/Continue.html +89 -213
- data/html/MIDI/Controller.html +105 -246
- data/html/MIDI/Event.html +134 -358
- data/html/MIDI/IO/MIDIFile.html +544 -1148
- data/html/MIDI/IO/SeqReader.html +273 -577
- data/html/MIDI/IO/SeqWriter.html +233 -439
- data/html/MIDI/IO.html +48 -164
- data/html/MIDI/KeySig.html +148 -291
- data/html/MIDI/Marker.html +73 -192
- data/html/MIDI/Measure.html +104 -267
- data/html/MIDI/Measures.html +106 -259
- data/html/MIDI/MetaEvent.html +171 -352
- data/html/MIDI/NoteEvent.html +114 -276
- data/html/MIDI/NoteOff.html +95 -223
- data/html/MIDI/NoteOn.html +95 -223
- data/html/MIDI/PitchBend.html +104 -242
- data/html/MIDI/PolyPressure.html +102 -246
- data/html/MIDI/ProgramChange.html +103 -241
- data/html/MIDI/Realtime.html +96 -230
- data/html/MIDI/Sequence.html +256 -576
- data/html/MIDI/SongPointer.html +104 -242
- data/html/MIDI/SongSelect.html +103 -241
- data/html/MIDI/Start.html +89 -213
- data/html/MIDI/Stop.html +89 -213
- data/html/MIDI/SystemCommon.html +73 -192
- data/html/MIDI/SystemExclusive.html +106 -244
- data/html/MIDI/SystemReset.html +89 -213
- data/html/MIDI/Tempo.html +127 -309
- data/html/MIDI/TimeSig.html +119 -300
- data/html/MIDI/Track.html +214 -494
- data/html/MIDI/TuneRequest.html +96 -230
- data/html/MIDI/Utils.html +91 -233
- data/html/MIDI.html +142 -526
- data/html/Object.html +197 -0
- data/html/README_rdoc.html +280 -486
- data/html/TODO_rdoc.html +68 -145
- data/html/created.rid +15 -14
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +639 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/index.html +230 -446
- data/html/js/darkfish.js +22 -91
- data/html/js/navigation.js +4 -41
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +41 -25
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +9 -8
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +1111 -505
- data/install.rb +53 -34
- data/lib/midilib/consts.rb +406 -408
- data/lib/midilib/event.rb +335 -306
- data/lib/midilib/info.rb +5 -7
- data/lib/midilib/io/midifile.rb +424 -452
- data/lib/midilib/io/seqreader.rb +200 -192
- data/lib/midilib/io/seqwriter.rb +151 -147
- data/lib/midilib/measure.rb +78 -80
- data/lib/midilib/mergesort.rb +39 -0
- data/lib/midilib/sequence.rb +93 -87
- data/lib/midilib/track.rb +71 -118
- data/lib/midilib/utils.rb +17 -20
- data/lib/midilib.rb +5 -5
- data/test/event_equality.rb +50 -52
- data/test/test_event.rb +120 -124
- data/test/test_io.rb +118 -38
- data/test/test_mergesort.rb +37 -0
- data/test/test_midifile.rb +6 -19
- data/test/test_sequence.rb +62 -61
- data/test/test_track.rb +126 -155
- data/test/test_varlen.rb +23 -27
- metadata +67 -62
- data/html/IO.html +0 -259
- data/html/MIDI/MIDI/MIDI/Array.html +0 -353
- data/html/MIDI/MIDI/MIDI.html +0 -204
- data/html/MIDI/MIDI.html +0 -204
- data/html/js/jquery.js +0 -18
- data/html/rdoc.css +0 -543
data/html/MIDI/IO/SeqReader.html
CHANGED
@@ -2,945 +2,641 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class MIDI::IO::SeqReader - midilib</title>
|
8
8
|
|
9
|
-
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
10
|
-
|
11
9
|
<script type="text/javascript">
|
12
10
|
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
13
12
|
</script>
|
14
13
|
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
<script
|
18
|
-
<script
|
19
|
-
<script
|
20
|
-
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
21
22
|
|
22
23
|
|
23
|
-
<body id="top" class="class">
|
24
|
-
<nav
|
25
|
-
<
|
26
|
-
|
27
|
-
|
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
|
-
</
|
31
|
-
</
|
32
|
-
|
36
|
+
</div>
|
37
|
+
</div>
|
33
38
|
|
34
|
-
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
35
40
|
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<
|
37
|
-
<input
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
38
45
|
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
-
</
|
40
|
-
</form>
|
46
|
+
</div>
|
41
47
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<nav id="file-list-section" class="section">
|
48
|
-
<h3 class="section-header">Defined In</h3>
|
49
|
-
<ul>
|
50
|
-
<li>lib/midilib/io/seqreader.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="MIDIFile.html">MIDI::IO::MIDIFile</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-chan_pressure">#chan_pressure</a>
|
76
|
-
|
77
|
-
<li><a href="#method-i-controller">#controller</a>
|
78
|
-
|
79
|
-
<li><a href="#method-i-end_track">#end_track</a>
|
80
|
-
|
81
|
-
<li><a href="#method-i-header">#header</a>
|
82
|
-
|
83
|
-
<li><a href="#method-i-key_signature">#key_signature</a>
|
84
|
-
|
85
|
-
<li><a href="#method-i-make_note_off">#make_note_off</a>
|
86
|
-
|
87
|
-
<li><a href="#method-i-meta_misc">#meta_misc</a>
|
88
|
-
|
89
|
-
<li><a href="#method-i-note_off">#note_off</a>
|
90
|
-
|
91
|
-
<li><a href="#method-i-note_on">#note_on</a>
|
92
|
-
|
93
|
-
<li><a href="#method-i-pitch_bend">#pitch_bend</a>
|
94
|
-
|
95
|
-
<li><a href="#method-i-pressure">#pressure</a>
|
96
|
-
|
97
|
-
<li><a href="#method-i-program">#program</a>
|
98
|
-
|
99
|
-
<li><a href="#method-i-start_track">#start_track</a>
|
100
|
-
|
101
|
-
<li><a href="#method-i-sysex">#sysex</a>
|
102
|
-
|
103
|
-
<li><a href="#method-i-tempo">#tempo</a>
|
104
|
-
|
105
|
-
<li><a href="#method-i-text">#text</a>
|
106
|
-
|
107
|
-
<li><a href="#method-i-time_signature">#time_signature</a>
|
108
|
-
|
109
|
-
<li><a href="#method-i-track_uses_channel">#track_uses_channel</a>
|
110
60
|
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="MIDIFile.html">MIDI::IO::MIDIFile</a>
|
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 class="calls-super" ><a href="#method-c-new">::new</a>
|
76
|
+
<li ><a href="#method-i-chan_pressure">#chan_pressure</a>
|
77
|
+
<li ><a href="#method-i-controller">#controller</a>
|
78
|
+
<li ><a href="#method-i-end_track">#end_track</a>
|
79
|
+
<li ><a href="#method-i-header">#header</a>
|
80
|
+
<li ><a href="#method-i-key_signature">#key_signature</a>
|
81
|
+
<li ><a href="#method-i-make_note_off">#make_note_off</a>
|
82
|
+
<li ><a href="#method-i-meta_misc">#meta_misc</a>
|
83
|
+
<li ><a href="#method-i-note_off">#note_off</a>
|
84
|
+
<li ><a href="#method-i-note_on">#note_on</a>
|
85
|
+
<li ><a href="#method-i-pitch_bend">#pitch_bend</a>
|
86
|
+
<li ><a href="#method-i-pressure">#pressure</a>
|
87
|
+
<li ><a href="#method-i-program">#program</a>
|
88
|
+
<li ><a href="#method-i-start_track">#start_track</a>
|
89
|
+
<li ><a href="#method-i-sysex">#sysex</a>
|
90
|
+
<li ><a href="#method-i-tempo">#tempo</a>
|
91
|
+
<li ><a href="#method-i-text">#text</a>
|
92
|
+
<li ><a href="#method-i-time_signature">#time_signature</a>
|
93
|
+
<li ><a href="#method-i-track_uses_channel">#track_uses_channel</a>
|
111
94
|
</ul>
|
112
|
-
</
|
95
|
+
</div>
|
113
96
|
|
114
97
|
</div>
|
115
|
-
|
116
|
-
<div id="project-metadata">
|
117
|
-
<nav id="fileindex-section" class="section project-section">
|
118
|
-
<h3 class="section-header">Pages</h3>
|
119
|
-
|
120
|
-
<ul>
|
121
|
-
|
122
|
-
<li class="file"><a href="../../README_rdoc.html">README</a>
|
123
|
-
|
124
|
-
<li class="file"><a href="../../TODO_rdoc.html">TODO</a>
|
125
|
-
|
126
|
-
</ul>
|
127
98
|
</nav>
|
128
99
|
|
129
|
-
|
130
|
-
<
|
100
|
+
<main role="main" aria-labelledby="class-MIDI::IO::SeqReader">
|
101
|
+
<h1 id="class-MIDI::IO::SeqReader" class="class">
|
102
|
+
class MIDI::IO::SeqReader
|
103
|
+
</h1>
|
131
104
|
|
132
|
-
<
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
<li><a href="../../MIDI/ActiveSense.html">MIDI::ActiveSense</a>
|
137
|
-
|
138
|
-
<li><a href="../../MIDI/ChannelEvent.html">MIDI::ChannelEvent</a>
|
139
|
-
|
140
|
-
<li><a href="../../MIDI/ChannelPressure.html">MIDI::ChannelPressure</a>
|
141
|
-
|
142
|
-
<li><a href="../../MIDI/Clock.html">MIDI::Clock</a>
|
143
|
-
|
144
|
-
<li><a href="../../MIDI/Continue.html">MIDI::Continue</a>
|
145
|
-
|
146
|
-
<li><a href="../../MIDI/Controller.html">MIDI::Controller</a>
|
147
|
-
|
148
|
-
<li><a href="../../MIDI/Event.html">MIDI::Event</a>
|
149
|
-
|
150
|
-
<li><a href="../../MIDI/IO.html">MIDI::IO</a>
|
151
|
-
|
152
|
-
<li><a href="../../MIDI/IO/MIDIFile.html">MIDI::IO::MIDIFile</a>
|
153
|
-
|
154
|
-
<li><a href="../../MIDI/IO/SeqReader.html">MIDI::IO::SeqReader</a>
|
155
|
-
|
156
|
-
<li><a href="../../MIDI/IO/SeqWriter.html">MIDI::IO::SeqWriter</a>
|
157
|
-
|
158
|
-
<li><a href="../../MIDI/KeySig.html">MIDI::KeySig</a>
|
159
|
-
|
160
|
-
<li><a href="../../MIDI/MIDI.html">MIDI::MIDI</a>
|
161
|
-
|
162
|
-
<li><a href="../../MIDI/MIDI/MIDI.html">MIDI::MIDI::MIDI</a>
|
163
|
-
|
164
|
-
<li><a href="../../MIDI/MIDI/MIDI/Array.html">MIDI::MIDI::MIDI::Array</a>
|
165
|
-
|
166
|
-
<li><a href="../../MIDI/Marker.html">MIDI::Marker</a>
|
167
|
-
|
168
|
-
<li><a href="../../MIDI/Measure.html">MIDI::Measure</a>
|
169
|
-
|
170
|
-
<li><a href="../../MIDI/Measures.html">MIDI::Measures</a>
|
171
|
-
|
172
|
-
<li><a href="../../MIDI/MetaEvent.html">MIDI::MetaEvent</a>
|
173
|
-
|
174
|
-
<li><a href="../../MIDI/NoteEvent.html">MIDI::NoteEvent</a>
|
175
|
-
|
176
|
-
<li><a href="../../MIDI/NoteOff.html">MIDI::NoteOff</a>
|
177
|
-
|
178
|
-
<li><a href="../../MIDI/NoteOff.html">MIDI::NoteOffEvent</a>
|
179
|
-
|
180
|
-
<li><a href="../../MIDI/NoteOn.html">MIDI::NoteOn</a>
|
181
|
-
|
182
|
-
<li><a href="../../MIDI/NoteOn.html">MIDI::NoteOnEvent</a>
|
183
|
-
|
184
|
-
<li><a href="../../MIDI/PitchBend.html">MIDI::PitchBend</a>
|
185
|
-
|
186
|
-
<li><a href="../../MIDI/PolyPressure.html">MIDI::PolyPressure</a>
|
187
|
-
|
188
|
-
<li><a href="../../MIDI/ProgramChange.html">MIDI::ProgramChange</a>
|
189
|
-
|
190
|
-
<li><a href="../../MIDI/Realtime.html">MIDI::Realtime</a>
|
191
|
-
|
192
|
-
<li><a href="../../MIDI/Sequence.html">MIDI::Sequence</a>
|
193
|
-
|
194
|
-
<li><a href="../../MIDI/SongPointer.html">MIDI::SongPointer</a>
|
195
|
-
|
196
|
-
<li><a href="../../MIDI/SongSelect.html">MIDI::SongSelect</a>
|
197
|
-
|
198
|
-
<li><a href="../../MIDI/Start.html">MIDI::Start</a>
|
199
|
-
|
200
|
-
<li><a href="../../MIDI/Stop.html">MIDI::Stop</a>
|
201
|
-
|
202
|
-
<li><a href="../../MIDI/SystemCommon.html">MIDI::SystemCommon</a>
|
203
|
-
|
204
|
-
<li><a href="../../MIDI/SystemExclusive.html">MIDI::SystemExclusive</a>
|
205
|
-
|
206
|
-
<li><a href="../../MIDI/SystemReset.html">MIDI::SystemReset</a>
|
207
|
-
|
208
|
-
<li><a href="../../MIDI/Tempo.html">MIDI::Tempo</a>
|
209
|
-
|
210
|
-
<li><a href="../../MIDI/TimeSig.html">MIDI::TimeSig</a>
|
211
|
-
|
212
|
-
<li><a href="../../MIDI/Track.html">MIDI::Track</a>
|
213
|
-
|
214
|
-
<li><a href="../../MIDI/TuneRequest.html">MIDI::TuneRequest</a>
|
215
|
-
|
216
|
-
<li><a href="../../MIDI/Utils.html">MIDI::Utils</a>
|
217
|
-
|
218
|
-
<li><a href="../../IO.html">IO</a>
|
219
|
-
|
220
|
-
</ul>
|
221
|
-
</nav>
|
105
|
+
<section class="description">
|
106
|
+
|
107
|
+
<p>Reads <a href="../../MIDI.html"><code>MIDI</code></a> files. As a subclass of <a href="MIDIFile.html"><code>MIDIFile</code></a>, this class implements the callback methods for each <a href="../../MIDI.html"><code>MIDI</code></a> event and use them to build <a href="../Track.html"><code>Track</code></a> and <a href="../Event.html"><code>Event</code></a> objects and give the tracks to a <a href="../Sequence.html"><code>Sequence</code></a>.</p>
|
222
108
|
|
223
|
-
|
224
|
-
</nav>
|
109
|
+
<p>We append new events to the end of a track’s event list, bypassing a call to <a href="../Track.html"><code>Track</code></a>.#add. This means that we must call <a href="../Track.html#method-i-recalc_times"><code>Track.recalc_times</code></a> at the end of the track so it can update each event with its time from the track’s start (see <a href="SeqReader.html#method-i-end_track"><code>end_track</code></a> below).</p>
|
225
110
|
|
226
|
-
<
|
227
|
-
<h1 class="class">class MIDI::IO::SeqReader</h1>
|
111
|
+
<p>META_TRACK_END events are not added to tracks. This way, we don’t have to worry about making sure the last event is always a track end event. We rely on the <a href="SeqWriter.html"><code>SeqWriter</code></a> to append a META_TRACK_END event to each track when it is output.</p>
|
228
112
|
|
229
|
-
|
230
|
-
|
231
|
-
<p>Reads <a href="../MIDI.html">MIDI</a> files. As a subclass of <a
|
232
|
-
href="MIDIFile.html">MIDIFile</a>, this class implements the callback
|
233
|
-
methods for each <a href="../MIDI.html">MIDI</a> event and use them to
|
234
|
-
build <a href="../Track.html">Track</a> and <a
|
235
|
-
href="../Event.html">Event</a> objects and give the tracks to a <a
|
236
|
-
href="../Sequence.html">Sequence</a>.</p>
|
237
|
-
|
238
|
-
<p>We append new events to the end of a track's event list, bypassing a call
|
239
|
-
to <a href="../Track.html">Track</a>.add. This means that we must call <a
|
240
|
-
href="../Track.html#method-i-recalc_times">MIDI::Track#recalc_times</a> at
|
241
|
-
the end of the track so it can update each event with its time from the
|
242
|
-
track's start (see <a
|
243
|
-
href="SeqReader.html#method-i-end_track">#end_track</a> below).</p>
|
244
|
-
|
245
|
-
<p>META_TRACK_END events are not added to tracks. This way, we don't have to
|
246
|
-
worry about making sure the last event is always a track end event. We rely
|
247
|
-
on the <a href="SeqWriter.html">SeqWriter</a> to append a META_TRACK_END
|
248
|
-
event to each track when it is output.</p>
|
249
|
-
|
250
|
-
</div><!-- description -->
|
113
|
+
</section>
|
251
114
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
115
|
<section id="5Buntitled-5D" class="documentation-section">
|
256
|
-
|
257
116
|
|
258
|
-
|
259
117
|
|
260
|
-
|
261
118
|
|
262
|
-
|
263
119
|
|
264
|
-
<!-- Methods -->
|
265
|
-
|
266
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
267
|
-
<h3 class="section-header">Public Class Methods</h3>
|
268
120
|
|
269
|
-
|
121
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
122
|
+
<header>
|
123
|
+
<h3>Public Class Methods</h3>
|
124
|
+
</header>
|
125
|
+
|
270
126
|
<div id="method-c-new" class="method-detail ">
|
271
|
-
|
272
127
|
<div class="method-heading">
|
273
128
|
<span class="method-name">new</span><span
|
274
|
-
class="method-args">(seq
|
129
|
+
class="method-args">(seq) { |track, num_tracks, index| ... }</span>
|
275
130
|
<span class="method-click-advice">click to toggle source</span>
|
276
131
|
</div>
|
277
|
-
|
278
132
|
|
279
133
|
<div class="method-description">
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
134
|
+
<p>The optional &block is called once at the start of the file and again at the end of each track. There are three arguments to the block: the track, the track number (1 through <em>n</em>), and the total number of tracks.</p>
|
135
|
+
<div class="method-calls-super">
|
136
|
+
Calls superclass method
|
137
|
+
<a href="MIDIFile.html#method-c-new"><code>MIDI::IO::MIDIFile::new</code></a>
|
138
|
+
</div>
|
286
139
|
|
287
|
-
|
288
140
|
<div class="method-source-code" id="new-source">
|
289
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
290
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">seq</span>, <span class="ruby-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
141
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 26</span>
|
142
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">seq</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :yields: track, num_tracks, index</span>
|
143
|
+
<span class="ruby-keyword">super</span>()
|
144
|
+
<span class="ruby-ivar">@seq</span> = <span class="ruby-identifier">seq</span>
|
145
|
+
<span class="ruby-ivar">@track</span> = <span class="ruby-keyword">nil</span>
|
146
|
+
<span class="ruby-ivar">@chan_mask</span> = <span class="ruby-value">0</span>
|
147
|
+
<span class="ruby-ivar">@update_block</span> = <span class="ruby-identifier">block</span>
|
296
148
|
<span class="ruby-keyword">end</span></pre>
|
297
|
-
</div
|
298
|
-
|
149
|
+
</div>
|
299
150
|
</div>
|
300
151
|
|
301
|
-
|
302
152
|
|
303
|
-
|
304
|
-
</div><!-- new-method -->
|
153
|
+
</div>
|
305
154
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
155
|
+
</section>
|
156
|
+
|
157
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
158
|
+
<header>
|
159
|
+
<h3>Public Instance Methods</h3>
|
160
|
+
</header>
|
311
161
|
|
312
|
-
|
313
162
|
<div id="method-i-chan_pressure" class="method-detail ">
|
314
|
-
|
315
163
|
<div class="method-heading">
|
316
164
|
<span class="method-name">chan_pressure</span><span
|
317
165
|
class="method-args">(chan, press)</span>
|
318
166
|
<span class="method-click-advice">click to toggle source</span>
|
319
167
|
</div>
|
320
|
-
|
321
168
|
|
322
169
|
<div class="method-description">
|
323
170
|
|
324
|
-
|
325
|
-
|
326
171
|
|
327
|
-
|
328
172
|
<div class="method-source-code" id="chan_pressure-source">
|
329
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
330
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">chan_pressure</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">press</span>)
|
331
|
-
|
332
|
-
|
173
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 137</span>
|
174
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">chan_pressure</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">press</span>)
|
175
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">ChannelPressure</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">press</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
176
|
+
<span class="ruby-identifier">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
333
177
|
<span class="ruby-keyword">end</span></pre>
|
334
|
-
</div
|
335
|
-
|
178
|
+
</div>
|
336
179
|
</div>
|
337
180
|
|
338
|
-
|
339
181
|
|
340
|
-
|
341
|
-
</div><!-- chan_pressure-method -->
|
182
|
+
</div>
|
342
183
|
|
343
|
-
|
344
184
|
<div id="method-i-controller" class="method-detail ">
|
345
|
-
|
346
185
|
<div class="method-heading">
|
347
186
|
<span class="method-name">controller</span><span
|
348
187
|
class="method-args">(chan, control, value)</span>
|
349
188
|
<span class="method-click-advice">click to toggle source</span>
|
350
189
|
</div>
|
351
|
-
|
352
190
|
|
353
191
|
<div class="method-description">
|
354
192
|
|
355
|
-
|
356
|
-
|
357
193
|
|
358
|
-
|
359
194
|
<div class="method-source-code" id="controller-source">
|
360
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
361
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">controller</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">control</span>, <span class="ruby-identifier">value</span>)
|
362
|
-
|
363
|
-
|
195
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 122</span>
|
196
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">controller</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">control</span>, <span class="ruby-identifier">value</span>)
|
197
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Controller</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">control</span>, <span class="ruby-identifier">value</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
198
|
+
<span class="ruby-identifier">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
364
199
|
<span class="ruby-keyword">end</span></pre>
|
365
|
-
</div
|
366
|
-
|
200
|
+
</div>
|
367
201
|
</div>
|
368
202
|
|
369
|
-
|
370
203
|
|
371
|
-
|
372
|
-
</div><!-- controller-method -->
|
204
|
+
</div>
|
373
205
|
|
374
|
-
|
375
206
|
<div id="method-i-end_track" class="method-detail ">
|
376
|
-
|
377
207
|
<div class="method-heading">
|
378
208
|
<span class="method-name">end_track</span><span
|
379
209
|
class="method-args">()</span>
|
380
210
|
<span class="method-click-advice">click to toggle source</span>
|
381
211
|
</div>
|
382
|
-
|
383
212
|
|
384
213
|
<div class="method-description">
|
385
214
|
|
386
|
-
|
387
|
-
|
388
215
|
|
389
|
-
|
390
216
|
<div class="method-source-code" id="end_track-source">
|
391
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
392
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">end_track</span>
|
393
|
-
|
394
|
-
|
395
|
-
|
217
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 49</span>
|
218
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">end_track</span>
|
219
|
+
<span class="ruby-comment"># Turn off any pending note on messages</span>
|
220
|
+
<span class="ruby-ivar">@pending</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">on</span><span class="ruby-operator">|</span> <span class="ruby-identifier">make_note_off</span>(<span class="ruby-identifier">on</span>, <span class="ruby-value">64</span>) }
|
221
|
+
<span class="ruby-ivar">@pending</span> = <span class="ruby-keyword">nil</span>
|
396
222
|
|
397
|
-
|
398
|
-
|
399
|
-
|
223
|
+
<span class="ruby-comment"># Don't bother adding the META_TRACK_END event to the track.</span>
|
224
|
+
<span class="ruby-comment"># This way, we don't have to worry about making sure the</span>
|
225
|
+
<span class="ruby-comment"># last event is always a track end event.</span>
|
400
226
|
|
401
|
-
|
402
|
-
|
403
|
-
|
227
|
+
<span class="ruby-comment"># Let the track calculate event times from start of track. This is</span>
|
228
|
+
<span class="ruby-comment"># in lieu of calling Track.add for each event.</span>
|
229
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">recalc_times</span>
|
404
230
|
|
405
|
-
|
406
|
-
|
231
|
+
<span class="ruby-comment"># Store bitmask of all channels used into track</span>
|
232
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">channels_used</span> = <span class="ruby-ivar">@chan_mask</span>
|
407
233
|
|
408
|
-
|
409
|
-
|
234
|
+
<span class="ruby-comment"># call update block</span>
|
235
|
+
<span class="ruby-ivar">@update_block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@track</span>, <span class="ruby-ivar">@ntrks</span>, <span class="ruby-ivar">@seq</span>.<span class="ruby-identifier">tracks</span>.<span class="ruby-identifier">length</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@update_block</span>
|
410
236
|
<span class="ruby-keyword">end</span></pre>
|
411
|
-
</div
|
412
|
-
|
237
|
+
</div>
|
413
238
|
</div>
|
414
239
|
|
415
|
-
|
416
240
|
|
417
|
-
|
418
|
-
</div><!-- end_track-method -->
|
241
|
+
</div>
|
419
242
|
|
420
|
-
|
421
243
|
<div id="method-i-header" class="method-detail ">
|
422
|
-
|
423
244
|
<div class="method-heading">
|
424
245
|
<span class="method-name">header</span><span
|
425
246
|
class="method-args">(format, ntrks, division)</span>
|
426
247
|
<span class="method-click-advice">click to toggle source</span>
|
427
248
|
</div>
|
428
|
-
|
429
249
|
|
430
250
|
<div class="method-description">
|
431
251
|
|
432
|
-
|
433
|
-
|
434
252
|
|
435
|
-
|
436
253
|
<div class="method-source-code" id="header-source">
|
437
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
438
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">header</span>(<span class="ruby-identifier">format</span>, <span class="ruby-identifier">ntrks</span>, <span class="ruby-identifier">division</span>)
|
439
|
-
|
440
|
-
|
254
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 34</span>
|
255
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">header</span>(<span class="ruby-identifier">format</span>, <span class="ruby-identifier">ntrks</span>, <span class="ruby-identifier">division</span>)
|
256
|
+
<span class="ruby-ivar">@seq</span>.<span class="ruby-identifier">format</span> = <span class="ruby-identifier">format</span>
|
257
|
+
<span class="ruby-ivar">@seq</span>.<span class="ruby-identifier">ppqn</span> = <span class="ruby-identifier">division</span>
|
441
258
|
|
442
|
-
|
443
|
-
|
259
|
+
<span class="ruby-ivar">@ntrks</span> = <span class="ruby-identifier">ntrks</span>
|
260
|
+
<span class="ruby-ivar">@update_block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword">nil</span>, <span class="ruby-ivar">@ntrks</span>, <span class="ruby-value">0</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@update_block</span>
|
444
261
|
<span class="ruby-keyword">end</span></pre>
|
445
|
-
</div
|
446
|
-
|
262
|
+
</div>
|
447
263
|
</div>
|
448
264
|
|
449
|
-
|
450
265
|
|
451
|
-
|
452
|
-
</div><!-- header-method -->
|
266
|
+
</div>
|
453
267
|
|
454
|
-
|
455
268
|
<div id="method-i-key_signature" class="method-detail ">
|
456
|
-
|
457
269
|
<div class="method-heading">
|
458
270
|
<span class="method-name">key_signature</span><span
|
459
271
|
class="method-args">(sharpflat, is_minor)</span>
|
460
272
|
<span class="method-click-advice">click to toggle source</span>
|
461
273
|
</div>
|
462
|
-
|
463
274
|
|
464
275
|
<div class="method-description">
|
465
276
|
|
466
|
-
|
467
|
-
|
468
277
|
|
469
|
-
|
470
278
|
<div class="method-source-code" id="key_signature-source">
|
471
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
472
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">key_signature</span>(<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>)
|
279
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 195</span>
|
280
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">key_signature</span>(<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>)
|
473
281
|
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">KeySig</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
474
282
|
<span class="ruby-keyword">end</span></pre>
|
475
|
-
</div
|
476
|
-
|
283
|
+
</div>
|
477
284
|
</div>
|
478
285
|
|
479
|
-
|
480
286
|
|
481
|
-
|
482
|
-
</div><!-- key_signature-method -->
|
287
|
+
</div>
|
483
288
|
|
484
|
-
|
485
289
|
<div id="method-i-make_note_off" class="method-detail ">
|
486
|
-
|
487
290
|
<div class="method-heading">
|
488
291
|
<span class="method-name">make_note_off</span><span
|
489
292
|
class="method-args">(on, vel)</span>
|
490
293
|
<span class="method-click-advice">click to toggle source</span>
|
491
294
|
</div>
|
492
|
-
|
493
295
|
|
494
296
|
<div class="method-description">
|
495
297
|
|
496
|
-
|
497
|
-
|
498
298
|
|
499
|
-
|
500
299
|
<div class="method-source-code" id="make_note_off-source">
|
501
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
502
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">make_note_off</span>(<span class="ruby-identifier">on</span>, <span class="ruby-identifier">vel</span>)
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
300
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 110</span>
|
301
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">make_note_off</span>(<span class="ruby-identifier">on</span>, <span class="ruby-identifier">vel</span>)
|
302
|
+
<span class="ruby-identifier">off</span> = <span class="ruby-constant">NoteOff</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">on</span>.<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">on</span>.<span class="ruby-identifier">note</span>, <span class="ruby-identifier">vel</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
303
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">off</span>
|
304
|
+
<span class="ruby-identifier">on</span>.<span class="ruby-identifier">off</span> = <span class="ruby-identifier">off</span>
|
305
|
+
<span class="ruby-identifier">off</span>.<span class="ruby-identifier">on</span> = <span class="ruby-identifier">on</span>
|
507
306
|
<span class="ruby-keyword">end</span></pre>
|
508
|
-
</div
|
509
|
-
|
307
|
+
</div>
|
510
308
|
</div>
|
511
309
|
|
512
|
-
|
513
310
|
|
514
|
-
|
515
|
-
</div><!-- make_note_off-method -->
|
311
|
+
</div>
|
516
312
|
|
517
|
-
|
518
313
|
<div id="method-i-meta_misc" class="method-detail ">
|
519
|
-
|
520
314
|
<div class="method-heading">
|
521
315
|
<span class="method-name">meta_misc</span><span
|
522
316
|
class="method-args">(type, msg)</span>
|
523
317
|
<span class="method-click-advice">click to toggle source</span>
|
524
318
|
</div>
|
525
|
-
|
526
319
|
|
527
320
|
<div class="method-description">
|
528
321
|
|
529
|
-
|
530
|
-
|
531
322
|
|
532
|
-
|
533
323
|
<div class="method-source-code" id="meta_misc-source">
|
534
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
535
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">meta_misc</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">msg</span>)
|
536
|
-
|
324
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 146</span>
|
325
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">meta_misc</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">msg</span>)
|
326
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">MetaEvent</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
537
327
|
<span class="ruby-keyword">end</span></pre>
|
538
|
-
</div
|
539
|
-
|
328
|
+
</div>
|
540
329
|
</div>
|
541
330
|
|
542
|
-
|
543
331
|
|
544
|
-
|
545
|
-
</div><!-- meta_misc-method -->
|
332
|
+
</div>
|
546
333
|
|
547
|
-
|
548
334
|
<div id="method-i-note_off" class="method-detail ">
|
549
|
-
|
550
335
|
<div class="method-heading">
|
551
336
|
<span class="method-name">note_off</span><span
|
552
337
|
class="method-args">(chan, note, vel)</span>
|
553
338
|
<span class="method-click-advice">click to toggle source</span>
|
554
339
|
</div>
|
555
|
-
|
556
340
|
|
557
341
|
<div class="method-description">
|
558
342
|
|
559
|
-
|
560
|
-
|
561
343
|
|
562
|
-
|
563
344
|
<div class="method-source-code" id="note_off-source">
|
564
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
565
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">note_off</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">vel</span>)
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
<span class="ruby-identifier"
|
576
|
-
|
345
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 81</span>
|
346
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">note_off</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">vel</span>)
|
347
|
+
<span class="ruby-comment"># Find note on, create note off, connect the two, and remove</span>
|
348
|
+
<span class="ruby-comment"># note on from pending list.</span>
|
349
|
+
|
350
|
+
<span class="ruby-identifier">corresp_note_on</span> = <span class="ruby-keyword">nil</span>
|
351
|
+
|
352
|
+
<span class="ruby-ivar">@pending</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">on</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
353
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">on</span>.<span class="ruby-identifier">note</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">note</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">on</span>.<span class="ruby-identifier">channel</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">chan</span>
|
354
|
+
|
355
|
+
<span class="ruby-ivar">@pending</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">i</span>)
|
356
|
+
<span class="ruby-identifier">corresp_note_on</span> = <span class="ruby-identifier">on</span>
|
357
|
+
<span class="ruby-keyword">break</span>
|
358
|
+
<span class="ruby-keyword">end</span>
|
359
|
+
|
360
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">corresp_note_on</span>
|
361
|
+
<span class="ruby-identifier">make_note_off</span>(<span class="ruby-identifier">corresp_note_on</span>, <span class="ruby-identifier">vel</span>)
|
362
|
+
<span class="ruby-keyword">else</span>
|
363
|
+
<span class="ruby-comment"># When a corresponding note on is missing,</span>
|
364
|
+
<span class="ruby-comment"># keep note off as input with lefting on/off attr to nil.</span>
|
365
|
+
<span class="ruby-identifier">off</span> = <span class="ruby-constant">NoteOff</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">vel</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
366
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">off</span>
|
367
|
+
|
368
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">$DEBUG</span>
|
369
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-node">"note off with no earlier note on (ch #{chan}, note"</span> <span class="ruby-operator">+</span>
|
370
|
+
<span class="ruby-node">" #{note}, vel #{vel})"</span>
|
371
|
+
<span class="ruby-keyword">end</span>
|
372
|
+
<span class="ruby-keyword">end</span>
|
577
373
|
<span class="ruby-keyword">end</span></pre>
|
578
|
-
</div
|
579
|
-
|
374
|
+
</div>
|
580
375
|
</div>
|
581
376
|
|
582
|
-
|
583
377
|
|
584
|
-
|
585
|
-
</div><!-- note_off-method -->
|
378
|
+
</div>
|
586
379
|
|
587
|
-
|
588
380
|
<div id="method-i-note_on" class="method-detail ">
|
589
|
-
|
590
381
|
<div class="method-heading">
|
591
382
|
<span class="method-name">note_on</span><span
|
592
383
|
class="method-args">(chan, note, vel)</span>
|
593
384
|
<span class="method-click-advice">click to toggle source</span>
|
594
385
|
</div>
|
595
|
-
|
596
386
|
|
597
387
|
<div class="method-description">
|
598
388
|
|
599
|
-
|
600
|
-
|
601
389
|
|
602
|
-
|
603
390
|
<div class="method-source-code" id="note_on-source">
|
604
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
605
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">note_on</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">vel</span>)
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
391
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 69</span>
|
392
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">note_on</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">vel</span>)
|
393
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">vel</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
394
|
+
<span class="ruby-identifier">note_off</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-value">64</span>)
|
395
|
+
<span class="ruby-keyword">return</span>
|
396
|
+
<span class="ruby-keyword">end</span>
|
397
|
+
|
398
|
+
<span class="ruby-identifier">on</span> = <span class="ruby-constant">NoteOn</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">vel</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
399
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">on</span>
|
400
|
+
<span class="ruby-ivar">@pending</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">on</span>
|
401
|
+
<span class="ruby-identifier">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
615
402
|
<span class="ruby-keyword">end</span></pre>
|
616
|
-
</div
|
617
|
-
|
403
|
+
</div>
|
618
404
|
</div>
|
619
405
|
|
620
|
-
|
621
406
|
|
622
|
-
|
623
|
-
</div><!-- note_on-method -->
|
407
|
+
</div>
|
624
408
|
|
625
|
-
|
626
409
|
<div id="method-i-pitch_bend" class="method-detail ">
|
627
|
-
|
628
410
|
<div class="method-heading">
|
629
411
|
<span class="method-name">pitch_bend</span><span
|
630
412
|
class="method-args">(chan, lsb, msb)</span>
|
631
413
|
<span class="method-click-advice">click to toggle source</span>
|
632
414
|
</div>
|
633
|
-
|
634
415
|
|
635
416
|
<div class="method-description">
|
636
417
|
|
637
|
-
|
638
|
-
|
639
418
|
|
640
|
-
|
641
419
|
<div class="method-source-code" id="pitch_bend-source">
|
642
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
643
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pitch_bend</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">lsb</span>, <span class="ruby-identifier">msb</span>)
|
644
|
-
|
645
|
-
|
420
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 127</span>
|
421
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pitch_bend</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">lsb</span>, <span class="ruby-identifier">msb</span>)
|
422
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">PitchBend</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chan</span>, (<span class="ruby-identifier">msb</span> <span class="ruby-operator"><<</span> <span class="ruby-value">7</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">lsb</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
423
|
+
<span class="ruby-identifier">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
646
424
|
<span class="ruby-keyword">end</span></pre>
|
647
|
-
</div
|
648
|
-
|
425
|
+
</div>
|
649
426
|
</div>
|
650
427
|
|
651
|
-
|
652
428
|
|
653
|
-
|
654
|
-
</div><!-- pitch_bend-method -->
|
429
|
+
</div>
|
655
430
|
|
656
|
-
|
657
431
|
<div id="method-i-pressure" class="method-detail ">
|
658
|
-
|
659
432
|
<div class="method-heading">
|
660
433
|
<span class="method-name">pressure</span><span
|
661
434
|
class="method-args">(chan, note, press)</span>
|
662
435
|
<span class="method-click-advice">click to toggle source</span>
|
663
436
|
</div>
|
664
|
-
|
665
437
|
|
666
438
|
<div class="method-description">
|
667
439
|
|
668
|
-
|
669
|
-
|
670
440
|
|
671
|
-
|
672
441
|
<div class="method-source-code" id="pressure-source">
|
673
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
674
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pressure</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">press</span>)
|
675
|
-
|
676
|
-
|
442
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 117</span>
|
443
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pressure</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">press</span>)
|
444
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">PolyPressure</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">note</span>, <span class="ruby-identifier">press</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
445
|
+
<span class="ruby-identifier">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
677
446
|
<span class="ruby-keyword">end</span></pre>
|
678
|
-
</div
|
679
|
-
|
447
|
+
</div>
|
680
448
|
</div>
|
681
449
|
|
682
|
-
|
683
450
|
|
684
|
-
|
685
|
-
</div><!-- pressure-method -->
|
451
|
+
</div>
|
686
452
|
|
687
|
-
|
688
453
|
<div id="method-i-program" class="method-detail ">
|
689
|
-
|
690
454
|
<div class="method-heading">
|
691
455
|
<span class="method-name">program</span><span
|
692
456
|
class="method-args">(chan, program)</span>
|
693
457
|
<span class="method-click-advice">click to toggle source</span>
|
694
458
|
</div>
|
695
|
-
|
696
459
|
|
697
460
|
<div class="method-description">
|
698
461
|
|
699
|
-
|
700
|
-
|
701
462
|
|
702
|
-
|
703
463
|
<div class="method-source-code" id="program-source">
|
704
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
705
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">program</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">program</span>)
|
706
|
-
|
707
|
-
|
464
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 132</span>
|
465
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">program</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">program</span>)
|
466
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">ProgramChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">program</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
467
|
+
<span class="ruby-identifier">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
708
468
|
<span class="ruby-keyword">end</span></pre>
|
709
|
-
</div
|
710
|
-
|
469
|
+
</div>
|
711
470
|
</div>
|
712
471
|
|
713
|
-
|
714
472
|
|
715
|
-
|
716
|
-
</div><!-- program-method -->
|
473
|
+
</div>
|
717
474
|
|
718
|
-
|
719
475
|
<div id="method-i-start_track" class="method-detail ">
|
720
|
-
|
721
476
|
<div class="method-heading">
|
722
477
|
<span class="method-name">start_track</span><span
|
723
478
|
class="method-args">()</span>
|
724
479
|
<span class="method-click-advice">click to toggle source</span>
|
725
480
|
</div>
|
726
|
-
|
727
481
|
|
728
482
|
<div class="method-description">
|
729
483
|
|
730
|
-
|
731
|
-
|
732
484
|
|
733
|
-
|
734
485
|
<div class="method-source-code" id="start_track-source">
|
735
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
736
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">start_track</span>
|
737
|
-
|
738
|
-
|
486
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 42</span>
|
487
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">start_track</span>
|
488
|
+
<span class="ruby-ivar">@track</span> = <span class="ruby-constant">Track</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@seq</span>)
|
489
|
+
<span class="ruby-ivar">@seq</span>.<span class="ruby-identifier">tracks</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@track</span>
|
739
490
|
|
740
|
-
|
491
|
+
<span class="ruby-ivar">@pending</span> = []
|
741
492
|
<span class="ruby-keyword">end</span></pre>
|
742
|
-
</div
|
743
|
-
|
493
|
+
</div>
|
744
494
|
</div>
|
745
495
|
|
746
|
-
|
747
496
|
|
748
|
-
|
749
|
-
</div><!-- start_track-method -->
|
497
|
+
</div>
|
750
498
|
|
751
|
-
|
752
499
|
<div id="method-i-sysex" class="method-detail ">
|
753
|
-
|
754
500
|
<div class="method-heading">
|
755
501
|
<span class="method-name">sysex</span><span
|
756
502
|
class="method-args">(msg)</span>
|
757
503
|
<span class="method-click-advice">click to toggle source</span>
|
758
504
|
</div>
|
759
|
-
|
760
505
|
|
761
506
|
<div class="method-description">
|
762
507
|
|
763
|
-
|
764
|
-
|
765
508
|
|
766
|
-
|
767
509
|
<div class="method-source-code" id="sysex-source">
|
768
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
769
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sysex</span>(<span class="ruby-identifier">msg</span>)
|
770
|
-
|
510
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 142</span>
|
511
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sysex</span>(<span class="ruby-identifier">msg</span>)
|
512
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">SystemExclusive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
771
513
|
<span class="ruby-keyword">end</span></pre>
|
772
|
-
</div
|
773
|
-
|
514
|
+
</div>
|
774
515
|
</div>
|
775
516
|
|
776
|
-
|
777
517
|
|
778
|
-
|
779
|
-
</div><!-- sysex-method -->
|
518
|
+
</div>
|
780
519
|
|
781
|
-
|
782
520
|
<div id="method-i-tempo" class="method-detail ">
|
783
|
-
|
784
521
|
<div class="method-heading">
|
785
522
|
<span class="method-name">tempo</span><span
|
786
523
|
class="method-args">(microsecs)</span>
|
787
524
|
<span class="method-click-advice">click to toggle source</span>
|
788
525
|
</div>
|
789
|
-
|
790
526
|
|
791
527
|
<div class="method-description">
|
792
|
-
|
793
|
-
<p>--</p>
|
528
|
+
<p>–</p>
|
794
529
|
|
795
|
-
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier">smpte</span>(<span class="ruby-identifier">hour</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">sec</span>, <span class="ruby-identifier">frame</span>, <span class="ruby-identifier">fract</span>)
|
530
|
+
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">smpte</span>(<span class="ruby-identifier">hour</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">sec</span>, <span class="ruby-identifier">frame</span>, <span class="ruby-identifier">fract</span>)
|
796
531
|
<span class="ruby-keyword">end</span>
|
797
532
|
</pre>
|
798
533
|
|
799
534
|
<p>++</p>
|
800
|
-
|
801
535
|
|
802
|
-
|
803
536
|
<div class="method-source-code" id="tempo-source">
|
804
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
805
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">tempo</span>(<span class="ruby-identifier">microsecs</span>)
|
806
|
-
|
537
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 191</span>
|
538
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tempo</span>(<span class="ruby-identifier">microsecs</span>)
|
539
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Tempo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">microsecs</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
807
540
|
<span class="ruby-keyword">end</span></pre>
|
808
|
-
</div
|
809
|
-
|
541
|
+
</div>
|
810
542
|
</div>
|
811
543
|
|
812
|
-
|
813
544
|
|
814
|
-
|
815
|
-
</div><!-- tempo-method -->
|
545
|
+
</div>
|
816
546
|
|
817
|
-
|
818
547
|
<div id="method-i-text" class="method-detail ">
|
819
|
-
|
820
548
|
<div class="method-heading">
|
821
549
|
<span class="method-name">text</span><span
|
822
550
|
class="method-args">(type, msg)</span>
|
823
551
|
<span class="method-click-advice">click to toggle source</span>
|
824
552
|
</div>
|
825
|
-
|
826
553
|
|
827
554
|
<div class="method-description">
|
828
|
-
|
829
|
-
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier">sequence_number</span>(<span class="ruby-identifier">num</span>)
|
555
|
+
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sequence_number</span>(<span class="ruby-identifier">num</span>)
|
830
556
|
<span class="ruby-keyword">end</span>
|
831
557
|
</pre>
|
832
558
|
|
833
559
|
<p>++</p>
|
834
|
-
|
835
560
|
|
836
|
-
|
837
561
|
<div class="method-source-code" id="text-source">
|
838
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
839
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">text</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">msg</span>)
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
<span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"text = #{msg}, type = #{type}"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$DEBUG</span>
|
851
|
-
<span class="ruby-keyword">end</span>
|
562
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 158</span>
|
563
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">text</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">msg</span>)
|
564
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
|
565
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_TEXT</span>, <span class="ruby-constant">META_LYRIC</span>, <span class="ruby-constant">META_CUE</span>, <span class="ruby-constant">META_SEQ_NAME</span>, <span class="ruby-constant">META_COPYRIGHT</span>
|
566
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">MetaEvent</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
567
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_INSTRUMENT</span>
|
568
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">instrument</span> = <span class="ruby-identifier">msg</span>
|
569
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">META_MARKER</span>
|
570
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Marker</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
571
|
+
<span class="ruby-keyword">else</span>
|
572
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-node">"text = #{msg}, type = #{type}"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$DEBUG</span>
|
573
|
+
<span class="ruby-keyword">end</span>
|
852
574
|
<span class="ruby-keyword">end</span></pre>
|
853
|
-
</div
|
854
|
-
|
575
|
+
</div>
|
855
576
|
</div>
|
856
577
|
|
857
|
-
|
858
578
|
|
859
|
-
|
860
|
-
</div><!-- text-method -->
|
579
|
+
</div>
|
861
580
|
|
862
|
-
|
863
581
|
<div id="method-i-time_signature" class="method-detail ">
|
864
|
-
|
865
582
|
<div class="method-heading">
|
866
583
|
<span class="method-name">time_signature</span><span
|
867
584
|
class="method-args">(numer, denom, clocks, qnotes)</span>
|
868
585
|
<span class="method-click-advice">click to toggle source</span>
|
869
586
|
</div>
|
870
|
-
|
871
587
|
|
872
588
|
<div class="method-description">
|
873
|
-
|
874
|
-
<p>-- Don't bother adding the META_TRACK_END event to the track. This way, we
|
875
|
-
don't have to worry about always making sure the last event is always a
|
876
|
-
track end event. We just have to make sure to write one when the track is
|
877
|
-
output back to a file.</p>
|
589
|
+
<p>– Don’t bother adding the META_TRACK_END event to the track. This way, we don’t have to worry about always making sure the last event is always a track end event. We just have to make sure to write one when the track is output back to a file.</p>
|
878
590
|
|
879
|
-
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier">eot</span>()
|
591
|
+
<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">eot</span>()
|
880
592
|
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">MetaEvent</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">META_TRACK_END</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
881
593
|
<span class="ruby-keyword">end</span>
|
882
594
|
</pre>
|
883
595
|
|
884
596
|
<p>++</p>
|
885
|
-
|
886
597
|
|
887
|
-
|
888
598
|
<div class="method-source-code" id="time_signature-source">
|
889
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
890
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">time_signature</span>(<span class="ruby-identifier">numer</span>, <span class="ruby-identifier">denom</span>, <span class="ruby-identifier">clocks</span>, <span class="ruby-identifier">qnotes</span>)
|
891
|
-
|
892
|
-
|
599
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 181</span>
|
600
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">time_signature</span>(<span class="ruby-identifier">numer</span>, <span class="ruby-identifier">denom</span>, <span class="ruby-identifier">clocks</span>, <span class="ruby-identifier">qnotes</span>)
|
601
|
+
<span class="ruby-ivar">@seq</span>.<span class="ruby-identifier">time_signature</span>(<span class="ruby-identifier">numer</span>, <span class="ruby-identifier">denom</span>, <span class="ruby-identifier">clocks</span>, <span class="ruby-identifier">qnotes</span>)
|
602
|
+
<span class="ruby-ivar">@track</span>.<span class="ruby-identifier">events</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">TimeSig</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numer</span>, <span class="ruby-identifier">denom</span>, <span class="ruby-identifier">clocks</span>, <span class="ruby-identifier">qnotes</span>, <span class="ruby-ivar">@curr_ticks</span>)
|
893
603
|
<span class="ruby-keyword">end</span></pre>
|
894
|
-
</div
|
895
|
-
|
604
|
+
</div>
|
896
605
|
</div>
|
897
606
|
|
898
|
-
|
899
607
|
|
900
|
-
|
901
|
-
</div><!-- time_signature-method -->
|
608
|
+
</div>
|
902
609
|
|
903
|
-
|
904
610
|
<div id="method-i-track_uses_channel" class="method-detail ">
|
905
|
-
|
906
611
|
<div class="method-heading">
|
907
612
|
<span class="method-name">track_uses_channel</span><span
|
908
613
|
class="method-args">(chan)</span>
|
909
614
|
<span class="method-click-advice">click to toggle source</span>
|
910
615
|
</div>
|
911
|
-
|
912
616
|
|
913
617
|
<div class="method-description">
|
914
|
-
|
915
618
|
<p>Return true if the current track uses the specified channel.</p>
|
916
|
-
|
917
619
|
|
918
|
-
|
919
620
|
<div class="method-source-code" id="track_uses_channel-source">
|
920
|
-
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line
|
921
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
922
|
-
|
621
|
+
<pre><span class="ruby-comment"># File lib/midilib/io/seqreader.rb, line 205</span>
|
622
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">track_uses_channel</span>(<span class="ruby-identifier">chan</span>)
|
623
|
+
<span class="ruby-ivar">@chan_mask</span> <span class="ruby-operator">|=</span> (<span class="ruby-value">1</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">chan</span>)
|
923
624
|
<span class="ruby-keyword">end</span></pre>
|
924
|
-
</div
|
925
|
-
|
625
|
+
</div>
|
926
626
|
</div>
|
927
627
|
|
928
|
-
|
929
628
|
|
930
|
-
|
931
|
-
</div><!-- track_uses_channel-method -->
|
629
|
+
</div>
|
932
630
|
|
933
|
-
|
934
|
-
</section><!-- public-instance-method-details -->
|
935
|
-
|
936
|
-
</section><!-- 5Buntitled-5D -->
|
631
|
+
</section>
|
937
632
|
|
938
|
-
</
|
633
|
+
</section>
|
634
|
+
</main>
|
939
635
|
|
940
636
|
|
941
|
-
<footer id="validator-badges">
|
942
|
-
<p><a href="
|
943
|
-
<p>Generated by <a href="https://github.
|
944
|
-
<p>
|
637
|
+
<footer id="validator-badges" role="contentinfo">
|
638
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
639
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
640
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
945
641
|
</footer>
|
946
642
|
|