midilib 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +9 -4
- data/Rakefile +2 -6
- data/examples/from_scratch.rb +3 -5
- data/examples/measures_mbt.rb +4 -4
- data/examples/print_program_changes.rb +9 -9
- data/examples/reader2text.rb +188 -188
- data/examples/seq2text.rb +17 -17
- data/examples/split.rb +19 -19
- data/examples/strings.rb +14 -14
- data/examples/transpose.rb +31 -31
- data/html/IO.html +65 -169
- data/html/MIDI.html +138 -256
- data/html/MIDI/ActiveSense.html +89 -178
- data/html/MIDI/ChannelEvent.html +95 -183
- data/html/MIDI/ChannelPressure.html +105 -190
- data/html/MIDI/Clock.html +89 -178
- data/html/MIDI/Continue.html +89 -178
- data/html/MIDI/Controller.html +107 -192
- data/html/MIDI/Event.html +138 -222
- data/html/MIDI/IO.html +45 -157
- data/html/MIDI/IO/MIDIFile.html +596 -568
- data/html/MIDI/IO/SeqReader.html +272 -314
- data/html/MIDI/IO/SeqWriter.html +229 -305
- data/html/MIDI/KeySig.html +129 -211
- data/html/MIDI/MIDI.html +45 -154
- data/html/MIDI/MIDI/MIDI.html +45 -154
- data/html/MIDI/MIDI/MIDI/Array.html +87 -185
- data/html/MIDI/Marker.html +71 -170
- data/html/MIDI/Measure.html +95 -190
- data/html/MIDI/Measures.html +103 -193
- data/html/MIDI/MetaEvent.html +180 -253
- data/html/MIDI/NoteEvent.html +118 -204
- data/html/MIDI/NoteOff.html +95 -183
- data/html/MIDI/NoteOn.html +95 -183
- data/html/MIDI/PitchBend.html +106 -191
- data/html/MIDI/PolyPressure.html +106 -189
- data/html/MIDI/ProgramChange.html +105 -190
- data/html/MIDI/Realtime.html +98 -184
- data/html/MIDI/Sequence.html +246 -311
- data/html/MIDI/SongPointer.html +106 -191
- data/html/MIDI/SongSelect.html +105 -190
- data/html/MIDI/Start.html +89 -178
- data/html/MIDI/Stop.html +89 -178
- data/html/MIDI/SystemCommon.html +71 -170
- data/html/MIDI/SystemExclusive.html +108 -193
- data/html/MIDI/SystemReset.html +89 -178
- data/html/MIDI/Tempo.html +135 -213
- data/html/MIDI/TimeSig.html +135 -214
- data/html/MIDI/Track.html +217 -291
- data/html/MIDI/TuneRequest.html +98 -184
- data/html/MIDI/Utils.html +89 -189
- data/html/README_rdoc.html +237 -257
- data/html/TODO_rdoc.html +64 -139
- data/html/created.rid +14 -14
- data/html/css/fonts.css +167 -0
- data/html/{rdoc.css → css/rdoc.css} +265 -218
- 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 +187 -169
- data/html/js/darkfish.js +41 -33
- data/html/js/jquery.js +4 -18
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +20 -5
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +1111 -498
- data/install.rb +43 -32
- data/lib/midilib/consts.rb +407 -407
- data/lib/midilib/event.rb +295 -294
- data/lib/midilib/info.rb +5 -5
- data/lib/midilib/io/midifile.rb +266 -267
- data/lib/midilib/io/seqreader.rb +106 -106
- data/lib/midilib/io/seqwriter.rb +59 -60
- data/lib/midilib/measure.rb +69 -69
- data/lib/midilib/sequence.rb +68 -70
- data/lib/midilib/track.rb +96 -102
- data/lib/midilib/utils.rb +15 -15
- data/test/event_equality.rb +50 -50
- data/test/test_event.rb +120 -122
- data/test/test_io.rb +35 -48
- data/test/test_sequence.rb +60 -60
- data/test/test_track.rb +154 -154
- data/test/test_varlen.rb +23 -25
- metadata +65 -57
data/test/test_varlen.rb
CHANGED
@@ -8,33 +8,31 @@ require 'midilib'
|
|
8
8
|
|
9
9
|
class VarLenTester < Test::Unit::TestCase
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
11
|
+
VAR_LEN_TEST_DATA = {
|
12
|
+
0x00000000 => 0x00,
|
13
|
+
0x00000040 => 0x40,
|
14
|
+
0x0000007F => 0x7F,
|
15
|
+
0x00000080 => 0x8100,
|
16
|
+
0x00002000 => 0xC000,
|
17
|
+
0x00003FFF => 0xFF7F,
|
18
|
+
0x00004000 => 0x818000,
|
19
|
+
0x00100000 => 0xC08000,
|
20
|
+
0x001FFFFF => 0xFFFF7F,
|
21
|
+
0x00200000 => 0x81808000,
|
22
|
+
0x08000000 => 0xC0808000,
|
23
|
+
0x0FFFFFFF => 0xFFFFFF7F,
|
24
|
+
}
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
}
|
26
|
+
def num_to_var_len(num, answer)
|
27
|
+
varlen = MIDI::Utils.as_var_len(num)
|
28
|
+
varlen.reverse.each do |b|
|
29
|
+
assert_equal(answer & 0xff, b)
|
30
|
+
answer = answer >> 8
|
32
31
|
end
|
32
|
+
end
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
38
|
-
end
|
34
|
+
def test_num_to_var_len
|
35
|
+
VAR_LEN_TEST_DATA.each { |varlen, answer| num_to_var_len(varlen, answer) }
|
36
|
+
end
|
39
37
|
|
40
38
|
end
|
metadata
CHANGED
@@ -1,21 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: midilib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jim Menard
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-06-16 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
description:
|
15
|
-
|
13
|
+
description: |
|
14
|
+
midilib is a pure Ruby MIDI library useful for reading and
|
16
15
|
writing standard MIDI files and manipulating MIDI event data.
|
17
|
-
|
18
|
-
'
|
19
16
|
email: jim@jimmenard.com
|
20
17
|
executables: []
|
21
18
|
extensions: []
|
@@ -25,52 +22,21 @@ extra_rdoc_files:
|
|
25
22
|
files:
|
26
23
|
- ChangeLog
|
27
24
|
- Credits
|
28
|
-
- Rakefile
|
29
25
|
- README.rdoc
|
26
|
+
- Rakefile
|
30
27
|
- TODO.rdoc
|
28
|
+
- examples/NoFences.mid
|
31
29
|
- examples/from_scratch.mid
|
32
30
|
- examples/from_scratch.rb
|
33
31
|
- examples/measures_mbt.rb
|
34
|
-
- examples/NoFences.mid
|
35
32
|
- examples/print_program_changes.rb
|
36
33
|
- examples/reader2text.rb
|
37
34
|
- examples/seq2text.rb
|
38
35
|
- examples/split.rb
|
39
36
|
- examples/strings.rb
|
40
37
|
- examples/transpose.rb
|
41
|
-
- html/created.rid
|
42
|
-
- html/images/add.png
|
43
|
-
- html/images/brick.png
|
44
|
-
- html/images/brick_link.png
|
45
|
-
- html/images/bug.png
|
46
|
-
- html/images/bullet_black.png
|
47
|
-
- html/images/bullet_toggle_minus.png
|
48
|
-
- html/images/bullet_toggle_plus.png
|
49
|
-
- html/images/date.png
|
50
|
-
- html/images/delete.png
|
51
|
-
- html/images/find.png
|
52
|
-
- html/images/loadingAnimation.gif
|
53
|
-
- html/images/macFFBgHack.png
|
54
|
-
- html/images/package.png
|
55
|
-
- html/images/page_green.png
|
56
|
-
- html/images/page_white_text.png
|
57
|
-
- html/images/page_white_width.png
|
58
|
-
- html/images/plugin.png
|
59
|
-
- html/images/ruby.png
|
60
|
-
- html/images/tag_blue.png
|
61
|
-
- html/images/tag_green.png
|
62
|
-
- html/images/transparent.png
|
63
|
-
- html/images/wrench.png
|
64
|
-
- html/images/wrench_orange.png
|
65
|
-
- html/images/zoom.png
|
66
|
-
- html/index.html
|
67
38
|
- html/IO.html
|
68
|
-
- html/
|
69
|
-
- html/js/jquery.js
|
70
|
-
- html/js/navigation.js
|
71
|
-
- html/js/search.js
|
72
|
-
- html/js/search_index.js
|
73
|
-
- html/js/searcher.js
|
39
|
+
- html/MIDI.html
|
74
40
|
- html/MIDI/ActiveSense.html
|
75
41
|
- html/MIDI/ChannelEvent.html
|
76
42
|
- html/MIDI/ChannelPressure.html
|
@@ -78,18 +44,18 @@ files:
|
|
78
44
|
- html/MIDI/Continue.html
|
79
45
|
- html/MIDI/Controller.html
|
80
46
|
- html/MIDI/Event.html
|
47
|
+
- html/MIDI/IO.html
|
81
48
|
- html/MIDI/IO/MIDIFile.html
|
82
49
|
- html/MIDI/IO/SeqReader.html
|
83
50
|
- html/MIDI/IO/SeqWriter.html
|
84
|
-
- html/MIDI/IO.html
|
85
51
|
- html/MIDI/KeySig.html
|
52
|
+
- html/MIDI/MIDI.html
|
53
|
+
- html/MIDI/MIDI/MIDI.html
|
54
|
+
- html/MIDI/MIDI/MIDI/Array.html
|
86
55
|
- html/MIDI/Marker.html
|
87
56
|
- html/MIDI/Measure.html
|
88
57
|
- html/MIDI/Measures.html
|
89
58
|
- html/MIDI/MetaEvent.html
|
90
|
-
- html/MIDI/MIDI/MIDI/Array.html
|
91
|
-
- html/MIDI/MIDI/MIDI.html
|
92
|
-
- html/MIDI/MIDI.html
|
93
59
|
- html/MIDI/NoteEvent.html
|
94
60
|
- html/MIDI/NoteOff.html
|
95
61
|
- html/MIDI/NoteOn.html
|
@@ -110,12 +76,55 @@ files:
|
|
110
76
|
- html/MIDI/Track.html
|
111
77
|
- html/MIDI/TuneRequest.html
|
112
78
|
- html/MIDI/Utils.html
|
113
|
-
- html/MIDI.html
|
114
|
-
- html/rdoc.css
|
115
79
|
- html/README_rdoc.html
|
116
|
-
- html/table_of_contents.html
|
117
80
|
- html/TODO_rdoc.html
|
81
|
+
- html/created.rid
|
82
|
+
- html/css/fonts.css
|
83
|
+
- html/css/rdoc.css
|
84
|
+
- html/fonts/Lato-Light.ttf
|
85
|
+
- html/fonts/Lato-LightItalic.ttf
|
86
|
+
- html/fonts/Lato-Regular.ttf
|
87
|
+
- html/fonts/Lato-RegularItalic.ttf
|
88
|
+
- html/fonts/SourceCodePro-Bold.ttf
|
89
|
+
- html/fonts/SourceCodePro-Regular.ttf
|
90
|
+
- html/images/add.png
|
91
|
+
- html/images/arrow_up.png
|
92
|
+
- html/images/brick.png
|
93
|
+
- html/images/brick_link.png
|
94
|
+
- html/images/bug.png
|
95
|
+
- html/images/bullet_black.png
|
96
|
+
- html/images/bullet_toggle_minus.png
|
97
|
+
- html/images/bullet_toggle_plus.png
|
98
|
+
- html/images/date.png
|
99
|
+
- html/images/delete.png
|
100
|
+
- html/images/find.png
|
101
|
+
- html/images/loadingAnimation.gif
|
102
|
+
- html/images/macFFBgHack.png
|
103
|
+
- html/images/package.png
|
104
|
+
- html/images/page_green.png
|
105
|
+
- html/images/page_white_text.png
|
106
|
+
- html/images/page_white_width.png
|
107
|
+
- html/images/plugin.png
|
108
|
+
- html/images/ruby.png
|
109
|
+
- html/images/tag_blue.png
|
110
|
+
- html/images/tag_green.png
|
111
|
+
- html/images/transparent.png
|
112
|
+
- html/images/wrench.png
|
113
|
+
- html/images/wrench_orange.png
|
114
|
+
- html/images/zoom.png
|
115
|
+
- html/index.html
|
116
|
+
- html/js/darkfish.js
|
117
|
+
- html/js/jquery.js
|
118
|
+
- html/js/navigation.js
|
119
|
+
- html/js/navigation.js.gz
|
120
|
+
- html/js/search.js
|
121
|
+
- html/js/search_index.js
|
122
|
+
- html/js/search_index.js.gz
|
123
|
+
- html/js/searcher.js
|
124
|
+
- html/js/searcher.js.gz
|
125
|
+
- html/table_of_contents.html
|
118
126
|
- install.rb
|
127
|
+
- lib/midilib.rb
|
119
128
|
- lib/midilib/consts.rb
|
120
129
|
- lib/midilib/event.rb
|
121
130
|
- lib/midilib/info.rb
|
@@ -126,7 +135,6 @@ files:
|
|
126
135
|
- lib/midilib/sequence.rb
|
127
136
|
- lib/midilib/track.rb
|
128
137
|
- lib/midilib/utils.rb
|
129
|
-
- lib/midilib.rb
|
130
138
|
- test/event_equality.rb
|
131
139
|
- test/test.mid
|
132
140
|
- test/test_event.rb
|
@@ -136,30 +144,30 @@ files:
|
|
136
144
|
- test/test_track.rb
|
137
145
|
- test/test_varlen.rb
|
138
146
|
homepage: http://github.com/jimm/midilib
|
139
|
-
licenses:
|
147
|
+
licenses:
|
148
|
+
- Ruby
|
149
|
+
metadata: {}
|
140
150
|
post_install_message:
|
141
151
|
rdoc_options:
|
142
|
-
- --main
|
152
|
+
- "--main"
|
143
153
|
- README.rdoc
|
144
154
|
require_paths:
|
145
155
|
- lib
|
146
156
|
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
-
none: false
|
148
157
|
requirements:
|
149
|
-
- -
|
158
|
+
- - ">="
|
150
159
|
- !ruby/object:Gem::Version
|
151
160
|
version: '0'
|
152
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
162
|
requirements:
|
155
|
-
- -
|
163
|
+
- - ">="
|
156
164
|
- !ruby/object:Gem::Version
|
157
165
|
version: '0'
|
158
166
|
requirements:
|
159
167
|
- none
|
160
168
|
rubyforge_project: midilib
|
161
|
-
rubygems_version:
|
169
|
+
rubygems_version: 2.4.5
|
162
170
|
signing_key:
|
163
|
-
specification_version:
|
171
|
+
specification_version: 4
|
164
172
|
summary: MIDI file and event manipulation library
|
165
173
|
test_files: []
|