midilib 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +87 -0
- data/Credits +8 -0
- data/README +361 -0
- data/Rakefile +68 -0
- data/TODO +25 -0
- data/examples/NoFences.mid +0 -0
- data/examples/from_scratch.mid +0 -0
- data/examples/from_scratch.rb +56 -0
- data/examples/reader2text.rb +220 -0
- data/examples/seq2text.rb +41 -0
- data/examples/strings.rb +34 -0
- data/examples/transpose.rb +75 -0
- data/html/classes/MIDI.html +738 -0
- data/html/classes/MIDI/ActiveSense.html +156 -0
- data/html/classes/MIDI/ActiveSense.src/M000136.html +18 -0
- data/html/classes/MIDI/ActiveSense.src/M000137.html +18 -0
- data/html/classes/MIDI/ChannelEvent.html +179 -0
- data/html/classes/MIDI/ChannelEvent.src/M000124.html +20 -0
- data/html/classes/MIDI/ChannelEvent.src/M000125.html +18 -0
- data/html/classes/MIDI/ChannelPressure.html +184 -0
- data/html/classes/MIDI/ChannelPressure.src/M000088.html +19 -0
- data/html/classes/MIDI/ChannelPressure.src/M000089.html +21 -0
- data/html/classes/MIDI/ChannelPressure.src/M000090.html +18 -0
- data/html/classes/MIDI/Clock.html +156 -0
- data/html/classes/MIDI/Clock.src/M000134.html +18 -0
- data/html/classes/MIDI/Clock.src/M000135.html +18 -0
- data/html/classes/MIDI/Continue.html +156 -0
- data/html/classes/MIDI/Continue.src/M000132.html +18 -0
- data/html/classes/MIDI/Continue.src/M000133.html +18 -0
- data/html/classes/MIDI/Controller.html +189 -0
- data/html/classes/MIDI/Controller.src/M000129.html +21 -0
- data/html/classes/MIDI/Controller.src/M000130.html +22 -0
- data/html/classes/MIDI/Controller.src/M000131.html +18 -0
- data/html/classes/MIDI/Event.html +424 -0
- data/html/classes/MIDI/Event.src/M000145.html +27 -0
- data/html/classes/MIDI/Event.src/M000146.html +18 -0
- data/html/classes/MIDI/Event.src/M000147.html +18 -0
- data/html/classes/MIDI/Event.src/M000148.html +18 -0
- data/html/classes/MIDI/Event.src/M000149.html +18 -0
- data/html/classes/MIDI/Event.src/M000150.html +18 -0
- data/html/classes/MIDI/Event.src/M000151.html +18 -0
- data/html/classes/MIDI/Event.src/M000152.html +18 -0
- data/html/classes/MIDI/Event.src/M000153.html +18 -0
- data/html/classes/MIDI/Event.src/M000154.html +22 -0
- data/html/classes/MIDI/Event.src/M000155.html +18 -0
- data/html/classes/MIDI/Event.src/M000156.html +18 -0
- data/html/classes/MIDI/Event.src/M000157.html +18 -0
- data/html/classes/MIDI/IO.html +121 -0
- data/html/classes/MIDI/IO/MIDIFile.html +925 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000028.html +22 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000029.html +24 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000030.html +19 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000031.html +19 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000032.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000033.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000034.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000035.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000036.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000037.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000038.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000039.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000040.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000041.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000042.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000043.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000044.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000045.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000046.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000047.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000048.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000049.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000050.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000051.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000052.html +17 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000053.html +43 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000054.html +34 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000055.html +96 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000056.html +18 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000057.html +48 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000058.html +42 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000059.html +19 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000060.html +19 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000061.html +20 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000062.html +21 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000063.html +31 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000064.html +20 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000065.html +22 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000066.html +30 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000067.html +18 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000068.html +20 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000069.html +18 -0
- data/html/classes/MIDI/IO/MIDIFile.src/M000070.html +18 -0
- data/html/classes/MIDI/IO/SeqReader.html +460 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000001.html +22 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000002.html +22 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000003.html +21 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000004.html +34 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000005.html +26 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000006.html +28 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000007.html +21 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000008.html +19 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000009.html +19 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000010.html +19 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000011.html +19 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000012.html +19 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000013.html +18 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000014.html +18 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000015.html +27 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000016.html +18 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000017.html +18 -0
- data/html/classes/MIDI/IO/SeqReader.src/M000018.html +18 -0
- data/html/classes/MIDI/IO/SeqWriter.html +267 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000019.html +19 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000020.html +25 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000021.html +22 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000022.html +54 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000023.html +49 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000024.html +21 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000025.html +19 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000026.html +24 -0
- data/html/classes/MIDI/IO/SeqWriter.src/M000027.html +26 -0
- data/html/classes/MIDI/Marker.html +139 -0
- data/html/classes/MIDI/Marker.src/M000107.html +18 -0
- data/html/classes/MIDI/MetaEvent.html +189 -0
- data/html/classes/MIDI/MetaEvent.src/M000167.html +21 -0
- data/html/classes/MIDI/MetaEvent.src/M000168.html +23 -0
- data/html/classes/MIDI/MetaEvent.src/M000169.html +53 -0
- data/html/classes/MIDI/NoteEvent.html +233 -0
- data/html/classes/MIDI/NoteEvent.src/M000091.html +21 -0
- data/html/classes/MIDI/NoteEvent.src/M000092.html +20 -0
- data/html/classes/MIDI/NoteEvent.src/M000093.html +18 -0
- data/html/classes/MIDI/NoteEvent.src/M000094.html +22 -0
- data/html/classes/MIDI/NoteOffEvent.html +169 -0
- data/html/classes/MIDI/NoteOffEvent.src/M000086.html +19 -0
- data/html/classes/MIDI/NoteOffEvent.src/M000087.html +19 -0
- data/html/classes/MIDI/NoteOnEvent.html +169 -0
- data/html/classes/MIDI/NoteOnEvent.src/M000102.html +19 -0
- data/html/classes/MIDI/NoteOnEvent.src/M000103.html +19 -0
- data/html/classes/MIDI/PitchBend.html +184 -0
- data/html/classes/MIDI/PitchBend.src/M000104.html +19 -0
- data/html/classes/MIDI/PitchBend.src/M000105.html +22 -0
- data/html/classes/MIDI/PitchBend.src/M000106.html +18 -0
- data/html/classes/MIDI/PolyPressure.html +186 -0
- data/html/classes/MIDI/PolyPressure.src/M000170.html +18 -0
- data/html/classes/MIDI/PolyPressure.src/M000171.html +18 -0
- data/html/classes/MIDI/PolyPressure.src/M000172.html +18 -0
- data/html/classes/MIDI/PolyPressure.src/M000173.html +19 -0
- data/html/classes/MIDI/ProgramChange.html +184 -0
- data/html/classes/MIDI/ProgramChange.src/M000099.html +19 -0
- data/html/classes/MIDI/ProgramChange.src/M000100.html +21 -0
- data/html/classes/MIDI/ProgramChange.src/M000101.html +18 -0
- data/html/classes/MIDI/Realtime.html +171 -0
- data/html/classes/MIDI/Realtime.src/M000083.html +19 -0
- data/html/classes/MIDI/Realtime.src/M000084.html +20 -0
- data/html/classes/MIDI/Realtime.src/M000085.html +18 -0
- data/html/classes/MIDI/Sequence.html +469 -0
- data/html/classes/MIDI/Sequence.src/M000108.html +28 -0
- data/html/classes/MIDI/Sequence.src/M000109.html +21 -0
- data/html/classes/MIDI/Sequence.src/M000110.html +22 -0
- data/html/classes/MIDI/Sequence.src/M000113.html +18 -0
- data/html/classes/MIDI/Sequence.src/M000114.html +27 -0
- data/html/classes/MIDI/Sequence.src/M000115.html +18 -0
- data/html/classes/MIDI/Sequence.src/M000116.html +19 -0
- data/html/classes/MIDI/Sequence.src/M000117.html +19 -0
- data/html/classes/MIDI/Sequence.src/M000118.html +20 -0
- data/html/classes/MIDI/Sequence.src/M000119.html +19 -0
- data/html/classes/MIDI/Sequence.src/M000120.html +18 -0
- data/html/classes/MIDI/SongPointer.html +184 -0
- data/html/classes/MIDI/SongPointer.src/M000138.html +19 -0
- data/html/classes/MIDI/SongPointer.src/M000139.html +22 -0
- data/html/classes/MIDI/SongPointer.src/M000140.html +18 -0
- data/html/classes/MIDI/SongSelect.html +184 -0
- data/html/classes/MIDI/SongSelect.src/M000126.html +19 -0
- data/html/classes/MIDI/SongSelect.src/M000127.html +21 -0
- data/html/classes/MIDI/SongSelect.src/M000128.html +18 -0
- data/html/classes/MIDI/Start.html +156 -0
- data/html/classes/MIDI/Start.src/M000097.html +18 -0
- data/html/classes/MIDI/Start.src/M000098.html +18 -0
- data/html/classes/MIDI/Stop.html +156 -0
- data/html/classes/MIDI/Stop.src/M000095.html +18 -0
- data/html/classes/MIDI/Stop.src/M000096.html +18 -0
- data/html/classes/MIDI/SystemCommon.html +139 -0
- data/html/classes/MIDI/SystemCommon.src/M000144.html +19 -0
- data/html/classes/MIDI/SystemExclusive.html +184 -0
- data/html/classes/MIDI/SystemExclusive.src/M000141.html +19 -0
- data/html/classes/MIDI/SystemExclusive.src/M000142.html +23 -0
- data/html/classes/MIDI/SystemExclusive.src/M000143.html +18 -0
- data/html/classes/MIDI/SystemReset.html +156 -0
- data/html/classes/MIDI/SystemReset.src/M000081.html +18 -0
- data/html/classes/MIDI/SystemReset.src/M000082.html +18 -0
- data/html/classes/MIDI/Tempo.html +250 -0
- data/html/classes/MIDI/Tempo.src/M000158.html +18 -0
- data/html/classes/MIDI/Tempo.src/M000159.html +18 -0
- data/html/classes/MIDI/Tempo.src/M000160.html +18 -0
- data/html/classes/MIDI/Tempo.src/M000161.html +18 -0
- data/html/classes/MIDI/Tempo.src/M000162.html +18 -0
- data/html/classes/MIDI/Tempo.src/M000163.html +25 -0
- data/html/classes/MIDI/Tempo.src/M000164.html +18 -0
- data/html/classes/MIDI/Track.html +380 -0
- data/html/classes/MIDI/Track.src/M000071.html +23 -0
- data/html/classes/MIDI/Track.src/M000072.html +21 -0
- data/html/classes/MIDI/Track.src/M000073.html +26 -0
- data/html/classes/MIDI/Track.src/M000074.html +18 -0
- data/html/classes/MIDI/Track.src/M000075.html +22 -0
- data/html/classes/MIDI/Track.src/M000076.html +20 -0
- data/html/classes/MIDI/Track.src/M000077.html +22 -0
- data/html/classes/MIDI/Track.src/M000078.html +22 -0
- data/html/classes/MIDI/Track.src/M000079.html +18 -0
- data/html/classes/MIDI/Track.src/M000080.html +19 -0
- data/html/classes/MIDI/TuneRequest.html +171 -0
- data/html/classes/MIDI/TuneRequest.src/M000121.html +18 -0
- data/html/classes/MIDI/TuneRequest.src/M000122.html +20 -0
- data/html/classes/MIDI/TuneRequest.src/M000123.html +18 -0
- data/html/classes/MIDI/Utils.html +190 -0
- data/html/classes/MIDI/Utils.src/M000165.html +20 -0
- data/html/classes/MIDI/Utils.src/M000166.html +25 -0
- data/html/created.rid +1 -0
- data/html/files/README.html +599 -0
- data/html/files/TODO.html +142 -0
- data/html/files/lib/midilib/consts_rb.html +107 -0
- data/html/files/lib/midilib/event_rb.html +109 -0
- data/html/files/lib/midilib/info_rb.html +101 -0
- data/html/files/lib/midilib/io/midifile_rb.html +108 -0
- data/html/files/lib/midilib/io/seqreader_rb.html +110 -0
- data/html/files/lib/midilib/io/seqwriter_rb.html +115 -0
- data/html/files/lib/midilib/sequence_rb.html +109 -0
- data/html/files/lib/midilib/track_rb.html +108 -0
- data/html/files/lib/midilib/utils_rb.html +101 -0
- data/html/files/lib/midilib_rb.html +124 -0
- data/html/fr_class_index.html +59 -0
- data/html/fr_file_index.html +38 -0
- data/html/fr_method_index.html +199 -0
- data/html/index.html +24 -0
- data/html/rdoc-style.css +208 -0
- data/install.rb +57 -0
- data/lib/midilib.rb +16 -0
- data/lib/midilib/consts.rb +422 -0
- data/lib/midilib/event.rb +559 -0
- data/lib/midilib/info.rb +9 -0
- data/lib/midilib/io/midifile.rb +446 -0
- data/lib/midilib/io/seqreader.rb +198 -0
- data/lib/midilib/io/seqwriter.rb +151 -0
- data/lib/midilib/sequence.rb +144 -0
- data/lib/midilib/track.rb +115 -0
- data/lib/midilib/utils.rb +36 -0
- data/test/event_equality.rb +81 -0
- data/test/test_event.rb +116 -0
- data/test/test_io.rb +55 -0
- data/test/test_sequence.rb +68 -0
- data/test/test_track.rb +111 -0
- data/test/test_varlen.rb +40 -0
- metadata +330 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>key_signature (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 129</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_signature</span>(<span class="ruby-identifier">sharpflat</span>, <span class="ruby-identifier">is_minor</span>)
|
15
|
+
<span class="ruby-keyword kw">end</span></pre>
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>arbitrary (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 132</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">arbitrary</span>(<span class="ruby-identifier">msg</span>)
|
15
|
+
<span class="ruby-keyword kw">end</span></pre>
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>read_mt_header_string (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 140</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_mt_header_string</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">skip</span>)
|
15
|
+
<span class="ruby-identifier">b</span> = <span class="ruby-value str">''</span>
|
16
|
+
<span class="ruby-identifier">bytes_to_read</span> = <span class="ruby-value">4</span>
|
17
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
18
|
+
<span class="ruby-identifier">b</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">bytes_to_read</span>)
|
19
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator"><</span> <span class="ruby-value">4</span>
|
20
|
+
<span class="ruby-identifier">error</span>(<span class="ruby-value str">"unexpected EOF while trying to read header"</span> <span class="ruby-operator">+</span>
|
21
|
+
<span class="ruby-node">" string #{s}"</span>)
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-ivar">@bytes_to_be_read</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">bytes_to_read</span>
|
24
|
+
|
25
|
+
<span class="ruby-comment cmt"># See if we found the string we're looking for</span>
|
26
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">s</span>
|
27
|
+
|
28
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">skip</span> <span class="ruby-comment cmt"># Try again with the next char</span>
|
29
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">s</span>[<span class="ruby-value">0</span>], <span class="ruby-value">1</span>)
|
30
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">nil?</span>
|
31
|
+
<span class="ruby-identifier">b</span> = <span class="ruby-value str">''</span>
|
32
|
+
<span class="ruby-identifier">bytes_to_read</span> = <span class="ruby-value">4</span>
|
33
|
+
<span class="ruby-keyword kw">else</span>
|
34
|
+
<span class="ruby-identifier">b</span> = <span class="ruby-identifier">b</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
35
|
+
<span class="ruby-identifier">bytes_to_read</span> = <span class="ruby-value">4</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">i</span>
|
36
|
+
<span class="ruby-keyword kw">end</span>
|
37
|
+
<span class="ruby-keyword kw">else</span>
|
38
|
+
<span class="ruby-identifier">error</span>(<span class="ruby-node">"header string #{s} not found"</span>)
|
39
|
+
<span class="ruby-keyword kw">end</span>
|
40
|
+
<span class="ruby-keyword kw">end</span>
|
41
|
+
<span class="ruby-keyword kw">end</span></pre>
|
42
|
+
</body>
|
43
|
+
</html>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>read_header (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 170</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_header</span>
|
15
|
+
<span class="ruby-ivar">@bytes_to_be_read</span> = <span class="ruby-value">0</span>
|
16
|
+
<span class="ruby-identifier">read_mt_header_string</span>(<span class="ruby-value str">'MThd'</span>, <span class="ruby-ivar">@skip_init</span>)
|
17
|
+
|
18
|
+
<span class="ruby-ivar">@bytes_to_be_read</span> = <span class="ruby-identifier">read32</span>()
|
19
|
+
<span class="ruby-identifier">format</span> = <span class="ruby-identifier">read16</span>()
|
20
|
+
<span class="ruby-identifier">ntrks</span> = <span class="ruby-identifier">read16</span>()
|
21
|
+
<span class="ruby-identifier">division</span> = <span class="ruby-identifier">read16</span>()
|
22
|
+
|
23
|
+
<span class="ruby-identifier">header</span>(<span class="ruby-identifier">format</span>, <span class="ruby-identifier">ntrks</span>, <span class="ruby-identifier">division</span>)
|
24
|
+
|
25
|
+
<span class="ruby-comment cmt"># Flush any extra stuff, in case the length of the header is not 6</span>
|
26
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@bytes_to_be_read</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
27
|
+
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@bytes_to_be_read</span>)
|
28
|
+
<span class="ruby-ivar">@bytes_to_be_read</span> = <span class="ruby-value">0</span>
|
29
|
+
<span class="ruby-keyword kw">end</span>
|
30
|
+
|
31
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ntrks</span>
|
32
|
+
<span class="ruby-keyword kw">end</span></pre>
|
33
|
+
</body>
|
34
|
+
</html>
|
@@ -0,0 +1,96 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>read_track (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 191</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_track</span>
|
15
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">c1</span> = <span class="ruby-identifier">type</span> = <span class="ruby-identifier">needed</span> = <span class="ruby-value">0</span>
|
16
|
+
<span class="ruby-identifier">sysex_continue</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># True if last msg was unfinished</span>
|
17
|
+
<span class="ruby-identifier">running</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># True when running status used</span>
|
18
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-value">0</span> <span class="ruby-comment cmt"># (Possibly running) status byte</span>
|
19
|
+
|
20
|
+
<span class="ruby-ivar">@bytes_to_be_read</span> = <span class="ruby-value">0</span>
|
21
|
+
<span class="ruby-identifier">read_mt_header_string</span>(<span class="ruby-value str">'MTrk'</span>, <span class="ruby-keyword kw">false</span>)
|
22
|
+
|
23
|
+
<span class="ruby-ivar">@bytes_to_be_read</span> = <span class="ruby-identifier">read32</span>()
|
24
|
+
<span class="ruby-ivar">@curr_ticks</span> = <span class="ruby-ivar">@ticks_so_far</span> = <span class="ruby-value">0</span>
|
25
|
+
|
26
|
+
<span class="ruby-identifier">start_track</span>()
|
27
|
+
|
28
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@bytes_to_be_read</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
29
|
+
<span class="ruby-ivar">@curr_ticks</span> = <span class="ruby-identifier">read_var_len</span>() <span class="ruby-comment cmt"># Delta time</span>
|
30
|
+
<span class="ruby-ivar">@ticks_so_far</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@curr_ticks</span>
|
31
|
+
|
32
|
+
<span class="ruby-comment cmt"># Copy raw var num data into raw time stamp data</span>
|
33
|
+
<span class="ruby-ivar">@raw_time_stamp_data</span> = <span class="ruby-ivar">@raw_var_num_data</span>.<span class="ruby-identifier">dup</span>()
|
34
|
+
|
35
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">getc</span>() <span class="ruby-comment cmt"># Read first byte</span>
|
36
|
+
|
37
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sysex_continue</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">EOX</span>
|
38
|
+
<span class="ruby-identifier">error</span>(<span class="ruby-value str">"didn't find expected continuation of a sysex"</span>)
|
39
|
+
<span class="ruby-keyword kw">end</span>
|
40
|
+
|
41
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">c</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x80</span>).<span class="ruby-identifier">zero?</span> <span class="ruby-comment cmt"># Running status?</span>
|
42
|
+
<span class="ruby-identifier">error</span>(<span class="ruby-value str">'unexpected running status'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">zero?</span>
|
43
|
+
<span class="ruby-identifier">running</span> = <span class="ruby-keyword kw">true</span>
|
44
|
+
<span class="ruby-keyword kw">else</span>
|
45
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">c</span>
|
46
|
+
<span class="ruby-identifier">running</span> = <span class="ruby-keyword kw">false</span>
|
47
|
+
<span class="ruby-keyword kw">end</span>
|
48
|
+
|
49
|
+
<span class="ruby-identifier">needed</span> = <span class="ruby-constant">NUM_DATA_BYTES</span>[(<span class="ruby-identifier">status</span> <span class="ruby-operator">>></span> <span class="ruby-value">4</span>) <span class="ruby-operator">&</span> <span class="ruby-value">0x0f</span>]
|
50
|
+
|
51
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">needed</span>.<span class="ruby-identifier">nonzero?</span> <span class="ruby-comment cmt"># i.e., is it a channel message?</span>
|
52
|
+
<span class="ruby-identifier">c1</span> = <span class="ruby-identifier">running</span> <span class="ruby-value">? </span><span class="ruby-identifier">c</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">getc</span>() <span class="ruby-operator">&</span> <span class="ruby-value">0x7f</span>)
|
53
|
+
|
54
|
+
<span class="ruby-comment cmt"># The "& 0x7f" here may seem unnecessary, but I've seen</span>
|
55
|
+
<span class="ruby-comment cmt"># "bad" MIDI files that had, for example, volume bytes</span>
|
56
|
+
<span class="ruby-comment cmt"># with the upper bit set. This code should not harm</span>
|
57
|
+
<span class="ruby-comment cmt"># proper data.</span>
|
58
|
+
<span class="ruby-identifier">chan_message</span>(<span class="ruby-identifier">running</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">c1</span>,
|
59
|
+
(<span class="ruby-identifier">needed</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>) <span class="ruby-operator">?</span> (<span class="ruby-identifier">getc</span>() <span class="ruby-operator">&</span> <span class="ruby-value">0x7f</span>) <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
|
60
|
+
<span class="ruby-keyword kw">next</span>
|
61
|
+
<span class="ruby-keyword kw">end</span>
|
62
|
+
|
63
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">c</span>
|
64
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_EVENT</span> <span class="ruby-comment cmt"># Meta event</span>
|
65
|
+
<span class="ruby-identifier">type</span> = <span class="ruby-identifier">getc</span>()
|
66
|
+
<span class="ruby-identifier">msg_init</span>()
|
67
|
+
<span class="ruby-identifier">msg_read</span>(<span class="ruby-identifier">read_var_len</span>())
|
68
|
+
<span class="ruby-identifier">meta_event</span>(<span class="ruby-identifier">type</span>)
|
69
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">SYSEX</span> <span class="ruby-comment cmt"># Start of system exclusive</span>
|
70
|
+
<span class="ruby-identifier">msg_init</span>()
|
71
|
+
<span class="ruby-identifier">msg_add</span>(<span class="ruby-constant">SYSEX</span>)
|
72
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">msg_read</span>(<span class="ruby-identifier">read_var_len</span>())
|
73
|
+
|
74
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-constant">EOX</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@no_merge</span>
|
75
|
+
<span class="ruby-identifier">handle_sysex</span>(<span class="ruby-identifier">msg</span>())
|
76
|
+
<span class="ruby-keyword kw">else</span>
|
77
|
+
<span class="ruby-identifier">sysex_continue</span> = <span class="ruby-keyword kw">true</span>
|
78
|
+
<span class="ruby-keyword kw">end</span>
|
79
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">EOX</span> <span class="ruby-comment cmt"># Sysex continuation or arbitrary stuff</span>
|
80
|
+
<span class="ruby-identifier">msg_init</span>() <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sysex_continue</span>
|
81
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">msg_read</span>(<span class="ruby-identifier">read_var_len</span>())
|
82
|
+
|
83
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sysex_continue</span>
|
84
|
+
<span class="ruby-identifier">handle_arbitrary</span>(<span class="ruby-identifier">msg</span>())
|
85
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-constant">EOX</span>
|
86
|
+
<span class="ruby-identifier">handle_sysex</span>(<span class="ruby-identifier">msg</span>())
|
87
|
+
<span class="ruby-identifier">sysex_continue</span> = <span class="ruby-keyword kw">false</span>
|
88
|
+
<span class="ruby-keyword kw">end</span>
|
89
|
+
<span class="ruby-keyword kw">else</span>
|
90
|
+
<span class="ruby-identifier">bad_byte</span>(<span class="ruby-identifier">c</span>)
|
91
|
+
<span class="ruby-keyword kw">end</span>
|
92
|
+
<span class="ruby-keyword kw">end</span>
|
93
|
+
<span class="ruby-identifier">end_track</span>()
|
94
|
+
<span class="ruby-keyword kw">end</span></pre>
|
95
|
+
</body>
|
96
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>bad_byte (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 274</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bad_byte</span>(<span class="ruby-identifier">c</span>)
|
15
|
+
<span class="ruby-identifier">error</span>(<span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"unexpected byte: 0x%02x"</span>, <span class="ruby-identifier">c</span>))
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>meta_event (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 279</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_event</span>(<span class="ruby-identifier">type</span>)
|
15
|
+
<span class="ruby-identifier">m</span> = <span class="ruby-identifier">msg</span>() <span class="ruby-comment cmt"># Copy of internal message buffer</span>
|
16
|
+
|
17
|
+
<span class="ruby-comment cmt"># Create raw data array</span>
|
18
|
+
<span class="ruby-ivar">@raw_data</span> = <span class="ruby-value str">''</span>
|
19
|
+
<span class="ruby-ivar">@raw_data</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">META_EVENT</span>
|
20
|
+
<span class="ruby-ivar">@raw_data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">type</span>
|
21
|
+
<span class="ruby-ivar">@raw_data</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@raw_var_num_data</span>
|
22
|
+
<span class="ruby-ivar">@raw_data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">m</span>
|
23
|
+
|
24
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
|
25
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_SEQ_NUM</span>
|
26
|
+
<span class="ruby-identifier">sequence_number</span>((<span class="ruby-identifier">m</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><<</span> <span class="ruby-value">8</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>])
|
27
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_TEXT</span>, <span class="ruby-constant">META_COPYRIGHT</span>, <span class="ruby-constant">META_SEQ_NAME</span>, <span class="ruby-constant">META_INSTRUMENT</span>,
|
28
|
+
<span class="ruby-constant">META_LYRIC</span>, <span class="ruby-constant">META_MARKER</span>, <span class="ruby-constant">META_CUE</span>, <span class="ruby-value">0x08</span>, <span class="ruby-value">0x09</span>, <span class="ruby-value">0x0a</span>,
|
29
|
+
<span class="ruby-value">0x0b</span>, <span class="ruby-value">0x0c</span>, <span class="ruby-value">0x0d</span>, <span class="ruby-value">0x0e</span>, <span class="ruby-value">0x0f</span>
|
30
|
+
<span class="ruby-identifier">text</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">m</span>)
|
31
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_TRACK_END</span>
|
32
|
+
<span class="ruby-identifier">eot</span>()
|
33
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_SET_TEMPO</span>
|
34
|
+
<span class="ruby-identifier">tempo</span>((<span class="ruby-identifier">m</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><<</span> <span class="ruby-value">16</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>] <span class="ruby-operator"><<</span> <span class="ruby-value">8</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>])
|
35
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_SMPTE</span>
|
36
|
+
<span class="ruby-identifier">smpte</span>(<span class="ruby-identifier">m</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">3</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">4</span>])
|
37
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_TIME_SIG</span>
|
38
|
+
<span class="ruby-identifier">time_signature</span>(<span class="ruby-identifier">m</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">3</span>])
|
39
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_KEY_SIG</span>
|
40
|
+
<span class="ruby-identifier">key_signature</span>(<span class="ruby-identifier">m</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">true</span>)
|
41
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">META_SEQ_SPECIF</span>
|
42
|
+
<span class="ruby-identifier">sequencer_specific</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">m</span>)
|
43
|
+
<span class="ruby-keyword kw">else</span>
|
44
|
+
<span class="ruby-identifier">meta_misc</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">m</span>)
|
45
|
+
<span class="ruby-keyword kw">end</span>
|
46
|
+
<span class="ruby-keyword kw">end</span></pre>
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>chan_message (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 314</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chan_message</span>(<span class="ruby-identifier">running</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">c2</span>)
|
15
|
+
<span class="ruby-ivar">@raw_data</span> = []
|
16
|
+
<span class="ruby-ivar">@raw_data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">status</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">running</span>
|
17
|
+
<span class="ruby-ivar">@raw_data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">c1</span>
|
18
|
+
<span class="ruby-ivar">@raw_data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">c2</span>
|
19
|
+
|
20
|
+
<span class="ruby-identifier">chan</span> = <span class="ruby-identifier">status</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x0f</span>
|
21
|
+
|
22
|
+
<span class="ruby-keyword kw">case</span> (<span class="ruby-identifier">status</span> <span class="ruby-operator">&</span> <span class="ruby-value">0xf0</span>)
|
23
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">NOTE_OFF</span>
|
24
|
+
<span class="ruby-identifier">note_off</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">c2</span>)
|
25
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">NOTE_ON</span>
|
26
|
+
<span class="ruby-identifier">note_on</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">c2</span>)
|
27
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">POLY_PRESSURE</span>
|
28
|
+
<span class="ruby-identifier">pressure</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">c2</span>)
|
29
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">CONTROLLER</span>
|
30
|
+
<span class="ruby-identifier">controller</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">c2</span>)
|
31
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">PITCH_BEND</span>
|
32
|
+
<span class="ruby-identifier">pitch_bend</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">c2</span>)
|
33
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">PROGRAM_CHANGE</span>
|
34
|
+
<span class="ruby-identifier">program</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">c1</span>)
|
35
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">CHANNEL_PRESSURE</span>
|
36
|
+
<span class="ruby-identifier">chan_pressure</span>(<span class="ruby-identifier">chan</span>, <span class="ruby-identifier">c1</span>)
|
37
|
+
<span class="ruby-keyword kw">else</span>
|
38
|
+
<span class="ruby-identifier">error</span>(<span class="ruby-node">"illegal chan message 0x#{'%02x' % (status & 0xf0)}\n"</span>)
|
39
|
+
<span class="ruby-keyword kw">end</span>
|
40
|
+
<span class="ruby-keyword kw">end</span></pre>
|
41
|
+
</body>
|
42
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>handle_sysex (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 343</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_sysex</span>(<span class="ruby-identifier">msg</span>)
|
15
|
+
<span class="ruby-ivar">@raw_data</span> = <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">dup</span>()
|
16
|
+
<span class="ruby-identifier">sysex</span>(<span class="ruby-identifier">msg</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>handle_arbitrary (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 349</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_arbitrary</span>(<span class="ruby-identifier">msg</span>)
|
15
|
+
<span class="ruby-ivar">@raw_data</span> = <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">dup</span>()
|
16
|
+
<span class="ruby-identifier">arbitrary</span>(<span class="ruby-identifier">msg</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>read16 (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 355</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read16</span>
|
15
|
+
<span class="ruby-identifier">val</span> = (<span class="ruby-identifier">getc</span>() <span class="ruby-operator"><<</span> <span class="ruby-value">8</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">getc</span>()
|
16
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-operator">-</span>(<span class="ruby-identifier">val</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x7fff</span>) <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">val</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x8000</span>).<span class="ruby-identifier">nonzero?</span>
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>read32 (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 362</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read32</span>
|
15
|
+
<span class="ruby-identifier">val</span> = (<span class="ruby-identifier">getc</span>() <span class="ruby-operator"><<</span> <span class="ruby-value">24</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">getc</span>() <span class="ruby-operator"><<</span> <span class="ruby-value">16</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">getc</span>() <span class="ruby-operator"><<</span> <span class="ruby-value">8</span>) <span class="ruby-operator">+</span>
|
16
|
+
<span class="ruby-identifier">getc</span>()
|
17
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-operator">-</span>(<span class="ruby-identifier">val</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x7fffffff</span>) <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">val</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x80000000</span>).<span class="ruby-identifier">nonzero?</span>
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>read_var_len (MIDI::IO::MIDIFile)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/midilib/io/midifile.rb, line 370</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_var_len</span>
|
15
|
+
<span class="ruby-ivar">@raw_var_num_data</span> = <span class="ruby-value str">''</span>
|
16
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">getc</span>()
|
17
|
+
<span class="ruby-ivar">@raw_var_num_data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">c</span>
|
18
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">c</span>
|
19
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">val</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x80</span>).<span class="ruby-identifier">nonzero?</span>
|
20
|
+
<span class="ruby-identifier">val</span> <span class="ruby-operator">&=</span> <span class="ruby-value">0x7f</span>
|
21
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
22
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">getc</span>()
|
23
|
+
<span class="ruby-ivar">@raw_var_num_data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">c</span>
|
24
|
+
<span class="ruby-identifier">val</span> = (<span class="ruby-identifier">val</span> <span class="ruby-operator"><<</span> <span class="ruby-value">7</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">c</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x7f</span>)
|
25
|
+
<span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">c</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x80</span>).<span class="ruby-identifier">zero?</span>
|
26
|
+
<span class="ruby-keyword kw">end</span>
|
27
|
+
<span class="ruby-keyword kw">end</span>
|
28
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span>
|
29
|
+
<span class="ruby-keyword kw">end</span></pre>
|
30
|
+
</body>
|
31
|
+
</html>
|