midilib 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -1
- data/Credits +6 -1
- data/README.rdoc +41 -15
- data/Rakefile +3 -11
- data/TODO.rdoc +4 -7
- data/examples/from_scratch.rb +2 -2
- data/examples/measures_mbt.rb +1 -1
- data/examples/print_program_changes.rb +1 -1
- data/examples/strings.rb +1 -1
- data/examples/transpose.rb +1 -1
- data/html/Array.html +382 -0
- data/html/IO.html +277 -0
- data/html/MIDI.html +829 -0
- data/html/MIDI/ActiveSense.html +317 -0
- data/html/MIDI/ChannelEvent.html +347 -0
- data/html/MIDI/ChannelPressure.html +379 -0
- data/html/MIDI/Clock.html +317 -0
- data/html/MIDI/Continue.html +317 -0
- data/html/MIDI/Controller.html +398 -0
- data/html/MIDI/Event.html +659 -0
- data/html/MIDI/IO.html +238 -0
- data/html/MIDI/IO/MIDIFile.html +2269 -0
- data/html/MIDI/IO/SeqReader.html +1051 -0
- data/html/MIDI/IO/SeqWriter.html +706 -0
- data/html/MIDI/KeySig.html +487 -0
- data/html/MIDI/Marker.html +275 -0
- data/html/MIDI/Measure.html +479 -0
- data/html/MIDI/Measures.html +416 -0
- data/html/MIDI/MetaEvent.html +617 -0
- data/html/MIDI/NoteEvent.html +459 -0
- data/html/MIDI/NoteOff.html +341 -0
- data/html/MIDI/NoteOn.html +341 -0
- data/html/MIDI/PitchBend.html +380 -0
- data/html/MIDI/PolyPressure.html +390 -0
- data/html/MIDI/ProgramChange.html +379 -0
- data/html/MIDI/Realtime.html +354 -0
- data/html/MIDI/Sequence.html +1063 -0
- data/html/MIDI/SongPointer.html +380 -0
- data/html/MIDI/SongSelect.html +379 -0
- data/html/MIDI/Start.html +317 -0
- data/html/MIDI/Stop.html +317 -0
- data/html/MIDI/SystemCommon.html +275 -0
- data/html/MIDI/SystemExclusive.html +382 -0
- data/html/MIDI/SystemReset.html +317 -0
- data/html/MIDI/Tempo.html +519 -0
- data/html/MIDI/TimeSig.html +524 -0
- data/html/MIDI/Track.html +859 -0
- data/html/MIDI/TuneRequest.html +354 -0
- data/html/MIDI/Utils.html +350 -0
- data/html/README_rdoc.html +882 -0
- data/html/TODO_rdoc.html +215 -0
- data/html/created.rid +14 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +1266 -0
- data/html/js/darkfish.js +116 -0
- data/html/js/jquery.js +32 -0
- data/html/js/quicksearch.js +114 -0
- data/html/js/thickbox-compressed.js +10 -0
- data/html/lib/midilib/consts_rb.html +55 -0
- data/html/lib/midilib/event_rb.html +56 -0
- data/html/lib/midilib/info_rb.html +52 -0
- data/html/lib/midilib/io/midifile_rb.html +54 -0
- data/html/lib/midilib/io/seqreader_rb.html +58 -0
- data/html/lib/midilib/io/seqwriter_rb.html +59 -0
- data/html/lib/midilib/measure_rb.html +54 -0
- data/html/lib/midilib/sequence_rb.html +58 -0
- data/html/lib/midilib/track_rb.html +54 -0
- data/html/lib/midilib/utils_rb.html +52 -0
- data/html/lib/midilib_rb.html +71 -0
- data/html/rdoc.css +706 -0
- data/install.rb +1 -1
- data/lib/midilib/event.rb +11 -77
- data/lib/midilib/info.rb +4 -4
- data/lib/midilib/io/seqreader.rb +2 -2
- data/lib/midilib/io/seqwriter.rb +1 -1
- data/lib/midilib/sequence.rb +1 -1
- data/lib/midilib/track.rb +54 -8
- data/test/test_event.rb +4 -62
- data/test/test_sequence.rb +1 -1
- data/test/test_track.rb +39 -5
- metadata +102 -9
data/test/test_sequence.rb
CHANGED
@@ -12,7 +12,7 @@ class SequenceTester < Test::Unit::TestCase
|
|
12
12
|
@seq = MIDI::Sequence.new
|
13
13
|
@track = MIDI::Track.new(@seq)
|
14
14
|
@seq.tracks << @track
|
15
|
-
3.times { @track.events << MIDI::
|
15
|
+
3.times { @track.events << MIDI::NoteOn.new(0, 64, 64, 100) }
|
16
16
|
@track.recalc_times
|
17
17
|
end
|
18
18
|
|
data/test/test_track.rb
CHANGED
@@ -12,7 +12,7 @@ class TrackTester < Test::Unit::TestCase
|
|
12
12
|
@seq = MIDI::Sequence.new
|
13
13
|
@track = MIDI::Track.new(@seq)
|
14
14
|
@seq.tracks << @track
|
15
|
-
3.times { @track.events << MIDI::
|
15
|
+
3.times { @track.events << MIDI::NoteOn.new(0, 64, 64, 100) }
|
16
16
|
@track.recalc_times
|
17
17
|
end
|
18
18
|
|
@@ -26,7 +26,7 @@ class TrackTester < Test::Unit::TestCase
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_append_event
|
29
|
-
@track.events << MIDI::
|
29
|
+
@track.events << MIDI::NoteOn.new(0, 64, 64, 100)
|
30
30
|
@track.recalc_times
|
31
31
|
assert_equal(4, @track.events.length)
|
32
32
|
4.times { | i |
|
@@ -36,7 +36,7 @@ class TrackTester < Test::Unit::TestCase
|
|
36
36
|
|
37
37
|
def test_append_list
|
38
38
|
@track.events +=
|
39
|
-
(1..12).collect { | i | MIDI::
|
39
|
+
(1..12).collect { | i | MIDI::NoteOn.new(0, 64, 64, 3) }
|
40
40
|
@track.recalc_times
|
41
41
|
|
42
42
|
3.times { | i |
|
@@ -51,7 +51,7 @@ class TrackTester < Test::Unit::TestCase
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_insert
|
54
|
-
@track.events[1,0] = MIDI::
|
54
|
+
@track.events[1,0] = MIDI::NoteOn.new(0, 64, 64, 3)
|
55
55
|
@track.recalc_times
|
56
56
|
assert_equal(100, @track.events[0].time_from_start)
|
57
57
|
assert_equal(103, @track.events[1].time_from_start)
|
@@ -60,7 +60,7 @@ class TrackTester < Test::Unit::TestCase
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_merge
|
63
|
-
list = (1..12).collect { | i | MIDI::
|
63
|
+
list = (1..12).collect { | i | MIDI::NoteOn.new(0, 64, 64, 10) }
|
64
64
|
@track.merge(list)
|
65
65
|
assert_equal(15, @track.events.length)
|
66
66
|
assert_equal(10, @track.events[0].time_from_start)
|
@@ -135,4 +135,38 @@ class TrackTester < Test::Unit::TestCase
|
|
135
135
|
assert_equal('foo', @track.instrument)
|
136
136
|
end
|
137
137
|
|
138
|
+
def test_old_note_class_names
|
139
|
+
x = MIDI::NoteOn.new(0, 64, 64, 10)
|
140
|
+
assert(x.kind_of?(MIDI::NoteOnEvent)) # old name
|
141
|
+
x = MIDI::NoteOff.new(0, 64, 64, 10)
|
142
|
+
assert(x.kind_of?(MIDI::NoteOffEvent)) # old name
|
143
|
+
end
|
144
|
+
|
145
|
+
def test_mergesort
|
146
|
+
@track.events = []
|
147
|
+
|
148
|
+
# Two events with later start times but earlier in the event list
|
149
|
+
e2 = MIDI::NoteOff.new(0, 64, 64, 100)
|
150
|
+
e2.time_from_start = 100
|
151
|
+
@track.events << e2
|
152
|
+
|
153
|
+
e3 = MIDI::NoteOn.new(0, 64, 64, 100)
|
154
|
+
e3.time_from_start = 100
|
155
|
+
@track.events << e3
|
156
|
+
|
157
|
+
# Earliest start time, latest in the list of events
|
158
|
+
e1 = MIDI::NoteOn.new(0, 64, 64, 100)
|
159
|
+
e1.time_from_start = 0
|
160
|
+
@track.events << e1
|
161
|
+
|
162
|
+
# Recalc sorts. Make sure note off/note on pair at t 100 are in the
|
163
|
+
# correct order.
|
164
|
+
@track.recalc_delta_from_times
|
165
|
+
|
166
|
+
# These tests would fail before we moved to mergesort.
|
167
|
+
assert_equal(e1, @track.events[0])
|
168
|
+
assert_equal(e2, @track.events[1])
|
169
|
+
assert_equal(e3, @track.events[2])
|
170
|
+
|
171
|
+
end
|
138
172
|
end
|
metadata
CHANGED
@@ -1,19 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: midilib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 2
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 2.0.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Jim Menard
|
8
|
-
autorequire:
|
13
|
+
autorequire:
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-10-03 00:00:00 -04:00
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
16
|
-
description:
|
21
|
+
description: |
|
22
|
+
midilib is a pure Ruby MIDI library useful for reading and
|
23
|
+
writing standard MIDI files and manipulating MIDI event data.
|
24
|
+
|
17
25
|
email: jimm@io.com
|
18
26
|
executables: []
|
19
27
|
|
@@ -38,6 +46,85 @@ files:
|
|
38
46
|
- examples/split.rb
|
39
47
|
- examples/strings.rb
|
40
48
|
- examples/transpose.rb
|
49
|
+
- html/Array.html
|
50
|
+
- html/created.rid
|
51
|
+
- html/images/brick.png
|
52
|
+
- html/images/brick_link.png
|
53
|
+
- html/images/bug.png
|
54
|
+
- html/images/bullet_black.png
|
55
|
+
- html/images/bullet_toggle_minus.png
|
56
|
+
- html/images/bullet_toggle_plus.png
|
57
|
+
- html/images/date.png
|
58
|
+
- html/images/find.png
|
59
|
+
- html/images/loadingAnimation.gif
|
60
|
+
- html/images/macFFBgHack.png
|
61
|
+
- html/images/package.png
|
62
|
+
- html/images/page_green.png
|
63
|
+
- html/images/page_white_text.png
|
64
|
+
- html/images/page_white_width.png
|
65
|
+
- html/images/plugin.png
|
66
|
+
- html/images/ruby.png
|
67
|
+
- html/images/tag_green.png
|
68
|
+
- html/images/wrench.png
|
69
|
+
- html/images/wrench_orange.png
|
70
|
+
- html/images/zoom.png
|
71
|
+
- html/index.html
|
72
|
+
- html/IO.html
|
73
|
+
- html/js/darkfish.js
|
74
|
+
- html/js/jquery.js
|
75
|
+
- html/js/quicksearch.js
|
76
|
+
- html/js/thickbox-compressed.js
|
77
|
+
- html/lib/midilib/consts_rb.html
|
78
|
+
- html/lib/midilib/event_rb.html
|
79
|
+
- html/lib/midilib/info_rb.html
|
80
|
+
- html/lib/midilib/io/midifile_rb.html
|
81
|
+
- html/lib/midilib/io/seqreader_rb.html
|
82
|
+
- html/lib/midilib/io/seqwriter_rb.html
|
83
|
+
- html/lib/midilib/measure_rb.html
|
84
|
+
- html/lib/midilib/sequence_rb.html
|
85
|
+
- html/lib/midilib/track_rb.html
|
86
|
+
- html/lib/midilib/utils_rb.html
|
87
|
+
- html/lib/midilib_rb.html
|
88
|
+
- html/MIDI/ActiveSense.html
|
89
|
+
- html/MIDI/ChannelEvent.html
|
90
|
+
- html/MIDI/ChannelPressure.html
|
91
|
+
- html/MIDI/Clock.html
|
92
|
+
- html/MIDI/Continue.html
|
93
|
+
- html/MIDI/Controller.html
|
94
|
+
- html/MIDI/Event.html
|
95
|
+
- html/MIDI/IO/MIDIFile.html
|
96
|
+
- html/MIDI/IO/SeqReader.html
|
97
|
+
- html/MIDI/IO/SeqWriter.html
|
98
|
+
- html/MIDI/IO.html
|
99
|
+
- html/MIDI/KeySig.html
|
100
|
+
- html/MIDI/Marker.html
|
101
|
+
- html/MIDI/Measure.html
|
102
|
+
- html/MIDI/Measures.html
|
103
|
+
- html/MIDI/MetaEvent.html
|
104
|
+
- html/MIDI/NoteEvent.html
|
105
|
+
- html/MIDI/NoteOff.html
|
106
|
+
- html/MIDI/NoteOn.html
|
107
|
+
- html/MIDI/PitchBend.html
|
108
|
+
- html/MIDI/PolyPressure.html
|
109
|
+
- html/MIDI/ProgramChange.html
|
110
|
+
- html/MIDI/Realtime.html
|
111
|
+
- html/MIDI/Sequence.html
|
112
|
+
- html/MIDI/SongPointer.html
|
113
|
+
- html/MIDI/SongSelect.html
|
114
|
+
- html/MIDI/Start.html
|
115
|
+
- html/MIDI/Stop.html
|
116
|
+
- html/MIDI/SystemCommon.html
|
117
|
+
- html/MIDI/SystemExclusive.html
|
118
|
+
- html/MIDI/SystemReset.html
|
119
|
+
- html/MIDI/Tempo.html
|
120
|
+
- html/MIDI/TimeSig.html
|
121
|
+
- html/MIDI/Track.html
|
122
|
+
- html/MIDI/TuneRequest.html
|
123
|
+
- html/MIDI/Utils.html
|
124
|
+
- html/MIDI.html
|
125
|
+
- html/rdoc.css
|
126
|
+
- html/README_rdoc.html
|
127
|
+
- html/TODO_rdoc.html
|
41
128
|
- install.rb
|
42
129
|
- lib/midilib/consts.rb
|
43
130
|
- lib/midilib/event.rb
|
@@ -59,7 +146,9 @@ files:
|
|
59
146
|
- test/test_track.rb
|
60
147
|
- test/test_varlen.rb
|
61
148
|
has_rdoc: true
|
62
|
-
homepage: http://midilib
|
149
|
+
homepage: http://github.com/jimm/midilib
|
150
|
+
licenses: []
|
151
|
+
|
63
152
|
post_install_message:
|
64
153
|
rdoc_options:
|
65
154
|
- --main
|
@@ -67,23 +156,27 @@ rdoc_options:
|
|
67
156
|
require_paths:
|
68
157
|
- lib
|
69
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
70
160
|
requirements:
|
71
161
|
- - ">="
|
72
162
|
- !ruby/object:Gem::Version
|
163
|
+
segments:
|
164
|
+
- 0
|
73
165
|
version: "0"
|
74
|
-
version:
|
75
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
|
+
none: false
|
76
168
|
requirements:
|
77
169
|
- - ">="
|
78
170
|
- !ruby/object:Gem::Version
|
171
|
+
segments:
|
172
|
+
- 0
|
79
173
|
version: "0"
|
80
|
-
version:
|
81
174
|
requirements:
|
82
175
|
- none
|
83
176
|
rubyforge_project: midilib
|
84
|
-
rubygems_version: 1.3.
|
177
|
+
rubygems_version: 1.3.7
|
85
178
|
signing_key:
|
86
|
-
specification_version:
|
179
|
+
specification_version: 3
|
87
180
|
summary: MIDI file and event manipulation library
|
88
181
|
test_files: []
|
89
182
|
|