| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MIDI::XML; |
|
2
|
1
|
|
|
1
|
|
70041
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
1578
|
|
|
3
|
1
|
|
|
1
|
|
30
|
use 5.006; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
176
|
|
|
4
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
|
1
|
|
|
|
|
7
|
|
|
|
1
|
|
|
|
|
104
|
|
|
5
|
1
|
|
|
1
|
|
932
|
use XML::DOM; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use XML::Parser; |
|
7
|
|
|
|
|
|
|
use Class::ISA; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
12
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = 0.03; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
MIDI::XML - Module for representing MIDI-XML objects. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use MIDI::XML; |
|
23
|
|
|
|
|
|
|
$document = MIDI::XML->parsefile($file); |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 EXPORT |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
None by default. |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my %sax_handlers = ( |
|
36
|
|
|
|
|
|
|
'Init' => \&handle_init, |
|
37
|
|
|
|
|
|
|
'Final' => \&handle_final, |
|
38
|
|
|
|
|
|
|
'Start' => \&handle_start, |
|
39
|
|
|
|
|
|
|
'End' => \&handle_end, |
|
40
|
|
|
|
|
|
|
'Char' => \&handle_char, |
|
41
|
|
|
|
|
|
|
'Proc' => \&handle_proc, |
|
42
|
|
|
|
|
|
|
'Comment' => \&handle_comment, |
|
43
|
|
|
|
|
|
|
'CdataStart' => \&handle_cdata_start, |
|
44
|
|
|
|
|
|
|
'CdataEnd' => \&handle_cdata_end, |
|
45
|
|
|
|
|
|
|
'Default' => \&handle_default, |
|
46
|
|
|
|
|
|
|
'Unparsed' => \&handle_unparsed, |
|
47
|
|
|
|
|
|
|
'Notation' => \&handle_notation, |
|
48
|
|
|
|
|
|
|
'ExternEnt' => \&handle_extern_ent, |
|
49
|
|
|
|
|
|
|
'ExternEntFin' => \&handle_extern_ent_fin, |
|
50
|
|
|
|
|
|
|
'Entity' => \&handle_entity, |
|
51
|
|
|
|
|
|
|
'Element' => \&handle_element, |
|
52
|
|
|
|
|
|
|
'Attlist' => \&handle_attlist, |
|
53
|
|
|
|
|
|
|
'Doctype' => \&handle_doctype, |
|
54
|
|
|
|
|
|
|
'DoctypeFin' => \&handle_doctype_fin, |
|
55
|
|
|
|
|
|
|
'XMLDecl' => \&handle_xml_decl, |
|
56
|
|
|
|
|
|
|
); |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my @elem_stack; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $Document; |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my %attributeAsElement = ( |
|
63
|
|
|
|
|
|
|
'Absolute' => 1, |
|
64
|
|
|
|
|
|
|
'Delta' => 1, |
|
65
|
|
|
|
|
|
|
'Format' => 1, |
|
66
|
|
|
|
|
|
|
'FrameRate' => 1, |
|
67
|
|
|
|
|
|
|
'TicksPerBeat' => 1, |
|
68
|
|
|
|
|
|
|
'TicksPerFrame' => 1, |
|
69
|
|
|
|
|
|
|
'TimestampType' => 1, |
|
70
|
|
|
|
|
|
|
'TrackCount' => 1, |
|
71
|
|
|
|
|
|
|
); |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
#================================================================= |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# Init (Expat) |
|
76
|
|
|
|
|
|
|
sub handle_init() { |
|
77
|
|
|
|
|
|
|
my ($expat) = @_; |
|
78
|
|
|
|
|
|
|
$Document = MIDI::XML::Document->new(); |
|
79
|
|
|
|
|
|
|
push @elem_stack,$Document; |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#================================================================= |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
# Final (Expat) |
|
85
|
|
|
|
|
|
|
sub handle_final() { |
|
86
|
|
|
|
|
|
|
my ($expat) = @_; |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
#================================================================= |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# Start (Expat, Tag [, Attr, Val [,...]]) |
|
92
|
|
|
|
|
|
|
sub handle_start() { |
|
93
|
|
|
|
|
|
|
my ($expat, $tag, %attrs) = @_; |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
my $Element = $Document->createElement($tag); |
|
96
|
|
|
|
|
|
|
foreach my $attr (keys %attrs) { |
|
97
|
|
|
|
|
|
|
$Element->setAttribute($attr,$attrs{$attr}); |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
if($attributeAsElement{$tag}) { |
|
100
|
|
|
|
|
|
|
$elem_stack[-1]->attribute_as_element($tag,$Element) if(@elem_stack); |
|
101
|
|
|
|
|
|
|
} else { |
|
102
|
|
|
|
|
|
|
$elem_stack[-1]->appendChild($Element) if(@elem_stack); |
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
push @elem_stack,$Element; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
#================================================================= |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# End (Expat, Tag) |
|
110
|
|
|
|
|
|
|
sub handle_end() { |
|
111
|
|
|
|
|
|
|
my ($expat, $tag) = @_; |
|
112
|
|
|
|
|
|
|
my $Element = pop @elem_stack; |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
#================================================================= |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# Char (Expat, String) |
|
118
|
|
|
|
|
|
|
sub handle_char() { |
|
119
|
|
|
|
|
|
|
my ($expat, $string) = @_; |
|
120
|
|
|
|
|
|
|
$elem_stack[-1]->appendChild($Document->createTextNode($string)); |
|
121
|
|
|
|
|
|
|
} |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
#================================================================= |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
# Proc (Expat, Target, Data) |
|
126
|
|
|
|
|
|
|
sub handle_proc() { |
|
127
|
|
|
|
|
|
|
my ($expat, $target, $data) = @_; |
|
128
|
|
|
|
|
|
|
$elem_stack[-1]->appendChild($Document->createProcessingInstruction($target, $data)); |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
#================================================================= |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
# Comment (Expat, Data) |
|
134
|
|
|
|
|
|
|
sub handle_comment() { |
|
135
|
|
|
|
|
|
|
my ($expat, $data) = @_; |
|
136
|
|
|
|
|
|
|
$elem_stack[-1]->appendChild($Document->createComment($data)); |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
#================================================================= |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
# CdataStart (Expat) |
|
142
|
|
|
|
|
|
|
sub handle_cdata_start() { |
|
143
|
|
|
|
|
|
|
my ($expat) = @_; |
|
144
|
|
|
|
|
|
|
} |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
#================================================================= |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
# CdataEnd (Expat) |
|
149
|
|
|
|
|
|
|
sub handle_cdata_end() { |
|
150
|
|
|
|
|
|
|
my ($expat) = @_; |
|
151
|
|
|
|
|
|
|
} |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
#================================================================= |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
# Default (Expat, String) |
|
156
|
|
|
|
|
|
|
sub handle_default() { |
|
157
|
|
|
|
|
|
|
my ($expat, $string) = @_; |
|
158
|
|
|
|
|
|
|
} |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
#================================================================= |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
# Unparsed (Expat, Entity, Base, Sysid, Pubid, Notation) |
|
163
|
|
|
|
|
|
|
sub handle_unparsed() { |
|
164
|
|
|
|
|
|
|
my ($expat, $entity, $base, $sysid, $pubid, $notation) = @_; |
|
165
|
|
|
|
|
|
|
} |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
#================================================================= |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
# Notation (Expat, Notation, Base, Sysid, Pubid) |
|
170
|
|
|
|
|
|
|
sub handle_notation() { |
|
171
|
|
|
|
|
|
|
my ($expat, $notation, $base, $sysid, $pubid) = @_; |
|
172
|
|
|
|
|
|
|
} |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
#================================================================= |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
# ExternEnt (Expat, Base, Sysid, Pubid) |
|
177
|
|
|
|
|
|
|
sub handle_extern_ent() { |
|
178
|
|
|
|
|
|
|
my ($expat, $base, $sysid, $pubid) = @_; |
|
179
|
|
|
|
|
|
|
} |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
#================================================================= |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
# ExternEntFin (Expat) |
|
184
|
|
|
|
|
|
|
sub handle_extern_ent_fin() { |
|
185
|
|
|
|
|
|
|
my ($expat) = @_; |
|
186
|
|
|
|
|
|
|
} |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
#================================================================= |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
# Entity (Expat, Name, Val, Sysid, Pubid, Ndata, IsParam) |
|
191
|
|
|
|
|
|
|
sub handle_entity() { |
|
192
|
|
|
|
|
|
|
my ($expat, $name, $val, $sysid, $pubid, $ndata, $isParam) = @_; |
|
193
|
|
|
|
|
|
|
} |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
#================================================================= |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
# Element (Expat, Name, Model) |
|
198
|
|
|
|
|
|
|
sub handle_element() { |
|
199
|
|
|
|
|
|
|
my ($expat, $name, $model) = @_; |
|
200
|
|
|
|
|
|
|
} |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
#================================================================= |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
# Attlist (Expat, Elname, Attname, Type, Default, Fixed) |
|
205
|
|
|
|
|
|
|
sub handle_attlist() { |
|
206
|
|
|
|
|
|
|
my ($expat, $elname, $attname, $type, $default, $fixed) = @_; |
|
207
|
|
|
|
|
|
|
} |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
#================================================================= |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
# Doctype (Expat, Name, Sysid, Pubid, Internal) |
|
212
|
|
|
|
|
|
|
sub handle_doctype() { |
|
213
|
|
|
|
|
|
|
my ($expat, $name, $sysid, $pubid, $internal) = @_; |
|
214
|
|
|
|
|
|
|
} |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
#================================================================= |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
# DoctypeFin (Expat) |
|
219
|
|
|
|
|
|
|
sub handle_doctype_fin() { |
|
220
|
|
|
|
|
|
|
my ($expat) = @_; |
|
221
|
|
|
|
|
|
|
} |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
#================================================================= |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
# XMLDecl (Expat, Version, Encoding, Standalone) |
|
226
|
|
|
|
|
|
|
sub handle_xml_decl() { |
|
227
|
|
|
|
|
|
|
my ($expat, $version, $encoding, $standalone) = @_; |
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
#================================================================= |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=item $Document = MIDI::XML->parse($string); |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
This method is used to parse an existing MIDI XML file and create |
|
235
|
|
|
|
|
|
|
a DOM tree. Calls XML::Parser->parse with the given string and |
|
236
|
|
|
|
|
|
|
the MIDI::XML handlers. A DOM Document containing a tree of DOM |
|
237
|
|
|
|
|
|
|
objects is returned. Comments, processing instructions, and notations, |
|
238
|
|
|
|
|
|
|
are discarded. White space is retained. |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=cut |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub parse($) { |
|
243
|
|
|
|
|
|
|
my $self = shift @_; |
|
244
|
|
|
|
|
|
|
my $source = shift @_; |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
undef $Document; |
|
247
|
|
|
|
|
|
|
my $Parser = new XML::Parser('Handlers' => \%sax_handlers); |
|
248
|
|
|
|
|
|
|
$Parser->parse($source); |
|
249
|
|
|
|
|
|
|
return $Document; |
|
250
|
|
|
|
|
|
|
} |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
#================================================================= |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=item $Document = MIDI::XML->parsefile($path); |
|
255
|
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
This method is used to parse an existing MIDI XML file and create |
|
257
|
|
|
|
|
|
|
a DOM tree. Calls XML::Parser->parsefile with the given path and |
|
258
|
|
|
|
|
|
|
the MIDI::XML handlers. A DOM Document containing a tree of DOM |
|
259
|
|
|
|
|
|
|
objects is returned. Comments, processing instructions, and notations, |
|
260
|
|
|
|
|
|
|
are discarded. White space is retained. |
|
261
|
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=cut |
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
sub parsefile($) { |
|
265
|
|
|
|
|
|
|
my $self = shift @_; |
|
266
|
|
|
|
|
|
|
my $source = shift @_; |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
undef $Document; |
|
269
|
|
|
|
|
|
|
my $Parser = new XML::Parser('Handlers' => \%sax_handlers); |
|
270
|
|
|
|
|
|
|
$Parser->parsefile($source); |
|
271
|
|
|
|
|
|
|
return $Document; |
|
272
|
|
|
|
|
|
|
} |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
#=============================================================================== |
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=item $Document = MIDI::XML->readfile($path,[$pretty]); |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
This method is used to read an existing Standard MIDI XML file and create a DOM |
|
279
|
|
|
|
|
|
|
tree. It reads the file at the given path and creates SAX events which are |
|
280
|
|
|
|
|
|
|
directed to the MIDI::XML handlers. A DOM Document containing a tree of DOM |
|
281
|
|
|
|
|
|
|
objects is returned. White space is inserted to produce "pretty" output if the |
|
282
|
|
|
|
|
|
|
optional $pretty argument is non-zero. |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=cut |
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub readfile($) { |
|
287
|
|
|
|
|
|
|
my $self = shift @_; |
|
288
|
|
|
|
|
|
|
my $source = shift @_; |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
my $pretty = 1 if (@_ and $_[0] != 0); |
|
291
|
|
|
|
|
|
|
undef $Document; |
|
292
|
|
|
|
|
|
|
my $err = 0; |
|
293
|
|
|
|
|
|
|
open MIDI,'<',$source or $err = 1; |
|
294
|
|
|
|
|
|
|
if ($err) { |
|
295
|
|
|
|
|
|
|
carp "Error opening file $source"; |
|
296
|
|
|
|
|
|
|
return undef; |
|
297
|
|
|
|
|
|
|
} |
|
298
|
|
|
|
|
|
|
my $buf; |
|
299
|
|
|
|
|
|
|
read MIDI,$buf,4; |
|
300
|
|
|
|
|
|
|
unless ($buf eq 'MThd') { |
|
301
|
|
|
|
|
|
|
carp "Not a valid MIDI file: $source"; |
|
302
|
|
|
|
|
|
|
return undef; |
|
303
|
|
|
|
|
|
|
} |
|
304
|
|
|
|
|
|
|
read MIDI,$buf,4; |
|
305
|
|
|
|
|
|
|
my $hsize = unpack('N',$buf); |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
read MIDI,$buf,$hsize; |
|
308
|
|
|
|
|
|
|
my ($format, $trackCount, $frames, $ticks); |
|
309
|
|
|
|
|
|
|
($format, $trackCount, $ticks) = unpack('nnn',$buf); |
|
310
|
|
|
|
|
|
|
if ($ticks < 0) { |
|
311
|
|
|
|
|
|
|
($format, $trackCount, $frames, $ticks) = unpack('nnCC',$buf); |
|
312
|
|
|
|
|
|
|
$frames = -$frames; |
|
313
|
|
|
|
|
|
|
} |
|
314
|
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
$sax_handlers{'Init'}->(undef); # if (exists($sax_handlers{'Init'})); |
|
316
|
|
|
|
|
|
|
$sax_handlers{'XMLDecl'}->(undef, '1.0', 'UTF-8', 'yes') if (exists($sax_handlers{'XMLDecl'})); |
|
317
|
|
|
|
|
|
|
$sax_handlers{'Comment'}->(undef, " Created by MIDI::XML Version $MIDI::XML::VERSION "); |
|
318
|
|
|
|
|
|
|
if (exists($sax_handlers{'Start'}) and exists($sax_handlers{'End'})) { |
|
319
|
|
|
|
|
|
|
my $start = $sax_handlers{'Start'}; |
|
320
|
|
|
|
|
|
|
my $end = $sax_handlers{'End'}; |
|
321
|
|
|
|
|
|
|
my $char = $sax_handlers{'Char'}; |
|
322
|
|
|
|
|
|
|
$start->(undef, 'MIDIFile'); |
|
323
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
$start->(undef, 'Format'); |
|
326
|
|
|
|
|
|
|
$char->(undef, $format); |
|
327
|
|
|
|
|
|
|
$end->(undef, 'Format'); |
|
328
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
$start->(undef, 'TrackCount'); |
|
331
|
|
|
|
|
|
|
$char->(undef, $trackCount); |
|
332
|
|
|
|
|
|
|
$end->(undef, 'TrackCount'); |
|
333
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
$start->(undef, 'TicksPerBeat'); |
|
336
|
|
|
|
|
|
|
$char->(undef, $ticks); |
|
337
|
|
|
|
|
|
|
$end->(undef, 'TicksPerBeat'); |
|
338
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
339
|
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
$start->(undef, 'TimestampType'); |
|
341
|
|
|
|
|
|
|
$char->(undef, 'Absolute'); |
|
342
|
|
|
|
|
|
|
$end->(undef, 'TimestampType'); |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
# $sax_handlers{'Proc'}->(undef, 'midi-xml', 'Start of tracks'); |
|
345
|
|
|
|
|
|
|
my $byte; |
|
346
|
|
|
|
|
|
|
for my $t (1..$trackCount) { |
|
347
|
|
|
|
|
|
|
read MIDI,$buf,4; |
|
348
|
|
|
|
|
|
|
unless ($buf eq 'MTrk') { |
|
349
|
|
|
|
|
|
|
carp "Not a valid MIDI file: $source"; |
|
350
|
|
|
|
|
|
|
return undef; |
|
351
|
|
|
|
|
|
|
} |
|
352
|
|
|
|
|
|
|
read MIDI,$buf,4; |
|
353
|
|
|
|
|
|
|
my $tsize = unpack('N',$buf); |
|
354
|
|
|
|
|
|
|
read MIDI,$buf,$tsize; |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
357
|
|
|
|
|
|
|
$start->(undef, 'Track', 'Number', $t-1); |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
my $rstatus = 0; |
|
360
|
|
|
|
|
|
|
my $i = 0; |
|
361
|
|
|
|
|
|
|
my $abs_time = 0; |
|
362
|
|
|
|
|
|
|
my $status; |
|
363
|
|
|
|
|
|
|
my $r_status; |
|
364
|
|
|
|
|
|
|
while ($i < length($buf)) { |
|
365
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
366
|
|
|
|
|
|
|
# print "$t $i $byte\n"; |
|
367
|
|
|
|
|
|
|
$i += 1; |
|
368
|
|
|
|
|
|
|
my $time = $byte & 0x7F; |
|
369
|
|
|
|
|
|
|
while ($byte > 127) { |
|
370
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
371
|
|
|
|
|
|
|
$i += 1; |
|
372
|
|
|
|
|
|
|
$time <<= 7; |
|
373
|
|
|
|
|
|
|
$time |= $byte & 0x7F; |
|
374
|
|
|
|
|
|
|
} |
|
375
|
|
|
|
|
|
|
$abs_time += $time; |
|
376
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
377
|
|
|
|
|
|
|
$start->(undef, 'Event'); |
|
378
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
379
|
|
|
|
|
|
|
$start->(undef, 'Absolute'); |
|
380
|
|
|
|
|
|
|
$char->(undef, $abs_time); |
|
381
|
|
|
|
|
|
|
$end->(undef, 'Absolute'); |
|
382
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
383
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
384
|
|
|
|
|
|
|
if ($byte > 127) { |
|
385
|
|
|
|
|
|
|
$status = $byte; |
|
386
|
|
|
|
|
|
|
$i += 1; |
|
387
|
|
|
|
|
|
|
$r_status = $status; |
|
388
|
|
|
|
|
|
|
} else { |
|
389
|
|
|
|
|
|
|
$status = $r_status; |
|
390
|
|
|
|
|
|
|
} |
|
391
|
|
|
|
|
|
|
my $command; |
|
392
|
|
|
|
|
|
|
my $channel; |
|
393
|
|
|
|
|
|
|
if ($status > 0x7f and $status < 0xf0) { |
|
394
|
|
|
|
|
|
|
$command = $status & 0xf0; |
|
395
|
|
|
|
|
|
|
$channel = ($status & 0x0f) + 1; |
|
396
|
|
|
|
|
|
|
} else { |
|
397
|
|
|
|
|
|
|
$command = $status; |
|
398
|
|
|
|
|
|
|
} |
|
399
|
|
|
|
|
|
|
if($status < 0x80) { |
|
400
|
|
|
|
|
|
|
carp "bad status $status"; |
|
401
|
|
|
|
|
|
|
} elsif ($command == 0x80) { |
|
402
|
|
|
|
|
|
|
my $note = ord(substr($buf,$i)); |
|
403
|
|
|
|
|
|
|
$i += 1; |
|
404
|
|
|
|
|
|
|
my $velocity = ord(substr($buf,$i)); |
|
405
|
|
|
|
|
|
|
$i += 1; |
|
406
|
|
|
|
|
|
|
$start->(undef, 'NoteOff','Channel', $channel, 'Note', $note, 'Velocity', $velocity); |
|
407
|
|
|
|
|
|
|
$end->(undef, 'NoteOff'); |
|
408
|
|
|
|
|
|
|
} elsif ($command == 0x90) { |
|
409
|
|
|
|
|
|
|
my $note = ord(substr($buf,$i)); |
|
410
|
|
|
|
|
|
|
$i += 1; |
|
411
|
|
|
|
|
|
|
my $velocity = ord(substr($buf,$i)); |
|
412
|
|
|
|
|
|
|
$i += 1; |
|
413
|
|
|
|
|
|
|
if ($velocity == 0) { |
|
414
|
|
|
|
|
|
|
$start->(undef, 'NoteOff','Channel', $channel, 'Note', $note, 'Velocity', $velocity); |
|
415
|
|
|
|
|
|
|
$end->(undef, 'NoteOff'); |
|
416
|
|
|
|
|
|
|
} else { |
|
417
|
|
|
|
|
|
|
$start->(undef, 'NoteOn','Channel', $channel, 'Note', $note, 'Velocity', $velocity); |
|
418
|
|
|
|
|
|
|
$end->(undef, 'NoteOn'); |
|
419
|
|
|
|
|
|
|
} |
|
420
|
|
|
|
|
|
|
} elsif ($command == 0xA0) { |
|
421
|
|
|
|
|
|
|
my $note = ord(substr($buf,$i)); |
|
422
|
|
|
|
|
|
|
$i += 1; |
|
423
|
|
|
|
|
|
|
my $pressure = ord(substr($buf,$i)); |
|
424
|
|
|
|
|
|
|
$i += 1; |
|
425
|
|
|
|
|
|
|
$start->(undef, 'PolyKeyPressure','Channel', $channel, 'Note', $note, 'Pressure', $pressure); |
|
426
|
|
|
|
|
|
|
$end->(undef, 'PolyKeyPressure'); |
|
427
|
|
|
|
|
|
|
} elsif ($command == 0xB0) { |
|
428
|
|
|
|
|
|
|
my $control = ord(substr($buf,$i)); |
|
429
|
|
|
|
|
|
|
$i += 1; |
|
430
|
|
|
|
|
|
|
my $value = ord(substr($buf,$i)); |
|
431
|
|
|
|
|
|
|
$i += 1; |
|
432
|
|
|
|
|
|
|
if ($control == 120) { |
|
433
|
|
|
|
|
|
|
$start->(undef, 'AllSoundOff','Channel', $channel);
|
|
434
|
|
|
|
|
|
|
$end->(undef, 'AllSoundOff');
|
|
435
|
|
|
|
|
|
|
}
|
|
436
|
|
|
|
|
|
|
elsif ($control == 121) { |
|
437
|
|
|
|
|
|
|
$start->(undef, 'ResetAllControllers','Channel', $channel);
|
|
438
|
|
|
|
|
|
|
$end->(undef, 'ResetAllControllers');
|
|
439
|
|
|
|
|
|
|
}
|
|
440
|
|
|
|
|
|
|
elsif ($control == 122) { |
|
441
|
|
|
|
|
|
|
$start->(undef, 'LocalControl','Channel', $channel, 'Value', $value);
|
|
442
|
|
|
|
|
|
|
$end->(undef, 'LocalControl');
|
|
443
|
|
|
|
|
|
|
}
|
|
444
|
|
|
|
|
|
|
elsif ($control == 123) { |
|
445
|
|
|
|
|
|
|
$start->(undef, 'AllNotesOff','Channel', $channel);
|
|
446
|
|
|
|
|
|
|
$end->(undef, 'AllNotesOff');
|
|
447
|
|
|
|
|
|
|
}
|
|
448
|
|
|
|
|
|
|
elsif ($control == 124) { |
|
449
|
|
|
|
|
|
|
$start->(undef, 'OmniOff','Channel', $channel);
|
|
450
|
|
|
|
|
|
|
$end->(undef, 'OmniOff');
|
|
451
|
|
|
|
|
|
|
}
|
|
452
|
|
|
|
|
|
|
elsif ($control == 125) { |
|
453
|
|
|
|
|
|
|
$start->(undef, 'OmniOn','Channel', $channel);
|
|
454
|
|
|
|
|
|
|
$end->(undef, 'OmniOn');
|
|
455
|
|
|
|
|
|
|
}
|
|
456
|
|
|
|
|
|
|
elsif ($control == 126) { |
|
457
|
|
|
|
|
|
|
$start->(undef, 'MonoMode','Channel', $channel, 'Value', $value);
|
|
458
|
|
|
|
|
|
|
$end->(undef, 'MonoMode');
|
|
459
|
|
|
|
|
|
|
}
|
|
460
|
|
|
|
|
|
|
elsif ($control == 127) { |
|
461
|
|
|
|
|
|
|
$start->(undef, 'PolyMode','Channel', $channel);
|
|
462
|
|
|
|
|
|
|
$end->(undef, 'PolyMode');
|
|
463
|
|
|
|
|
|
|
} else { |
|
464
|
|
|
|
|
|
|
$start->(undef, 'ControlChange','Channel', $channel, 'Control', $control, 'Value', $value); |
|
465
|
|
|
|
|
|
|
$end->(undef, 'ControlChange'); |
|
466
|
|
|
|
|
|
|
} |
|
467
|
|
|
|
|
|
|
} elsif ($command == 0xC0) { |
|
468
|
|
|
|
|
|
|
my $number = ord(substr($buf,$i)); |
|
469
|
|
|
|
|
|
|
$i += 1; |
|
470
|
|
|
|
|
|
|
$start->(undef, 'ProgramChange','Channel', $channel, 'Number', $number); |
|
471
|
|
|
|
|
|
|
$end->(undef, 'ProgramChange'); |
|
472
|
|
|
|
|
|
|
} elsif ($command == 0xD0) { |
|
473
|
|
|
|
|
|
|
my $pressure = ord(substr($buf,$i)); |
|
474
|
|
|
|
|
|
|
$i += 1; |
|
475
|
|
|
|
|
|
|
$start->(undef, 'ChannelKeyPressure','Channel', $channel, 'Pressure', $pressure); |
|
476
|
|
|
|
|
|
|
$end->(undef, 'ChannelKeyPressure'); |
|
477
|
|
|
|
|
|
|
} elsif ($command == 0xE0) { |
|
478
|
|
|
|
|
|
|
my $hi = ord(substr($buf,$i)); |
|
479
|
|
|
|
|
|
|
$i += 1; |
|
480
|
|
|
|
|
|
|
my $lo = ord(substr($buf,$i)); |
|
481
|
|
|
|
|
|
|
$i += 1; |
|
482
|
|
|
|
|
|
|
my $value = ($hi << 7) + $lo; |
|
483
|
|
|
|
|
|
|
$start->(undef, 'PitchBendChange','Channel', $channel, 'Value', $value); |
|
484
|
|
|
|
|
|
|
$end->(undef, 'PitchBendChange'); |
|
485
|
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
} elsif ($status == 0xF0 or $status == 0xF7) { |
|
487
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
488
|
|
|
|
|
|
|
my $dl = $byte & 0x7F; |
|
489
|
|
|
|
|
|
|
$i += 1; |
|
490
|
|
|
|
|
|
|
while($byte > 127) { |
|
491
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
492
|
|
|
|
|
|
|
$i += 1; |
|
493
|
|
|
|
|
|
|
$dl <<= 7; |
|
494
|
|
|
|
|
|
|
$dl |= $byte & 0x7F; |
|
495
|
|
|
|
|
|
|
} |
|
496
|
|
|
|
|
|
|
my @data; |
|
497
|
|
|
|
|
|
|
while ($dl > 0) { |
|
498
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
499
|
|
|
|
|
|
|
$i += 1; |
|
500
|
|
|
|
|
|
|
push @data,sprintf("%02x",$byte); |
|
501
|
|
|
|
|
|
|
$dl -= 1; |
|
502
|
|
|
|
|
|
|
} |
|
503
|
|
|
|
|
|
|
$start->(undef, 'SysEx'); |
|
504
|
|
|
|
|
|
|
$char->(undef, join(' ',@data)); |
|
505
|
|
|
|
|
|
|
$end->(undef, 'SysEx'); |
|
506
|
|
|
|
|
|
|
} elsif ($status == 0xF1) { |
|
507
|
|
|
|
|
|
|
my $position = ord(substr($buf,$i)); |
|
508
|
|
|
|
|
|
|
$i += 1; |
|
509
|
|
|
|
|
|
|
$start->(undef, 'SongPositionPointer','Position', $position); |
|
510
|
|
|
|
|
|
|
$end->(undef, 'SongPositionPointer'); |
|
511
|
|
|
|
|
|
|
} elsif ($status == 0xF2) { |
|
512
|
|
|
|
|
|
|
my $hi = ord(substr($buf,$i)); |
|
513
|
|
|
|
|
|
|
$i += 1; |
|
514
|
|
|
|
|
|
|
my $lo = ord(substr($buf,$i)); |
|
515
|
|
|
|
|
|
|
$i += 1; |
|
516
|
|
|
|
|
|
|
my $number = ($hi << 7) + $lo; |
|
517
|
|
|
|
|
|
|
$start->(undef, 'SongSelect','Number', $number); |
|
518
|
|
|
|
|
|
|
$end->(undef, 'SongSelect'); |
|
519
|
|
|
|
|
|
|
} elsif ($status == 0xF3) { #MTCQuarterFrame |
|
520
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
521
|
|
|
|
|
|
|
$i += 1; |
|
522
|
|
|
|
|
|
|
my $messageType = $byte >> 4; |
|
523
|
|
|
|
|
|
|
my $dataNibble = $byte & 0x07; |
|
524
|
|
|
|
|
|
|
$start->(undef, 'MTCQuarterFrame','MessageType',$messageType,'DataNibble',$dataNibble); |
|
525
|
|
|
|
|
|
|
$end->(undef, 'MTCQuarterFrame'); |
|
526
|
|
|
|
|
|
|
} elsif ($status == 0xF6) { |
|
527
|
|
|
|
|
|
|
$start->(undef, 'TuneRequest'); |
|
528
|
|
|
|
|
|
|
$end->(undef, 'TuneRequest'); |
|
529
|
|
|
|
|
|
|
} elsif ($status == 0xF8) { |
|
530
|
|
|
|
|
|
|
$start->(undef, 'TimingClock'); |
|
531
|
|
|
|
|
|
|
$end->(undef, 'TimingClock'); |
|
532
|
|
|
|
|
|
|
} elsif ($status == 0xFA) { |
|
533
|
|
|
|
|
|
|
$start->(undef, 'Start'); |
|
534
|
|
|
|
|
|
|
$end->(undef, 'Start'); |
|
535
|
|
|
|
|
|
|
} elsif ($status == 0xFB) { |
|
536
|
|
|
|
|
|
|
$start->(undef, 'Continue'); |
|
537
|
|
|
|
|
|
|
$end->(undef, 'Continue'); |
|
538
|
|
|
|
|
|
|
} elsif ($status == 0xFC) { |
|
539
|
|
|
|
|
|
|
$start->(undef, 'Stop'); |
|
540
|
|
|
|
|
|
|
$end->(undef, 'Stop'); |
|
541
|
|
|
|
|
|
|
} elsif ($status == 0xFE) { |
|
542
|
|
|
|
|
|
|
$start->(undef, 'ActiveSensing'); |
|
543
|
|
|
|
|
|
|
$end->(undef, 'ActiveSensing'); |
|
544
|
|
|
|
|
|
|
} elsif ($status == 0xFF) { |
|
545
|
|
|
|
|
|
|
# On the wire = SystemReset else MetaEvent |
|
546
|
|
|
|
|
|
|
my $meta = ord(substr($buf,$i)); |
|
547
|
|
|
|
|
|
|
$i += 1; |
|
548
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
549
|
|
|
|
|
|
|
$i += 1; |
|
550
|
|
|
|
|
|
|
my $dl = $byte & 0x7F; |
|
551
|
|
|
|
|
|
|
while($byte > 127) { |
|
552
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
553
|
|
|
|
|
|
|
$i += 1; |
|
554
|
|
|
|
|
|
|
$dl <<= 7; |
|
555
|
|
|
|
|
|
|
$dl |= $byte & 0x7F; |
|
556
|
|
|
|
|
|
|
} |
|
557
|
|
|
|
|
|
|
if($meta >0 and $meta < 10) { |
|
558
|
|
|
|
|
|
|
my $text = substr($buf,$i,$dl); |
|
559
|
|
|
|
|
|
|
$i += $dl; |
|
560
|
|
|
|
|
|
|
if($meta == 1) { |
|
561
|
|
|
|
|
|
|
$start->(undef, 'TextEvent'); |
|
562
|
|
|
|
|
|
|
$char->(undef, $text); |
|
563
|
|
|
|
|
|
|
$end->(undef, 'TextEvent'); |
|
564
|
|
|
|
|
|
|
} |
|
565
|
|
|
|
|
|
|
elsif($meta == 2) { |
|
566
|
|
|
|
|
|
|
$start->(undef, 'CopyrightNotice'); |
|
567
|
|
|
|
|
|
|
$char->(undef, $text); |
|
568
|
|
|
|
|
|
|
$end->(undef, 'CopyrightNotice'); |
|
569
|
|
|
|
|
|
|
} |
|
570
|
|
|
|
|
|
|
elsif($meta == 3) { |
|
571
|
|
|
|
|
|
|
$start->(undef, 'TrackName'); |
|
572
|
|
|
|
|
|
|
$char->(undef, $text); |
|
573
|
|
|
|
|
|
|
$end->(undef, 'TrackName'); |
|
574
|
|
|
|
|
|
|
} |
|
575
|
|
|
|
|
|
|
elsif($meta == 4) { |
|
576
|
|
|
|
|
|
|
$start->(undef, 'InstrumentName'); |
|
577
|
|
|
|
|
|
|
$char->(undef, $text); |
|
578
|
|
|
|
|
|
|
$end->(undef, 'InstrumentName'); |
|
579
|
|
|
|
|
|
|
} |
|
580
|
|
|
|
|
|
|
elsif($meta == 5) { |
|
581
|
|
|
|
|
|
|
$start->(undef, 'Lyric'); |
|
582
|
|
|
|
|
|
|
$char->(undef, $text); |
|
583
|
|
|
|
|
|
|
$end->(undef, 'Lyric'); |
|
584
|
|
|
|
|
|
|
} |
|
585
|
|
|
|
|
|
|
elsif($meta == 6) { |
|
586
|
|
|
|
|
|
|
$start->(undef, 'Marker'); |
|
587
|
|
|
|
|
|
|
$char->(undef, $text); |
|
588
|
|
|
|
|
|
|
$end->(undef, 'Marker'); |
|
589
|
|
|
|
|
|
|
} |
|
590
|
|
|
|
|
|
|
elsif($meta == 7) { |
|
591
|
|
|
|
|
|
|
$start->(undef, 'CuePoint'); |
|
592
|
|
|
|
|
|
|
$char->(undef, $text); |
|
593
|
|
|
|
|
|
|
$end->(undef, 'CuePoint'); |
|
594
|
|
|
|
|
|
|
} |
|
595
|
|
|
|
|
|
|
elsif($meta == 8) { |
|
596
|
|
|
|
|
|
|
$start->(undef, 'ProgramName'); |
|
597
|
|
|
|
|
|
|
$char->(undef, $text); |
|
598
|
|
|
|
|
|
|
$end->(undef, 'ProgramName'); |
|
599
|
|
|
|
|
|
|
} |
|
600
|
|
|
|
|
|
|
elsif($meta == 9) { |
|
601
|
|
|
|
|
|
|
$start->(undef, 'DeviceName'); |
|
602
|
|
|
|
|
|
|
$char->(undef, $text); |
|
603
|
|
|
|
|
|
|
$end->(undef, 'DeviceName'); |
|
604
|
|
|
|
|
|
|
} |
|
605
|
|
|
|
|
|
|
} |
|
606
|
|
|
|
|
|
|
elsif($meta == 0 or $meta == 0x20 or $meta == 0x21 |
|
607
|
|
|
|
|
|
|
or $meta == 0x2f or $meta == 0x51 or $meta == 0x54 |
|
608
|
|
|
|
|
|
|
or $meta == 0x58 or $meta == 0x59) { |
|
609
|
|
|
|
|
|
|
my @data; |
|
610
|
|
|
|
|
|
|
for my $j (1..$dl) { |
|
611
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
612
|
|
|
|
|
|
|
$i += 1; |
|
613
|
|
|
|
|
|
|
push @data,$byte; |
|
614
|
|
|
|
|
|
|
} |
|
615
|
|
|
|
|
|
|
if($meta == 0) { |
|
616
|
|
|
|
|
|
|
$start->(undef, 'SequenceNumber', 'Value', $data[0]<<8 + $data[1]); |
|
617
|
|
|
|
|
|
|
$end->(undef, 'SequenceNumber'); |
|
618
|
|
|
|
|
|
|
} |
|
619
|
|
|
|
|
|
|
elsif($meta == 0x20) { |
|
620
|
|
|
|
|
|
|
$start->(undef, 'MIDIChannelPrefix', 'Value', $data[0]); |
|
621
|
|
|
|
|
|
|
$end->(undef, 'MIDIChannelPrefix'); |
|
622
|
|
|
|
|
|
|
} |
|
623
|
|
|
|
|
|
|
elsif($meta == 0x21) { |
|
624
|
|
|
|
|
|
|
$start->(undef, 'Port', 'Value', $data[0]); |
|
625
|
|
|
|
|
|
|
$end->(undef, 'Port'); |
|
626
|
|
|
|
|
|
|
} |
|
627
|
|
|
|
|
|
|
elsif($meta == 0x2f) { |
|
628
|
|
|
|
|
|
|
$start->(undef, 'EndOfTrack'); |
|
629
|
|
|
|
|
|
|
$end->(undef, 'EndOfTrack'); |
|
630
|
|
|
|
|
|
|
} |
|
631
|
|
|
|
|
|
|
elsif($meta == 0x51) { |
|
632
|
|
|
|
|
|
|
my $value = ($data[0]<<16) + ($data[1]<<8) + $data[2]; |
|
633
|
|
|
|
|
|
|
$start->(undef, 'SetTempo', 'Value', $value); |
|
634
|
|
|
|
|
|
|
$end->(undef, 'SetTempo'); |
|
635
|
|
|
|
|
|
|
} |
|
636
|
|
|
|
|
|
|
elsif($meta == 0x54) { |
|
637
|
|
|
|
|
|
|
my $timeCodeType = ($data[0] >> 5) & 0x03;
|
|
638
|
|
|
|
|
|
|
my $hour = $data[0] & 0x1F;
|
|
639
|
|
|
|
|
|
|
my $minute = $data[1];
|
|
640
|
|
|
|
|
|
|
my $second = $data[2];
|
|
641
|
|
|
|
|
|
|
my $frame = $data[3];
|
|
642
|
|
|
|
|
|
|
my $fractionalFrame = $data[4]; |
|
643
|
|
|
|
|
|
|
$start->(undef, 'SMPTEOffset','TimeCodeType',$timeCodeType,
|
|
644
|
|
|
|
|
|
|
'Hour',$hour,
|
|
645
|
|
|
|
|
|
|
'Minute',$minute,
|
|
646
|
|
|
|
|
|
|
'Second',$second,
|
|
647
|
|
|
|
|
|
|
'Frame',$frame,
|
|
648
|
|
|
|
|
|
|
'FractionalFrame',$fractionalFrame); |
|
649
|
|
|
|
|
|
|
$end->(undef, 'SMPTEOffset'); |
|
650
|
|
|
|
|
|
|
} |
|
651
|
|
|
|
|
|
|
elsif($meta == 0x58) { |
|
652
|
|
|
|
|
|
|
$start->(undef, 'TimeSignature','Numerator',$data[0], |
|
653
|
|
|
|
|
|
|
'LogDenominator',$data[1], |
|
654
|
|
|
|
|
|
|
'MIDIClocksPerMetronomeClick',$data[2], |
|
655
|
|
|
|
|
|
|
'ThirtySecondsPer24Clocks',$data[3]); |
|
656
|
|
|
|
|
|
|
$end->(undef, 'TimeSignature'); |
|
657
|
|
|
|
|
|
|
} |
|
658
|
|
|
|
|
|
|
elsif($meta == 0x59) { |
|
659
|
|
|
|
|
|
|
my $fifths = $data[0]; |
|
660
|
|
|
|
|
|
|
$fifths -= 256 if ($fifths > 127); |
|
661
|
|
|
|
|
|
|
my $mode = $data[1]; |
|
662
|
|
|
|
|
|
|
$start->(undef, 'KeySignature','Fifths',$fifths,'Mode',$mode); |
|
663
|
|
|
|
|
|
|
$end->(undef, 'KeySignature'); |
|
664
|
|
|
|
|
|
|
} |
|
665
|
|
|
|
|
|
|
} else { |
|
666
|
|
|
|
|
|
|
my @data; |
|
667
|
|
|
|
|
|
|
while ($dl > 0) { |
|
668
|
|
|
|
|
|
|
$byte = ord(substr($buf,$i)); |
|
669
|
|
|
|
|
|
|
$i += 1; |
|
670
|
|
|
|
|
|
|
push @data,sprintf("%02x",$byte); |
|
671
|
|
|
|
|
|
|
$dl -= 1; |
|
672
|
|
|
|
|
|
|
} |
|
673
|
|
|
|
|
|
|
if($meta == 0x7f ) { |
|
674
|
|
|
|
|
|
|
$start->(undef, 'SequencerSpecific'); |
|
675
|
|
|
|
|
|
|
$char->(undef, join(' ',@data)); |
|
676
|
|
|
|
|
|
|
$end->(undef, 'SequencerSpecific'); |
|
677
|
|
|
|
|
|
|
} else { |
|
678
|
|
|
|
|
|
|
$start->(undef, 'OtherMetaEvent'); |
|
679
|
|
|
|
|
|
|
$char->(undef, join(' ',@data)); |
|
680
|
|
|
|
|
|
|
$end->(undef, 'OtherMetaEvent'); |
|
681
|
|
|
|
|
|
|
} |
|
682
|
|
|
|
|
|
|
} |
|
683
|
|
|
|
|
|
|
} |
|
684
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
685
|
|
|
|
|
|
|
$end->(undef, 'Event'); |
|
686
|
|
|
|
|
|
|
} |
|
687
|
|
|
|
|
|
|
$char->(undef, "\n ") if ($pretty); |
|
688
|
|
|
|
|
|
|
$end->(undef, 'Track'); |
|
689
|
|
|
|
|
|
|
} |
|
690
|
|
|
|
|
|
|
$char->(undef, "\n") if ($pretty); |
|
691
|
|
|
|
|
|
|
$end->(undef, 'MIDIFile'); |
|
692
|
|
|
|
|
|
|
} |
|
693
|
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
close MIDI; |
|
695
|
|
|
|
|
|
|
|
|
696
|
|
|
|
|
|
|
return $Document; |
|
697
|
|
|
|
|
|
|
} |
|
698
|
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
#=============================================================================== |
|
700
|
|
|
|
|
|
|
{ |
|
701
|
|
|
|
|
|
|
package XML::DOM::Implementation; |
|
702
|
|
|
|
|
|
|
|
|
703
|
|
|
|
|
|
|
sub createDocument() { |
|
704
|
|
|
|
|
|
|
my $self = shift; |
|
705
|
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
my $doc = new XML::DOM::Document(); |
|
707
|
|
|
|
|
|
|
my $xmlDecl = $doc->createXMLDecl('1.0','UTF-8','yes'); |
|
708
|
|
|
|
|
|
|
$doc->setXMLDecl($xmlDecl); |
|
709
|
|
|
|
|
|
|
my $ns; |
|
710
|
|
|
|
|
|
|
my $qname; |
|
711
|
|
|
|
|
|
|
my $doctype; |
|
712
|
|
|
|
|
|
|
if (@_) { |
|
713
|
|
|
|
|
|
|
$ns = shift; |
|
714
|
|
|
|
|
|
|
} |
|
715
|
|
|
|
|
|
|
if (@_) { |
|
716
|
|
|
|
|
|
|
$qname = shift; |
|
717
|
|
|
|
|
|
|
} |
|
718
|
|
|
|
|
|
|
if (@_) { |
|
719
|
|
|
|
|
|
|
$doctype = shift; |
|
720
|
|
|
|
|
|
|
} |
|
721
|
|
|
|
|
|
|
if (defined($qname)) { |
|
722
|
|
|
|
|
|
|
my $element = $doc->createElement($qname); |
|
723
|
|
|
|
|
|
|
$doc->appendChild($element); |
|
724
|
|
|
|
|
|
|
} |
|
725
|
|
|
|
|
|
|
return $doc; |
|
726
|
|
|
|
|
|
|
} |
|
727
|
|
|
|
|
|
|
} |
|
728
|
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
#=============================================================================== |
|
730
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
731
|
|
|
|
|
|
|
# UML Model UUID: |
|
732
|
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
package MIDI::XML::Document; |
|
734
|
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
use Carp; |
|
736
|
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
our @ISA = qw(XML::DOM::Document); |
|
738
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
739
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
740
|
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
BEGIN |
|
742
|
|
|
|
|
|
|
{ |
|
743
|
|
|
|
|
|
|
import XML::DOM::Node qw( :Fields ); |
|
744
|
|
|
|
|
|
|
} |
|
745
|
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
=head1 NAME |
|
747
|
|
|
|
|
|
|
|
|
748
|
|
|
|
|
|
|
MIDI::XML::Document - Module for representing Document objects. |
|
749
|
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
=head1 DESCRIPTION of Document |
|
751
|
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
=cut |
|
754
|
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
#=============================================================================== |
|
756
|
|
|
|
|
|
|
|
|
757
|
|
|
|
|
|
|
=head2 $Object = MIDI::XML::Document->new(); |
|
758
|
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
Create a new MIDI::XML::Document object. |
|
760
|
|
|
|
|
|
|
|
|
761
|
|
|
|
|
|
|
=cut |
|
762
|
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
sub new() { |
|
764
|
|
|
|
|
|
|
my $class = shift; |
|
765
|
|
|
|
|
|
|
$class = ref($class) || $class; |
|
766
|
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
my $qname; |
|
768
|
|
|
|
|
|
|
if (@_) { |
|
769
|
|
|
|
|
|
|
$qname = shift; |
|
770
|
|
|
|
|
|
|
} |
|
771
|
|
|
|
|
|
|
|
|
772
|
|
|
|
|
|
|
my $self = XML::DOM::Document::new($class); |
|
773
|
|
|
|
|
|
|
my $xmlDecl = $self->createXMLDecl('1.0','UTF-8','yes'); |
|
774
|
|
|
|
|
|
|
$self->setXMLDecl($xmlDecl); |
|
775
|
|
|
|
|
|
|
if (defined($qname)) { |
|
776
|
|
|
|
|
|
|
my $element = $self->createElement($qname); |
|
777
|
|
|
|
|
|
|
$self->appendChild($element); |
|
778
|
|
|
|
|
|
|
} |
|
779
|
|
|
|
|
|
|
$self->[_UserData] = {}; |
|
780
|
|
|
|
|
|
|
# $self->[_UserData]{'_measures'} = []; |
|
781
|
|
|
|
|
|
|
return $self; |
|
782
|
|
|
|
|
|
|
} |
|
783
|
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
our %tag_map = ( |
|
785
|
|
|
|
|
|
|
'Absolute' => 'MIDI::XML::Absolute', |
|
786
|
|
|
|
|
|
|
'ActiveSensing' => 'MIDI::XML::ActiveSensing', |
|
787
|
|
|
|
|
|
|
'AllNotesOff' => 'MIDI::XML::AllNotesOff', |
|
788
|
|
|
|
|
|
|
'AllSoundOff' => 'MIDI::XML::AllSoundOff', |
|
789
|
|
|
|
|
|
|
'ChannelKeyPressure' => 'MIDI::XML::ChannelKeyPressure', |
|
790
|
|
|
|
|
|
|
'Continue' => 'MIDI::XML::Continue', |
|
791
|
|
|
|
|
|
|
'ControlChange' => 'MIDI::XML::ControlChange', |
|
792
|
|
|
|
|
|
|
'ControlChange14' => 'MIDI::XML::ControlChange14', |
|
793
|
|
|
|
|
|
|
'CopyrightNotice' => 'MIDI::XML::CopyrightNotice', |
|
794
|
|
|
|
|
|
|
'CuePoint' => 'MIDI::XML::CuePoint', |
|
795
|
|
|
|
|
|
|
'Delta' => 'MIDI::XML::Delta', |
|
796
|
|
|
|
|
|
|
'DeviceName' => 'MIDI::XML::DeviceName', |
|
797
|
|
|
|
|
|
|
'EndOfExclusive' => 'MIDI::XML::EndOfExclusive', |
|
798
|
|
|
|
|
|
|
'EndOfTrack' => 'MIDI::XML::EndOfTrack', |
|
799
|
|
|
|
|
|
|
'Event' => 'MIDI::XML::Event', |
|
800
|
|
|
|
|
|
|
'Format' => 'MIDI::XML::Format', |
|
801
|
|
|
|
|
|
|
'FrameRate' => 'MIDI::XML::FrameRate', |
|
802
|
|
|
|
|
|
|
'InstrumentName' => 'MIDI::XML::InstrumentName', |
|
803
|
|
|
|
|
|
|
'KeySignature' => 'MIDI::XML::KeySignature', |
|
804
|
|
|
|
|
|
|
'LocalControl' => 'MIDI::XML::LocalControl', |
|
805
|
|
|
|
|
|
|
'Lyric' => 'MIDI::XML::Lyric', |
|
806
|
|
|
|
|
|
|
'Marker' => 'MIDI::XML::Marker', |
|
807
|
|
|
|
|
|
|
'MIDIChannelPrefix' => 'MIDI::XML::MIDIChannelPrefix', |
|
808
|
|
|
|
|
|
|
'MIDIFile' => 'MIDI::XML::MIDIfile', |
|
809
|
|
|
|
|
|
|
'MonoMode' => 'MIDI::XML::MonoMode', |
|
810
|
|
|
|
|
|
|
'MTCQuarterFrame' => 'MIDI::XML::MTCQuarterFrame', |
|
811
|
|
|
|
|
|
|
'NoteOff' => 'MIDI::XML::NoteOff', |
|
812
|
|
|
|
|
|
|
'NoteOn' => 'MIDI::XML::NoteOn', |
|
813
|
|
|
|
|
|
|
'NRPNChange' => 'MIDI::XML::NRPNChange', |
|
814
|
|
|
|
|
|
|
'OmniOff' => 'MIDI::XML::OmniOff', |
|
815
|
|
|
|
|
|
|
'OmniOn' => 'MIDI::XML::OmniOn', |
|
816
|
|
|
|
|
|
|
'OtherMetaEvent' => 'MIDI::XML::OtherMetaEvent', |
|
817
|
|
|
|
|
|
|
'PitchBendChange' => 'MIDI::XML::PitchBendChange', |
|
818
|
|
|
|
|
|
|
'PolyKeyPressure' => 'MIDI::XML::PolyKeyPressure', |
|
819
|
|
|
|
|
|
|
'PolyMode' => 'MIDI::XML::PolyMode', |
|
820
|
|
|
|
|
|
|
'Port' => 'MIDI::XML::Port', |
|
821
|
|
|
|
|
|
|
'ProgramChange' => 'MIDI::XML::ProgramChange', |
|
822
|
|
|
|
|
|
|
'ProgramName' => 'MIDI::XML::ProgramName', |
|
823
|
|
|
|
|
|
|
'ResetAllControllers' => 'MIDI::XML::ResetAllControllers', |
|
824
|
|
|
|
|
|
|
'RPNChange' => 'MIDI::XML::RPNChange', |
|
825
|
|
|
|
|
|
|
'SequenceNumber' => 'MIDI::XML::SequenceNumber', |
|
826
|
|
|
|
|
|
|
'SequencerSpecific' => 'MIDI::XML::SequencerSpecific', |
|
827
|
|
|
|
|
|
|
'SetTempo' => 'MIDI::XML::SetTempo', |
|
828
|
|
|
|
|
|
|
'SMPTEOffset' => 'MIDI::XML::SMPTEOffset', |
|
829
|
|
|
|
|
|
|
'SongPositionPointer' => 'MIDI::XML::SongPositionPointer', |
|
830
|
|
|
|
|
|
|
'SongSelect' => 'MIDI::XML::SongSelect', |
|
831
|
|
|
|
|
|
|
'Start' => 'MIDI::XML::Start', |
|
832
|
|
|
|
|
|
|
'Stop' => 'MIDI::XML::Stop', |
|
833
|
|
|
|
|
|
|
'SysEx' => 'MIDI::XML::SysEx', |
|
834
|
|
|
|
|
|
|
'SysExChannel' => 'MIDI::XML::SysExChannel', |
|
835
|
|
|
|
|
|
|
'SysExDeviceID' => 'MIDI::XML::SysExDeviceID', |
|
836
|
|
|
|
|
|
|
'SystemExclusive' => 'MIDI::XML::SystemExclusive', |
|
837
|
|
|
|
|
|
|
'SystemReset' => 'MIDI::XML::SystemReset', |
|
838
|
|
|
|
|
|
|
'TextEvent' => 'MIDI::XML::TextEvent', |
|
839
|
|
|
|
|
|
|
'TicksPerBeat' => 'MIDI::XML::TicksPerBeat', |
|
840
|
|
|
|
|
|
|
'TicksPerFrame' => 'MIDI::XML::TicksPerFrame', |
|
841
|
|
|
|
|
|
|
'TimeSignature' => 'MIDI::XML::TimeSignature', |
|
842
|
|
|
|
|
|
|
'TimestampType' => 'MIDI::XML::TimestampType', |
|
843
|
|
|
|
|
|
|
'TimingClock' => 'MIDI::XML::TimingClock', |
|
844
|
|
|
|
|
|
|
'Track' => 'MIDI::XML::Track', |
|
845
|
|
|
|
|
|
|
'TrackCount' => 'MIDI::XML::TrackCount', |
|
846
|
|
|
|
|
|
|
'TrackName' => 'MIDI::XML::TrackName', |
|
847
|
|
|
|
|
|
|
'TuneRequest' => 'MIDI::XML::TuneRequest', |
|
848
|
|
|
|
|
|
|
'XMFPatchTypePrefix' => 'MIDI::XML::XMFPatchTypePrefix', |
|
849
|
|
|
|
|
|
|
); |
|
850
|
|
|
|
|
|
|
|
|
851
|
|
|
|
|
|
|
sub createElement() { |
|
852
|
|
|
|
|
|
|
my $self = shift; |
|
853
|
|
|
|
|
|
|
my $qname = shift; |
|
854
|
|
|
|
|
|
|
if(exists($tag_map{$qname})) { |
|
855
|
|
|
|
|
|
|
return XML::DOM::Element::new($tag_map{$qname},$self,$qname); |
|
856
|
|
|
|
|
|
|
} else { |
|
857
|
|
|
|
|
|
|
return XML::DOM::Element->new($self,$qname); |
|
858
|
|
|
|
|
|
|
} |
|
859
|
|
|
|
|
|
|
} |
|
860
|
|
|
|
|
|
|
|
|
861
|
|
|
|
|
|
|
#========================================================================== |
|
862
|
|
|
|
|
|
|
|
|
863
|
|
|
|
|
|
|
=item $array_ref = $MidiFile->measures() or $MidiFile->measures('refresh'); |
|
864
|
|
|
|
|
|
|
|
|
865
|
|
|
|
|
|
|
Returns a reference to an array of measures. If called with |
|
866
|
|
|
|
|
|
|
any parameter the array is refreshed before the reference is returned. |
|
867
|
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
=cut |
|
869
|
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
sub measures { |
|
871
|
|
|
|
|
|
|
my $self = shift; |
|
872
|
|
|
|
|
|
|
my @measures; |
|
873
|
|
|
|
|
|
|
my @timesig; |
|
874
|
|
|
|
|
|
|
my $end = 0; |
|
875
|
|
|
|
|
|
|
|
|
876
|
|
|
|
|
|
|
if (@_) { |
|
877
|
|
|
|
|
|
|
$self->[_UserData]{'_measures'} = undef; |
|
878
|
|
|
|
|
|
|
} |
|
879
|
|
|
|
|
|
|
if (defined($self->[_UserData]{'_measures'})) { |
|
880
|
|
|
|
|
|
|
return $self->[_UserData]{'_measures'}; |
|
881
|
|
|
|
|
|
|
} |
|
882
|
|
|
|
|
|
|
my $model = $self->getDocumentElement(); |
|
883
|
|
|
|
|
|
|
my $ticksPerBeat = $model->TicksPerBeat(); |
|
884
|
|
|
|
|
|
|
my @tracks = $model->getElementsByTagName('Track'); |
|
885
|
|
|
|
|
|
|
|
|
886
|
|
|
|
|
|
|
# find the length of the longest track. |
|
887
|
|
|
|
|
|
|
foreach my $track (@tracks) { |
|
888
|
|
|
|
|
|
|
my $e = $track->end(); |
|
889
|
|
|
|
|
|
|
$end = $e if ($e > $end); |
|
890
|
|
|
|
|
|
|
} |
|
891
|
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
# collect data from TimeSignature objects; |
|
893
|
|
|
|
|
|
|
my @events = $tracks[0]->getElementsByTagName('Event'); |
|
894
|
|
|
|
|
|
|
my $abs = 0; |
|
895
|
|
|
|
|
|
|
foreach my $event (@events) { |
|
896
|
|
|
|
|
|
|
my $timestamp = $event->Timestamp; |
|
897
|
|
|
|
|
|
|
my $value = $timestamp->value(); |
|
898
|
|
|
|
|
|
|
my $tsclass = ref($timestamp); |
|
899
|
|
|
|
|
|
|
if ($tsclass eq 'MIDI::XML::Delta') { |
|
900
|
|
|
|
|
|
|
$abs += $value; |
|
901
|
|
|
|
|
|
|
} elsif ($tsclass eq 'MIDI::XML::Absolute') { |
|
902
|
|
|
|
|
|
|
$abs = $value; |
|
903
|
|
|
|
|
|
|
} |
|
904
|
|
|
|
|
|
|
my @tsigs = $event->getElementsByTagName('TimeSignature'); |
|
905
|
|
|
|
|
|
|
foreach my $tsig (@tsigs) { |
|
906
|
|
|
|
|
|
|
my $num = $tsig->Numerator(); |
|
907
|
|
|
|
|
|
|
my $log = $tsig->LogDenominator(); |
|
908
|
|
|
|
|
|
|
my $den = 2 ** $log; |
|
909
|
|
|
|
|
|
|
push @timesig, [$abs,$num,$den]; |
|
910
|
|
|
|
|
|
|
} |
|
911
|
|
|
|
|
|
|
} |
|
912
|
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
push @timesig, [$end,1,1]; |
|
914
|
|
|
|
|
|
|
|
|
915
|
|
|
|
|
|
|
my $meas = 1; |
|
916
|
|
|
|
|
|
|
my $time=0; |
|
917
|
|
|
|
|
|
|
my $denom_ticks; |
|
918
|
|
|
|
|
|
|
for (my $i=0; $i<$#timesig; $i++) { |
|
919
|
|
|
|
|
|
|
my $lim = $timesig[$i+1]->[0]; |
|
920
|
|
|
|
|
|
|
$denom_ticks = $ticksPerBeat * 4 / $timesig[$i]->[2]; |
|
921
|
|
|
|
|
|
|
my $divs = $denom_ticks * $timesig[$i]->[1]; |
|
922
|
|
|
|
|
|
|
while ($time < $lim) { |
|
923
|
|
|
|
|
|
|
push @{$self->[_UserData]{'_measures'}},[$time,$denom_ticks,$divs]; |
|
924
|
|
|
|
|
|
|
$meas++; |
|
925
|
|
|
|
|
|
|
$time += $divs; |
|
926
|
|
|
|
|
|
|
} |
|
927
|
|
|
|
|
|
|
} |
|
928
|
|
|
|
|
|
|
push @{$self->[_UserData]{'_measures'}},[$time,$denom_ticks,0]; |
|
929
|
|
|
|
|
|
|
|
|
930
|
|
|
|
|
|
|
return $self->[_UserData]{'_measures'}; |
|
931
|
|
|
|
|
|
|
} |
|
932
|
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
#=============================================================================== |
|
934
|
|
|
|
|
|
|
|
|
935
|
|
|
|
|
|
|
sub var_len_int($) { |
|
936
|
|
|
|
|
|
|
my $int = shift @_; |
|
937
|
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
my @i; |
|
939
|
|
|
|
|
|
|
unshift @i,($int & 0x7F); |
|
940
|
|
|
|
|
|
|
$int >>= 7; |
|
941
|
|
|
|
|
|
|
while ($int > 0) { |
|
942
|
|
|
|
|
|
|
unshift @i,(($int & 0x7F) | 0x80); |
|
943
|
|
|
|
|
|
|
$int >>= 7; |
|
944
|
|
|
|
|
|
|
} |
|
945
|
|
|
|
|
|
|
if(wantarray()) { |
|
946
|
|
|
|
|
|
|
return @i; |
|
947
|
|
|
|
|
|
|
} |
|
948
|
|
|
|
|
|
|
return \@i; |
|
949
|
|
|
|
|
|
|
} |
|
950
|
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
#=============================================================================== |
|
952
|
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
=item MIDI::XML::Document->writefile($path); |
|
954
|
|
|
|
|
|
|
|
|
955
|
|
|
|
|
|
|
This method is used to write an Standard MIDI file. |
|
956
|
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
=cut |
|
958
|
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
sub writefile($) { |
|
960
|
|
|
|
|
|
|
my $self = shift @_; |
|
961
|
|
|
|
|
|
|
my $source = shift @_; |
|
962
|
|
|
|
|
|
|
|
|
963
|
|
|
|
|
|
|
my $Model = $self->getDocumentElement(); |
|
964
|
|
|
|
|
|
|
my $format = $Model->Format(); |
|
965
|
|
|
|
|
|
|
my $trackCount = $Model->TrackCount(); |
|
966
|
|
|
|
|
|
|
my $frames = $Model->FrameRate();
|
|
967
|
|
|
|
|
|
|
my $ticks = $Model->TicksPerBeat();
|
|
968
|
|
|
|
|
|
|
|
|
969
|
|
|
|
|
|
|
# print "\$format = $format\n";
|
|
970
|
|
|
|
|
|
|
# print "\$trackCount = $trackCount\n";
|
|
971
|
|
|
|
|
|
|
# print "\$frames = $frames\n";
|
|
972
|
|
|
|
|
|
|
# print "\$ticks = $ticks\n";
|
|
973
|
|
|
|
|
|
|
|
|
974
|
|
|
|
|
|
|
my $err = 0; |
|
975
|
|
|
|
|
|
|
open MIDI,'>',$source or $err = 1; |
|
976
|
|
|
|
|
|
|
if ($err) { |
|
977
|
|
|
|
|
|
|
carp "Error opening file $source"; |
|
978
|
|
|
|
|
|
|
return undef; |
|
979
|
|
|
|
|
|
|
} |
|
980
|
|
|
|
|
|
|
binmode MIDI; |
|
981
|
|
|
|
|
|
|
my $buf; |
|
982
|
|
|
|
|
|
|
if(defined($frames)) { |
|
983
|
|
|
|
|
|
|
$buf = 'MThd' . pack('NnnCC',6,$format,$trackCount, -$frames, $ticks); |
|
984
|
|
|
|
|
|
|
} else { |
|
985
|
|
|
|
|
|
|
$buf = 'MThd' . pack('Nnnn',6,$format,$trackCount, $ticks); |
|
986
|
|
|
|
|
|
|
} |
|
987
|
|
|
|
|
|
|
syswrite MIDI,$buf,14; |
|
988
|
|
|
|
|
|
|
|
|
989
|
|
|
|
|
|
|
my @tracks = $Model->getElementsByTagName('Track'); |
|
990
|
|
|
|
|
|
|
foreach my $track (@tracks) { |
|
991
|
|
|
|
|
|
|
my $tbuf=''; |
|
992
|
|
|
|
|
|
|
my @events = $track->getElementsByTagName('Event'); |
|
993
|
|
|
|
|
|
|
my $time = 0; |
|
994
|
|
|
|
|
|
|
my $abs = 0; |
|
995
|
|
|
|
|
|
|
my $rstatus = 0; |
|
996
|
|
|
|
|
|
|
foreach my $event (@events) { |
|
997
|
|
|
|
|
|
|
my $timestamp = $event->Timestamp; |
|
998
|
|
|
|
|
|
|
my $value = $timestamp->value(); |
|
999
|
|
|
|
|
|
|
my $tsclass = ref($timestamp); |
|
1000
|
|
|
|
|
|
|
if ($tsclass eq 'MIDI::XML::Delta') { |
|
1001
|
|
|
|
|
|
|
$abs += $value; |
|
1002
|
|
|
|
|
|
|
} elsif ($tsclass eq 'MIDI::XML::Absolute') { |
|
1003
|
|
|
|
|
|
|
$abs = $value; |
|
1004
|
|
|
|
|
|
|
} else { |
|
1005
|
|
|
|
|
|
|
carp "Invalid timestamp class: $tsclass"; |
|
1006
|
|
|
|
|
|
|
} |
|
1007
|
|
|
|
|
|
|
my $delta = $abs - $time; |
|
1008
|
|
|
|
|
|
|
my @d = var_len_int($delta); |
|
1009
|
|
|
|
|
|
|
$time = $abs; |
|
1010
|
|
|
|
|
|
|
map {$tbuf .= pack('C',$_);} @d; |
|
1011
|
|
|
|
|
|
|
my $smfEvent = $event->SmfEvent(); |
|
1012
|
|
|
|
|
|
|
my @m = $smfEvent->_bytes(); |
|
1013
|
|
|
|
|
|
|
my $status = $m[0]; |
|
1014
|
|
|
|
|
|
|
if ($status >= 0xF0) { |
|
1015
|
|
|
|
|
|
|
$rstatus = 0; |
|
1016
|
|
|
|
|
|
|
} |
|
1017
|
|
|
|
|
|
|
elsif ($rstatus == $status) { |
|
1018
|
|
|
|
|
|
|
shift @m; |
|
1019
|
|
|
|
|
|
|
} else { |
|
1020
|
|
|
|
|
|
|
$rstatus = $status; |
|
1021
|
|
|
|
|
|
|
} |
|
1022
|
|
|
|
|
|
|
map {$tbuf .= pack('C',$_);} @m; |
|
1023
|
|
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
} |
|
1025
|
|
|
|
|
|
|
my $tblen = length($tbuf); |
|
1026
|
|
|
|
|
|
|
$buf = 'MTrk' . pack('N',$tblen); |
|
1027
|
|
|
|
|
|
|
syswrite MIDI,$buf,8; |
|
1028
|
|
|
|
|
|
|
syswrite MIDI,$tbuf,$tblen; |
|
1029
|
|
|
|
|
|
|
} |
|
1030
|
|
|
|
|
|
|
|
|
1031
|
|
|
|
|
|
|
close MIDI; |
|
1032
|
|
|
|
|
|
|
} |
|
1033
|
|
|
|
|
|
|
|
|
1034
|
|
|
|
|
|
|
#=============================================================================== |
|
1035
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1036
|
|
|
|
|
|
|
# UML Model UUID: |
|
1037
|
|
|
|
|
|
|
|
|
1038
|
|
|
|
|
|
|
package MIDI::XML::Element; |
|
1039
|
|
|
|
|
|
|
|
|
1040
|
|
|
|
|
|
|
our @ISA = qw(XML::DOM::Element); |
|
1041
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1042
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1043
|
|
|
|
|
|
|
|
|
1044
|
|
|
|
|
|
|
BEGIN |
|
1045
|
|
|
|
|
|
|
{ |
|
1046
|
|
|
|
|
|
|
import XML::DOM::Node qw( :Fields ); |
|
1047
|
|
|
|
|
|
|
} |
|
1048
|
|
|
|
|
|
|
|
|
1049
|
|
|
|
|
|
|
sub xmi_id() { |
|
1050
|
|
|
|
|
|
|
my $self = shift; |
|
1051
|
|
|
|
|
|
|
if (@_) { |
|
1052
|
|
|
|
|
|
|
$self->setAttribute('xmi.id', lc shift); |
|
1053
|
|
|
|
|
|
|
} |
|
1054
|
|
|
|
|
|
|
return $self->getAttribute('xmi.id'); |
|
1055
|
|
|
|
|
|
|
} |
|
1056
|
|
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
|
sub xmi_idref() { |
|
1058
|
|
|
|
|
|
|
my $self = shift; |
|
1059
|
|
|
|
|
|
|
if (@_) { |
|
1060
|
|
|
|
|
|
|
$self->setAttribute('xmi.idref', lc shift); |
|
1061
|
|
|
|
|
|
|
} |
|
1062
|
|
|
|
|
|
|
return $self->getAttribute('xmi.idref'); |
|
1063
|
|
|
|
|
|
|
} |
|
1064
|
|
|
|
|
|
|
|
|
1065
|
|
|
|
|
|
|
sub get_collection() { |
|
1066
|
|
|
|
|
|
|
my $self = shift; |
|
1067
|
|
|
|
|
|
|
my $name = shift; |
|
1068
|
|
|
|
|
|
|
my $qname = shift; |
|
1069
|
|
|
|
|
|
|
|
|
1070
|
|
|
|
|
|
|
$self->[_UserData] = {} unless (defined($self->[_UserData])); |
|
1071
|
|
|
|
|
|
|
$self->[_UserData]{'_collections'} = {} unless (exists($self->[_UserData]{'_collections'})); |
|
1072
|
|
|
|
|
|
|
unless(exists($self->[_UserData]{'_collections'}{$name})) { |
|
1073
|
|
|
|
|
|
|
my $elem = $self->getOwnerDocument->createElement($qname); |
|
1074
|
|
|
|
|
|
|
$self->appendChild($elem); |
|
1075
|
|
|
|
|
|
|
$self->[_UserData]{'_collections'}{$name} = $elem; |
|
1076
|
|
|
|
|
|
|
} |
|
1077
|
|
|
|
|
|
|
return $self->[_UserData]{'_collections'}{$name}; |
|
1078
|
|
|
|
|
|
|
} |
|
1079
|
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
sub attribute_as_element() { |
|
1081
|
|
|
|
|
|
|
my $self = shift; |
|
1082
|
|
|
|
|
|
|
my $name = shift; |
|
1083
|
|
|
|
|
|
|
my $element = shift; |
|
1084
|
|
|
|
|
|
|
|
|
1085
|
|
|
|
|
|
|
$self->[_UserData] = {} unless (defined($self->[_UserData])); |
|
1086
|
|
|
|
|
|
|
$self->[_UserData]{'_elements'} = {} unless (exists($self->[_UserData]{'_elements'})); |
|
1087
|
|
|
|
|
|
|
if(defined($element)) { |
|
1088
|
|
|
|
|
|
|
if(exists($self->[_UserData]{'_elements'}{$name})) { |
|
1089
|
|
|
|
|
|
|
$self->replaceChild($element,$self->[_UserData]{'_elements'}{$name}); |
|
1090
|
|
|
|
|
|
|
} else { |
|
1091
|
|
|
|
|
|
|
$self->appendChild($element); |
|
1092
|
|
|
|
|
|
|
} |
|
1093
|
|
|
|
|
|
|
$self->[_UserData]{'_elements'}{$name} = $element; |
|
1094
|
|
|
|
|
|
|
} |
|
1095
|
|
|
|
|
|
|
unless(exists($self->[_UserData]{'_elements'}{$name})) { |
|
1096
|
|
|
|
|
|
|
return undef; |
|
1097
|
|
|
|
|
|
|
} |
|
1098
|
|
|
|
|
|
|
return $self->[_UserData]{'_elements'}{$name}; |
|
1099
|
|
|
|
|
|
|
} |
|
1100
|
|
|
|
|
|
|
|
|
1101
|
|
|
|
|
|
|
#=============================================================================== |
|
1102
|
|
|
|
|
|
|
# MIDI::XML::Element::text |
|
1103
|
|
|
|
|
|
|
|
|
1104
|
|
|
|
|
|
|
=head2 $value = $Object->text([$new_value]); |
|
1105
|
|
|
|
|
|
|
|
|
1106
|
|
|
|
|
|
|
Set or get element text content. |
|
1107
|
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
=cut |
|
1109
|
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
sub text() { |
|
1111
|
|
|
|
|
|
|
my $self = shift; |
|
1112
|
|
|
|
|
|
|
|
|
1113
|
|
|
|
|
|
|
if (@_) { |
|
1114
|
|
|
|
|
|
|
while($self->hasChildNodes()) { |
|
1115
|
|
|
|
|
|
|
$self->removeChild($self->getLastChild()); |
|
1116
|
|
|
|
|
|
|
} |
|
1117
|
|
|
|
|
|
|
$self->appendChild($self->getOwnerDocument->createTextNode($_[0])); |
|
1118
|
|
|
|
|
|
|
} else { |
|
1119
|
|
|
|
|
|
|
$self->normalize(); |
|
1120
|
|
|
|
|
|
|
} |
|
1121
|
|
|
|
|
|
|
return $self->getFirstChild->getNodeValue(); |
|
1122
|
|
|
|
|
|
|
} |
|
1123
|
|
|
|
|
|
|
|
|
1124
|
|
|
|
|
|
|
#=============================================================================== |
|
1125
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1126
|
|
|
|
|
|
|
# UML Model UUID: a4772d55-45af-11dd-8bf4-00502c05c241 |
|
1127
|
|
|
|
|
|
|
|
|
1128
|
|
|
|
|
|
|
package MIDI::XML::MetaEvent; |
|
1129
|
|
|
|
|
|
|
|
|
1130
|
|
|
|
|
|
|
use Carp; |
|
1131
|
|
|
|
|
|
|
|
|
1132
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::SmfEvent); |
|
1133
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1134
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1135
|
|
|
|
|
|
|
|
|
1136
|
|
|
|
|
|
|
=head1 DESCRIPTION of MetaEvent |
|
1137
|
|
|
|
|
|
|
|
|
1138
|
|
|
|
|
|
|
MIDI::XML::MetaEvent is used for representing MetaEvent objects |
|
1139
|
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
=cut |
|
1141
|
|
|
|
|
|
|
|
|
1142
|
|
|
|
|
|
|
#=============================================================================== |
|
1143
|
|
|
|
|
|
|
|
|
1144
|
|
|
|
|
|
|
#{ |
|
1145
|
|
|
|
|
|
|
# no strict "refs"; |
|
1146
|
|
|
|
|
|
|
# *TAG_NAME = sub { return 'meta-event'; }; |
|
1147
|
|
|
|
|
|
|
#} |
|
1148
|
|
|
|
|
|
|
|
|
1149
|
|
|
|
|
|
|
##END_PACKAGE MetaEvent |
|
1150
|
|
|
|
|
|
|
|
|
1151
|
|
|
|
|
|
|
#=============================================================================== |
|
1152
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1153
|
|
|
|
|
|
|
# UML Model UUID: 1515de42-45d8-11dd-8bf4-00502c05c241 |
|
1154
|
|
|
|
|
|
|
|
|
1155
|
|
|
|
|
|
|
package MIDI::XML::CopyrightNotice; |
|
1156
|
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
use Carp; |
|
1158
|
|
|
|
|
|
|
|
|
1159
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1160
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1161
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1162
|
|
|
|
|
|
|
|
|
1163
|
|
|
|
|
|
|
=head1 DESCRIPTION of CopyrightNotice |
|
1164
|
|
|
|
|
|
|
|
|
1165
|
|
|
|
|
|
|
MIDI::XML::CopyrightNotice is used for representing CopyrightNotice objects |
|
1166
|
|
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
|
=cut |
|
1168
|
|
|
|
|
|
|
|
|
1169
|
|
|
|
|
|
|
#=============================================================================== |
|
1170
|
|
|
|
|
|
|
|
|
1171
|
|
|
|
|
|
|
{ |
|
1172
|
|
|
|
|
|
|
no strict "refs"; |
|
1173
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'CopyrightNotice'; }; |
|
1174
|
|
|
|
|
|
|
} |
|
1175
|
|
|
|
|
|
|
|
|
1176
|
|
|
|
|
|
|
#=============================================================================== |
|
1177
|
|
|
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
sub _bytes { |
|
1179
|
|
|
|
|
|
|
my $self = shift; |
|
1180
|
|
|
|
|
|
|
|
|
1181
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1182
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x02, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
1183
|
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
if(wantarray()) { |
|
1185
|
|
|
|
|
|
|
return @bytes; |
|
1186
|
|
|
|
|
|
|
} |
|
1187
|
|
|
|
|
|
|
|
|
1188
|
|
|
|
|
|
|
return \@bytes; |
|
1189
|
|
|
|
|
|
|
} |
|
1190
|
|
|
|
|
|
|
|
|
1191
|
|
|
|
|
|
|
##END_PACKAGE CopyrightNotice |
|
1192
|
|
|
|
|
|
|
|
|
1193
|
|
|
|
|
|
|
#=============================================================================== |
|
1194
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1195
|
|
|
|
|
|
|
# UML Model UUID: 333a3ce5-45d8-11dd-8bf4-00502c05c241 |
|
1196
|
|
|
|
|
|
|
|
|
1197
|
|
|
|
|
|
|
package MIDI::XML::CuePoint; |
|
1198
|
|
|
|
|
|
|
|
|
1199
|
|
|
|
|
|
|
use Carp; |
|
1200
|
|
|
|
|
|
|
|
|
1201
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1202
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1203
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1204
|
|
|
|
|
|
|
|
|
1205
|
|
|
|
|
|
|
=head1 DESCRIPTION of CuePoint |
|
1206
|
|
|
|
|
|
|
|
|
1207
|
|
|
|
|
|
|
MIDI::XML::CuePoint is used for representing CuePoint objects |
|
1208
|
|
|
|
|
|
|
|
|
1209
|
|
|
|
|
|
|
=cut |
|
1210
|
|
|
|
|
|
|
|
|
1211
|
|
|
|
|
|
|
#=============================================================================== |
|
1212
|
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
{ |
|
1214
|
|
|
|
|
|
|
no strict "refs"; |
|
1215
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'CuePoint'; }; |
|
1216
|
|
|
|
|
|
|
} |
|
1217
|
|
|
|
|
|
|
|
|
1218
|
|
|
|
|
|
|
#=============================================================================== |
|
1219
|
|
|
|
|
|
|
|
|
1220
|
|
|
|
|
|
|
sub _bytes { |
|
1221
|
|
|
|
|
|
|
my $self = shift; |
|
1222
|
|
|
|
|
|
|
|
|
1223
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1224
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x07, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
1225
|
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
if(wantarray()) { |
|
1227
|
|
|
|
|
|
|
return @bytes; |
|
1228
|
|
|
|
|
|
|
} |
|
1229
|
|
|
|
|
|
|
|
|
1230
|
|
|
|
|
|
|
return \@bytes; |
|
1231
|
|
|
|
|
|
|
} |
|
1232
|
|
|
|
|
|
|
|
|
1233
|
|
|
|
|
|
|
##END_PACKAGE CuePoint |
|
1234
|
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
#=============================================================================== |
|
1236
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1237
|
|
|
|
|
|
|
# UML Model UUID: 47070e18-45d8-11dd-8bf4-00502c05c241 |
|
1238
|
|
|
|
|
|
|
|
|
1239
|
|
|
|
|
|
|
package MIDI::XML::DeviceName; |
|
1240
|
|
|
|
|
|
|
|
|
1241
|
|
|
|
|
|
|
use Carp; |
|
1242
|
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1244
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1245
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1246
|
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
=head1 DESCRIPTION of DeviceName |
|
1248
|
|
|
|
|
|
|
|
|
1249
|
|
|
|
|
|
|
MIDI::XML::DeviceName is used for representing DeviceName objects. |
|
1250
|
|
|
|
|
|
|
|
|
1251
|
|
|
|
|
|
|
FF 09 len text DEVICE NAME |
|
1252
|
|
|
|
|
|
|
|
|
1253
|
|
|
|
|
|
|
The Device Name is the name of the device that this track is intended to address. |
|
1254
|
|
|
|
|
|
|
It will often be the model name of a synthesizer, but can be any string which |
|
1255
|
|
|
|
|
|
|
uniquely identifies a particular device in a given setup. There should only be |
|
1256
|
|
|
|
|
|
|
one Device Name (Meta Event 09) per track, and it should appear at the beginning |
|
1257
|
|
|
|
|
|
|
of a track before any events which are sendable (i.e., it should be grouped with |
|
1258
|
|
|
|
|
|
|
the text events before the proposed Program Name [Meta Event 08 - see below] and |
|
1259
|
|
|
|
|
|
|
before bank select and program change messages). This will ensure that each track |
|
1260
|
|
|
|
|
|
|
can only address one device. |
|
1261
|
|
|
|
|
|
|
|
|
1262
|
|
|
|
|
|
|
Each track of a MIDI File can contain one MIDI stream, including SysEx and up to |
|
1263
|
|
|
|
|
|
|
16 channels. The Device Name Meta Event is used to label each track in a MIDI |
|
1264
|
|
|
|
|
|
|
File with a text label. |
|
1265
|
|
|
|
|
|
|
|
|
1266
|
|
|
|
|
|
|
If a Type 1 Standard MIDI File contains MIDI data for several devices, the data |
|
1267
|
|
|
|
|
|
|
for each device is contained in a separate track, each with a different Device |
|
1268
|
|
|
|
|
|
|
Name Meta Event. It is possible to have any number of tracks which address the |
|
1269
|
|
|
|
|
|
|
same Device Name; however, each track can only address one device, as noted above. |
|
1270
|
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
Since a Type 0 Standard MIDI File has only one track, it can have only one |
|
1272
|
|
|
|
|
|
|
Device Name Meta Event. |
|
1273
|
|
|
|
|
|
|
|
|
1274
|
|
|
|
|
|
|
|
|
1275
|
|
|
|
|
|
|
=cut |
|
1276
|
|
|
|
|
|
|
|
|
1277
|
|
|
|
|
|
|
#=============================================================================== |
|
1278
|
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
{ |
|
1280
|
|
|
|
|
|
|
no strict "refs"; |
|
1281
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'DeviceName'; }; |
|
1282
|
|
|
|
|
|
|
} |
|
1283
|
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
#=============================================================================== |
|
1285
|
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
sub _bytes { |
|
1287
|
|
|
|
|
|
|
my $self = shift; |
|
1288
|
|
|
|
|
|
|
|
|
1289
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1290
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x09, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
1291
|
|
|
|
|
|
|
|
|
1292
|
|
|
|
|
|
|
if(wantarray()) { |
|
1293
|
|
|
|
|
|
|
return @bytes; |
|
1294
|
|
|
|
|
|
|
} |
|
1295
|
|
|
|
|
|
|
|
|
1296
|
|
|
|
|
|
|
return \@bytes; |
|
1297
|
|
|
|
|
|
|
} |
|
1298
|
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
##END_PACKAGE DeviceName |
|
1300
|
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
#=============================================================================== |
|
1302
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1303
|
|
|
|
|
|
|
# UML Model UUID: 53cdc6cb-45d8-11dd-8bf4-00502c05c241 |
|
1304
|
|
|
|
|
|
|
|
|
1305
|
|
|
|
|
|
|
package MIDI::XML::EndOfTrack; |
|
1306
|
|
|
|
|
|
|
|
|
1307
|
|
|
|
|
|
|
use Carp; |
|
1308
|
|
|
|
|
|
|
|
|
1309
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1310
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1311
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1312
|
|
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
|
=head1 DESCRIPTION of EndOfTrack |
|
1314
|
|
|
|
|
|
|
|
|
1315
|
|
|
|
|
|
|
MIDI::XML::EndOfTrack is used for representing EndOfTrack objects |
|
1316
|
|
|
|
|
|
|
|
|
1317
|
|
|
|
|
|
|
=cut |
|
1318
|
|
|
|
|
|
|
|
|
1319
|
|
|
|
|
|
|
#=============================================================================== |
|
1320
|
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
{ |
|
1322
|
|
|
|
|
|
|
no strict "refs"; |
|
1323
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'EndOfTrack'; }; |
|
1324
|
|
|
|
|
|
|
} |
|
1325
|
|
|
|
|
|
|
|
|
1326
|
|
|
|
|
|
|
#=============================================================================== |
|
1327
|
|
|
|
|
|
|
|
|
1328
|
|
|
|
|
|
|
sub _bytes { |
|
1329
|
|
|
|
|
|
|
my $self = shift; |
|
1330
|
|
|
|
|
|
|
|
|
1331
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x2F, 0x00); |
|
1332
|
|
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
|
if(wantarray()) { |
|
1334
|
|
|
|
|
|
|
return @bytes; |
|
1335
|
|
|
|
|
|
|
} |
|
1336
|
|
|
|
|
|
|
return \@bytes; |
|
1337
|
|
|
|
|
|
|
} |
|
1338
|
|
|
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
##END_PACKAGE EndOfTrack |
|
1340
|
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
#=============================================================================== |
|
1342
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1343
|
|
|
|
|
|
|
# UML Model UUID: 6a099c2e-45d8-11dd-8bf4-00502c05c241 |
|
1344
|
|
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
|
package MIDI::XML::InstrumentName; |
|
1346
|
|
|
|
|
|
|
|
|
1347
|
|
|
|
|
|
|
use Carp; |
|
1348
|
|
|
|
|
|
|
|
|
1349
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1350
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1351
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1352
|
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
=head1 DESCRIPTION of InstrumentName |
|
1354
|
|
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
|
MIDI::XML::InstrumentName is used for representing InstrumentName objects |
|
1356
|
|
|
|
|
|
|
|
|
1357
|
|
|
|
|
|
|
=cut |
|
1358
|
|
|
|
|
|
|
|
|
1359
|
|
|
|
|
|
|
#=============================================================================== |
|
1360
|
|
|
|
|
|
|
|
|
1361
|
|
|
|
|
|
|
{ |
|
1362
|
|
|
|
|
|
|
no strict "refs"; |
|
1363
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'InstrumentName'; }; |
|
1364
|
|
|
|
|
|
|
} |
|
1365
|
|
|
|
|
|
|
|
|
1366
|
|
|
|
|
|
|
#=============================================================================== |
|
1367
|
|
|
|
|
|
|
|
|
1368
|
|
|
|
|
|
|
sub _bytes { |
|
1369
|
|
|
|
|
|
|
my $self = shift; |
|
1370
|
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1372
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x04, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
1373
|
|
|
|
|
|
|
|
|
1374
|
|
|
|
|
|
|
if(wantarray()) { |
|
1375
|
|
|
|
|
|
|
return @bytes; |
|
1376
|
|
|
|
|
|
|
} |
|
1377
|
|
|
|
|
|
|
|
|
1378
|
|
|
|
|
|
|
return \@bytes; |
|
1379
|
|
|
|
|
|
|
} |
|
1380
|
|
|
|
|
|
|
|
|
1381
|
|
|
|
|
|
|
##END_PACKAGE InstrumentName |
|
1382
|
|
|
|
|
|
|
|
|
1383
|
|
|
|
|
|
|
#=============================================================================== |
|
1384
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1385
|
|
|
|
|
|
|
# UML Model UUID: 8426f181-45d8-11dd-8bf4-00502c05c241 |
|
1386
|
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
package MIDI::XML::KeySignature; |
|
1388
|
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
use Carp; |
|
1390
|
|
|
|
|
|
|
|
|
1391
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1392
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1393
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1394
|
|
|
|
|
|
|
|
|
1395
|
|
|
|
|
|
|
=head1 DESCRIPTION of KeySignature |
|
1396
|
|
|
|
|
|
|
|
|
1397
|
|
|
|
|
|
|
MIDI::XML::KeySignature is used for representing KeySignature objects |
|
1398
|
|
|
|
|
|
|
|
|
1399
|
|
|
|
|
|
|
=cut |
|
1400
|
|
|
|
|
|
|
|
|
1401
|
|
|
|
|
|
|
#=============================================================================== |
|
1402
|
|
|
|
|
|
|
|
|
1403
|
|
|
|
|
|
|
{ |
|
1404
|
|
|
|
|
|
|
no strict "refs"; |
|
1405
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'KeySignature'; }; |
|
1406
|
|
|
|
|
|
|
} |
|
1407
|
|
|
|
|
|
|
|
|
1408
|
|
|
|
|
|
|
#=============================================================================== |
|
1409
|
|
|
|
|
|
|
# MIDI::XML::KeySignature::Fifths |
|
1410
|
|
|
|
|
|
|
|
|
1411
|
|
|
|
|
|
|
=head2 $value = $Object->Fifths([$new_value]); |
|
1412
|
|
|
|
|
|
|
|
|
1413
|
|
|
|
|
|
|
Set or get value of the Fifths attribute. |
|
1414
|
|
|
|
|
|
|
|
|
1415
|
|
|
|
|
|
|
|
|
1416
|
|
|
|
|
|
|
Type: int |
|
1417
|
|
|
|
|
|
|
Lower: 1 |
|
1418
|
|
|
|
|
|
|
Upper: 1 |
|
1419
|
|
|
|
|
|
|
|
|
1420
|
|
|
|
|
|
|
=cut |
|
1421
|
|
|
|
|
|
|
|
|
1422
|
|
|
|
|
|
|
sub Fifths() { |
|
1423
|
|
|
|
|
|
|
my $self = shift; |
|
1424
|
|
|
|
|
|
|
if (@_) { |
|
1425
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
1426
|
|
|
|
|
|
|
$self->setAttribute('Fifths', shift); |
|
1427
|
|
|
|
|
|
|
} else { |
|
1428
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Fifths\''; |
|
1429
|
|
|
|
|
|
|
} |
|
1430
|
|
|
|
|
|
|
} |
|
1431
|
|
|
|
|
|
|
return $self->getAttribute('Fifths'); |
|
1432
|
|
|
|
|
|
|
} |
|
1433
|
|
|
|
|
|
|
|
|
1434
|
|
|
|
|
|
|
#=============================================================================== |
|
1435
|
|
|
|
|
|
|
# MIDI::XML::KeySignature::Mode |
|
1436
|
|
|
|
|
|
|
|
|
1437
|
|
|
|
|
|
|
=head2 $value = $Object->Mode([$new_value]); |
|
1438
|
|
|
|
|
|
|
|
|
1439
|
|
|
|
|
|
|
Set or get value of the Mode attribute. |
|
1440
|
|
|
|
|
|
|
|
|
1441
|
|
|
|
|
|
|
|
|
1442
|
|
|
|
|
|
|
Type: int |
|
1443
|
|
|
|
|
|
|
Lower: 1 |
|
1444
|
|
|
|
|
|
|
Upper: 1 |
|
1445
|
|
|
|
|
|
|
|
|
1446
|
|
|
|
|
|
|
=cut |
|
1447
|
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
sub Mode() { |
|
1449
|
|
|
|
|
|
|
my $self = shift; |
|
1450
|
|
|
|
|
|
|
if (@_) { |
|
1451
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
1452
|
|
|
|
|
|
|
$self->setAttribute('Mode', shift); |
|
1453
|
|
|
|
|
|
|
} else { |
|
1454
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Mode\''; |
|
1455
|
|
|
|
|
|
|
} |
|
1456
|
|
|
|
|
|
|
} |
|
1457
|
|
|
|
|
|
|
return $self->getAttribute('Mode'); |
|
1458
|
|
|
|
|
|
|
} |
|
1459
|
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
#=============================================================================== |
|
1461
|
|
|
|
|
|
|
|
|
1462
|
|
|
|
|
|
|
sub _bytes { |
|
1463
|
|
|
|
|
|
|
my $self = shift; |
|
1464
|
|
|
|
|
|
|
|
|
1465
|
|
|
|
|
|
|
my $fifths = $self->Fifths(); |
|
1466
|
|
|
|
|
|
|
my $mode = $self->Mode(); |
|
1467
|
|
|
|
|
|
|
$fifths += 256 if ($fifths<0); |
|
1468
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x59, 0x02, $fifths, $mode); |
|
1469
|
|
|
|
|
|
|
|
|
1470
|
|
|
|
|
|
|
if(wantarray()) { |
|
1471
|
|
|
|
|
|
|
return @bytes; |
|
1472
|
|
|
|
|
|
|
} |
|
1473
|
|
|
|
|
|
|
|
|
1474
|
|
|
|
|
|
|
return \@bytes; |
|
1475
|
|
|
|
|
|
|
} |
|
1476
|
|
|
|
|
|
|
|
|
1477
|
|
|
|
|
|
|
##END_PACKAGE KeySignature |
|
1478
|
|
|
|
|
|
|
|
|
1479
|
|
|
|
|
|
|
#=============================================================================== |
|
1480
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1481
|
|
|
|
|
|
|
# UML Model UUID: a2fd13f4-45d8-11dd-8bf4-00502c05c241 |
|
1482
|
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
package MIDI::XML::Lyric; |
|
1484
|
|
|
|
|
|
|
|
|
1485
|
|
|
|
|
|
|
use Carp; |
|
1486
|
|
|
|
|
|
|
|
|
1487
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1488
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1489
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1490
|
|
|
|
|
|
|
|
|
1491
|
|
|
|
|
|
|
=head1 DESCRIPTION of Lyric |
|
1492
|
|
|
|
|
|
|
|
|
1493
|
|
|
|
|
|
|
MIDI::XML::Lyric is used for representing Lyric objects |
|
1494
|
|
|
|
|
|
|
|
|
1495
|
|
|
|
|
|
|
=cut |
|
1496
|
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
#=============================================================================== |
|
1498
|
|
|
|
|
|
|
|
|
1499
|
|
|
|
|
|
|
{ |
|
1500
|
|
|
|
|
|
|
no strict "refs"; |
|
1501
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Lyric'; }; |
|
1502
|
|
|
|
|
|
|
} |
|
1503
|
|
|
|
|
|
|
|
|
1504
|
|
|
|
|
|
|
#=============================================================================== |
|
1505
|
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
sub _bytes { |
|
1507
|
|
|
|
|
|
|
my $self = shift; |
|
1508
|
|
|
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1510
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x05, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
1511
|
|
|
|
|
|
|
|
|
1512
|
|
|
|
|
|
|
if(wantarray()) { |
|
1513
|
|
|
|
|
|
|
return @bytes; |
|
1514
|
|
|
|
|
|
|
} |
|
1515
|
|
|
|
|
|
|
|
|
1516
|
|
|
|
|
|
|
return \@bytes; |
|
1517
|
|
|
|
|
|
|
} |
|
1518
|
|
|
|
|
|
|
|
|
1519
|
|
|
|
|
|
|
##END_PACKAGE Lyric |
|
1520
|
|
|
|
|
|
|
|
|
1521
|
|
|
|
|
|
|
#=============================================================================== |
|
1522
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1523
|
|
|
|
|
|
|
# UML Model UUID: dfb6e287-45d8-11dd-8bf4-00502c05c241 |
|
1524
|
|
|
|
|
|
|
|
|
1525
|
|
|
|
|
|
|
package MIDI::XML::Marker; |
|
1526
|
|
|
|
|
|
|
|
|
1527
|
|
|
|
|
|
|
use Carp; |
|
1528
|
|
|
|
|
|
|
|
|
1529
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1530
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1531
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1532
|
|
|
|
|
|
|
|
|
1533
|
|
|
|
|
|
|
=head1 DESCRIPTION of Marker |
|
1534
|
|
|
|
|
|
|
|
|
1535
|
|
|
|
|
|
|
MIDI::XML::Marker is used for representing Marker objects |
|
1536
|
|
|
|
|
|
|
|
|
1537
|
|
|
|
|
|
|
=cut |
|
1538
|
|
|
|
|
|
|
|
|
1539
|
|
|
|
|
|
|
#=============================================================================== |
|
1540
|
|
|
|
|
|
|
|
|
1541
|
|
|
|
|
|
|
{ |
|
1542
|
|
|
|
|
|
|
no strict "refs"; |
|
1543
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Marker'; }; |
|
1544
|
|
|
|
|
|
|
} |
|
1545
|
|
|
|
|
|
|
|
|
1546
|
|
|
|
|
|
|
#=============================================================================== |
|
1547
|
|
|
|
|
|
|
|
|
1548
|
|
|
|
|
|
|
sub _bytes { |
|
1549
|
|
|
|
|
|
|
my $self = shift; |
|
1550
|
|
|
|
|
|
|
|
|
1551
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1552
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x06, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
1553
|
|
|
|
|
|
|
|
|
1554
|
|
|
|
|
|
|
if(wantarray()) { |
|
1555
|
|
|
|
|
|
|
return @bytes; |
|
1556
|
|
|
|
|
|
|
} |
|
1557
|
|
|
|
|
|
|
|
|
1558
|
|
|
|
|
|
|
return \@bytes; |
|
1559
|
|
|
|
|
|
|
} |
|
1560
|
|
|
|
|
|
|
|
|
1561
|
|
|
|
|
|
|
##END_PACKAGE Marker |
|
1562
|
|
|
|
|
|
|
|
|
1563
|
|
|
|
|
|
|
#=============================================================================== |
|
1564
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1565
|
|
|
|
|
|
|
# UML Model UUID: ef6d1a0a-45d8-11dd-8bf4-00502c05c241 |
|
1566
|
|
|
|
|
|
|
|
|
1567
|
|
|
|
|
|
|
package MIDI::XML::MIDIChannelPrefix; |
|
1568
|
|
|
|
|
|
|
|
|
1569
|
|
|
|
|
|
|
use Carp; |
|
1570
|
|
|
|
|
|
|
|
|
1571
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1572
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1573
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1574
|
|
|
|
|
|
|
|
|
1575
|
|
|
|
|
|
|
=head1 DESCRIPTION of MIDIChannelPrefix |
|
1576
|
|
|
|
|
|
|
|
|
1577
|
|
|
|
|
|
|
MIDI::XML::MIDIChannelPrefix is used for representing MIDIChannelPrefix objects |
|
1578
|
|
|
|
|
|
|
|
|
1579
|
|
|
|
|
|
|
=cut |
|
1580
|
|
|
|
|
|
|
|
|
1581
|
|
|
|
|
|
|
#=============================================================================== |
|
1582
|
|
|
|
|
|
|
|
|
1583
|
|
|
|
|
|
|
{ |
|
1584
|
|
|
|
|
|
|
no strict "refs"; |
|
1585
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'MIDIChannelPrefix'; }; |
|
1586
|
|
|
|
|
|
|
} |
|
1587
|
|
|
|
|
|
|
|
|
1588
|
|
|
|
|
|
|
#=============================================================================== |
|
1589
|
|
|
|
|
|
|
# MIDI::XML::MIDIChannelPrefix::Value |
|
1590
|
|
|
|
|
|
|
|
|
1591
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
1592
|
|
|
|
|
|
|
|
|
1593
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
1594
|
|
|
|
|
|
|
|
|
1595
|
|
|
|
|
|
|
|
|
1596
|
|
|
|
|
|
|
Type: int |
|
1597
|
|
|
|
|
|
|
Lower: 1 |
|
1598
|
|
|
|
|
|
|
Upper: 1 |
|
1599
|
|
|
|
|
|
|
|
|
1600
|
|
|
|
|
|
|
=cut |
|
1601
|
|
|
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
sub Value() { |
|
1603
|
|
|
|
|
|
|
my $self = shift; |
|
1604
|
|
|
|
|
|
|
if (@_) { |
|
1605
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
1606
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
1607
|
|
|
|
|
|
|
} else { |
|
1608
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
1609
|
|
|
|
|
|
|
} |
|
1610
|
|
|
|
|
|
|
} |
|
1611
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
1612
|
|
|
|
|
|
|
} |
|
1613
|
|
|
|
|
|
|
|
|
1614
|
|
|
|
|
|
|
#=============================================================================== |
|
1615
|
|
|
|
|
|
|
|
|
1616
|
|
|
|
|
|
|
sub _bytes { |
|
1617
|
|
|
|
|
|
|
my $self = shift; |
|
1618
|
|
|
|
|
|
|
|
|
1619
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x20, $self->Value()); |
|
1620
|
|
|
|
|
|
|
|
|
1621
|
|
|
|
|
|
|
if(wantarray()) { |
|
1622
|
|
|
|
|
|
|
return @bytes; |
|
1623
|
|
|
|
|
|
|
} |
|
1624
|
|
|
|
|
|
|
|
|
1625
|
|
|
|
|
|
|
return \@bytes; |
|
1626
|
|
|
|
|
|
|
} |
|
1627
|
|
|
|
|
|
|
|
|
1628
|
|
|
|
|
|
|
##END_PACKAGE MIDIChannelPrefix |
|
1629
|
|
|
|
|
|
|
|
|
1630
|
|
|
|
|
|
|
#=============================================================================== |
|
1631
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1632
|
|
|
|
|
|
|
# UML Model UUID: 0486dd9d-45d9-11dd-8bf4-00502c05c241 |
|
1633
|
|
|
|
|
|
|
|
|
1634
|
|
|
|
|
|
|
package MIDI::XML::OtherMetaEvent; |
|
1635
|
|
|
|
|
|
|
|
|
1636
|
|
|
|
|
|
|
use Carp; |
|
1637
|
|
|
|
|
|
|
|
|
1638
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1639
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1640
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1641
|
|
|
|
|
|
|
|
|
1642
|
|
|
|
|
|
|
=head1 DESCRIPTION of OtherMetaEvent |
|
1643
|
|
|
|
|
|
|
|
|
1644
|
|
|
|
|
|
|
MIDI::XML::OtherMetaEvent is used for representing OtherMetaEvent objects |
|
1645
|
|
|
|
|
|
|
|
|
1646
|
|
|
|
|
|
|
=cut |
|
1647
|
|
|
|
|
|
|
|
|
1648
|
|
|
|
|
|
|
#=============================================================================== |
|
1649
|
|
|
|
|
|
|
|
|
1650
|
|
|
|
|
|
|
{ |
|
1651
|
|
|
|
|
|
|
no strict "refs"; |
|
1652
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'OtherMetaEvent'; }; |
|
1653
|
|
|
|
|
|
|
} |
|
1654
|
|
|
|
|
|
|
|
|
1655
|
|
|
|
|
|
|
#=============================================================================== |
|
1656
|
|
|
|
|
|
|
# MIDI::XML::OtherMetaEvent::Number |
|
1657
|
|
|
|
|
|
|
|
|
1658
|
|
|
|
|
|
|
=head2 $value = $Object->Number([$new_value]); |
|
1659
|
|
|
|
|
|
|
|
|
1660
|
|
|
|
|
|
|
Set or get value of the Number attribute. |
|
1661
|
|
|
|
|
|
|
|
|
1662
|
|
|
|
|
|
|
|
|
1663
|
|
|
|
|
|
|
Type: int |
|
1664
|
|
|
|
|
|
|
Lower: 1 |
|
1665
|
|
|
|
|
|
|
Upper: 1 |
|
1666
|
|
|
|
|
|
|
|
|
1667
|
|
|
|
|
|
|
=cut |
|
1668
|
|
|
|
|
|
|
|
|
1669
|
|
|
|
|
|
|
sub Number() { |
|
1670
|
|
|
|
|
|
|
my $self = shift; |
|
1671
|
|
|
|
|
|
|
if (@_) { |
|
1672
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
1673
|
|
|
|
|
|
|
$self->setAttribute('Number', shift); |
|
1674
|
|
|
|
|
|
|
} else { |
|
1675
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Number\''; |
|
1676
|
|
|
|
|
|
|
} |
|
1677
|
|
|
|
|
|
|
} |
|
1678
|
|
|
|
|
|
|
return $self->getAttribute('Number'); |
|
1679
|
|
|
|
|
|
|
} |
|
1680
|
|
|
|
|
|
|
|
|
1681
|
|
|
|
|
|
|
#=============================================================================== |
|
1682
|
|
|
|
|
|
|
|
|
1683
|
|
|
|
|
|
|
sub _bytes { |
|
1684
|
|
|
|
|
|
|
my $self = shift; |
|
1685
|
|
|
|
|
|
|
|
|
1686
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1687
|
|
|
|
|
|
|
my @t = split(' ',$text); |
|
1688
|
|
|
|
|
|
|
|
|
1689
|
|
|
|
|
|
|
my @bytes = (0xFF, $self->Number()); |
|
1690
|
|
|
|
|
|
|
map {push @bytes,ord(pack('H2',"$_"));} @t; |
|
1691
|
|
|
|
|
|
|
|
|
1692
|
|
|
|
|
|
|
if(wantarray()) { |
|
1693
|
|
|
|
|
|
|
return @bytes; |
|
1694
|
|
|
|
|
|
|
} |
|
1695
|
|
|
|
|
|
|
|
|
1696
|
|
|
|
|
|
|
return \@bytes; |
|
1697
|
|
|
|
|
|
|
} |
|
1698
|
|
|
|
|
|
|
|
|
1699
|
|
|
|
|
|
|
##END_PACKAGE OtherMetaEvent |
|
1700
|
|
|
|
|
|
|
|
|
1701
|
|
|
|
|
|
|
#=============================================================================== |
|
1702
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1703
|
|
|
|
|
|
|
# UML Model UUID: 89f69070-45d9-11dd-8bf4-00502c05c241 |
|
1704
|
|
|
|
|
|
|
|
|
1705
|
|
|
|
|
|
|
package MIDI::XML::Port; |
|
1706
|
|
|
|
|
|
|
|
|
1707
|
|
|
|
|
|
|
use Carp; |
|
1708
|
|
|
|
|
|
|
|
|
1709
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1710
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1711
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1712
|
|
|
|
|
|
|
|
|
1713
|
|
|
|
|
|
|
=head1 DESCRIPTION of Port |
|
1714
|
|
|
|
|
|
|
|
|
1715
|
|
|
|
|
|
|
MIDI::XML::Port is used for representing Port objects |
|
1716
|
|
|
|
|
|
|
|
|
1717
|
|
|
|
|
|
|
=cut |
|
1718
|
|
|
|
|
|
|
|
|
1719
|
|
|
|
|
|
|
#=============================================================================== |
|
1720
|
|
|
|
|
|
|
|
|
1721
|
|
|
|
|
|
|
{ |
|
1722
|
|
|
|
|
|
|
no strict "refs"; |
|
1723
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Port'; }; |
|
1724
|
|
|
|
|
|
|
} |
|
1725
|
|
|
|
|
|
|
|
|
1726
|
|
|
|
|
|
|
#=============================================================================== |
|
1727
|
|
|
|
|
|
|
# MIDI::XML::Port::Value |
|
1728
|
|
|
|
|
|
|
|
|
1729
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
1730
|
|
|
|
|
|
|
|
|
1731
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
1732
|
|
|
|
|
|
|
|
|
1733
|
|
|
|
|
|
|
|
|
1734
|
|
|
|
|
|
|
Type: int |
|
1735
|
|
|
|
|
|
|
Lower: 1 |
|
1736
|
|
|
|
|
|
|
Upper: 1 |
|
1737
|
|
|
|
|
|
|
|
|
1738
|
|
|
|
|
|
|
=cut |
|
1739
|
|
|
|
|
|
|
|
|
1740
|
|
|
|
|
|
|
sub Value() { |
|
1741
|
|
|
|
|
|
|
my $self = shift; |
|
1742
|
|
|
|
|
|
|
if (@_) { |
|
1743
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
1744
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
1745
|
|
|
|
|
|
|
} else { |
|
1746
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
1747
|
|
|
|
|
|
|
} |
|
1748
|
|
|
|
|
|
|
} |
|
1749
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
1750
|
|
|
|
|
|
|
} |
|
1751
|
|
|
|
|
|
|
|
|
1752
|
|
|
|
|
|
|
#=============================================================================== |
|
1753
|
|
|
|
|
|
|
|
|
1754
|
|
|
|
|
|
|
sub _bytes { |
|
1755
|
|
|
|
|
|
|
my $self = shift; |
|
1756
|
|
|
|
|
|
|
|
|
1757
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x21, 1, $self->Value()); |
|
1758
|
|
|
|
|
|
|
|
|
1759
|
|
|
|
|
|
|
if(wantarray()) { |
|
1760
|
|
|
|
|
|
|
return @bytes; |
|
1761
|
|
|
|
|
|
|
} |
|
1762
|
|
|
|
|
|
|
|
|
1763
|
|
|
|
|
|
|
return \@bytes; |
|
1764
|
|
|
|
|
|
|
} |
|
1765
|
|
|
|
|
|
|
|
|
1766
|
|
|
|
|
|
|
##END_PACKAGE Port |
|
1767
|
|
|
|
|
|
|
|
|
1768
|
|
|
|
|
|
|
#=============================================================================== |
|
1769
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1770
|
|
|
|
|
|
|
# UML Model UUID: 98f278a3-45d9-11dd-8bf4-00502c05c241 |
|
1771
|
|
|
|
|
|
|
|
|
1772
|
|
|
|
|
|
|
package MIDI::XML::ProgramName; |
|
1773
|
|
|
|
|
|
|
|
|
1774
|
|
|
|
|
|
|
use Carp; |
|
1775
|
|
|
|
|
|
|
|
|
1776
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1777
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1778
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1779
|
|
|
|
|
|
|
|
|
1780
|
|
|
|
|
|
|
=head1 DESCRIPTION of ProgramName |
|
1781
|
|
|
|
|
|
|
|
|
1782
|
|
|
|
|
|
|
MIDI::XML::ProgramName is used for representing ProgramName objects |
|
1783
|
|
|
|
|
|
|
FF 08 len text PROGRAM NAME |
|
1784
|
|
|
|
|
|
|
|
|
1785
|
|
|
|
|
|
|
One purpose of this event is to aid in reorchestration; since one |
|
1786
|
|
|
|
|
|
|
non-General-MIDI device's piano can be another one's drum kit; knowing the |
|
1787
|
|
|
|
|
|
|
intended program name can be an important clue. |
|
1788
|
|
|
|
|
|
|
|
|
1789
|
|
|
|
|
|
|
The Program Name is the name of the program called up by the immediately |
|
1790
|
|
|
|
|
|
|
following sequence of bank select and program change messages. The channel for |
|
1791
|
|
|
|
|
|
|
the program change is identified by the bank select and program change messages. |
|
1792
|
|
|
|
|
|
|
The Program Name Meta Event may appear anywhere in a track, but should only be |
|
1793
|
|
|
|
|
|
|
used in conjunction with optional bank selects and a program change. There may |
|
1794
|
|
|
|
|
|
|
be more than one Program Name Meta Events in a track. |
|
1795
|
|
|
|
|
|
|
|
|
1796
|
|
|
|
|
|
|
=cut |
|
1797
|
|
|
|
|
|
|
|
|
1798
|
|
|
|
|
|
|
#=============================================================================== |
|
1799
|
|
|
|
|
|
|
|
|
1800
|
|
|
|
|
|
|
{ |
|
1801
|
|
|
|
|
|
|
no strict "refs"; |
|
1802
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ProgramName'; }; |
|
1803
|
|
|
|
|
|
|
} |
|
1804
|
|
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
#=============================================================================== |
|
1806
|
|
|
|
|
|
|
|
|
1807
|
|
|
|
|
|
|
sub _bytes { |
|
1808
|
|
|
|
|
|
|
my $self = shift; |
|
1809
|
|
|
|
|
|
|
|
|
1810
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1811
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x08, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
1812
|
|
|
|
|
|
|
|
|
1813
|
|
|
|
|
|
|
if(wantarray()) { |
|
1814
|
|
|
|
|
|
|
return @bytes; |
|
1815
|
|
|
|
|
|
|
} |
|
1816
|
|
|
|
|
|
|
|
|
1817
|
|
|
|
|
|
|
return \@bytes; |
|
1818
|
|
|
|
|
|
|
} |
|
1819
|
|
|
|
|
|
|
|
|
1820
|
|
|
|
|
|
|
##END_PACKAGE ProgramName |
|
1821
|
|
|
|
|
|
|
|
|
1822
|
|
|
|
|
|
|
#=============================================================================== |
|
1823
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1824
|
|
|
|
|
|
|
# UML Model UUID: b9dd7156-45d9-11dd-8bf4-00502c05c241 |
|
1825
|
|
|
|
|
|
|
|
|
1826
|
|
|
|
|
|
|
package MIDI::XML::SequenceNumber; |
|
1827
|
|
|
|
|
|
|
|
|
1828
|
|
|
|
|
|
|
use Carp; |
|
1829
|
|
|
|
|
|
|
|
|
1830
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1831
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1832
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1833
|
|
|
|
|
|
|
|
|
1834
|
|
|
|
|
|
|
=head1 DESCRIPTION of SequenceNumber |
|
1835
|
|
|
|
|
|
|
|
|
1836
|
|
|
|
|
|
|
MIDI::XML::SequenceNumber is used for representing SequenceNumber objects |
|
1837
|
|
|
|
|
|
|
|
|
1838
|
|
|
|
|
|
|
=cut |
|
1839
|
|
|
|
|
|
|
|
|
1840
|
|
|
|
|
|
|
#=============================================================================== |
|
1841
|
|
|
|
|
|
|
|
|
1842
|
|
|
|
|
|
|
{ |
|
1843
|
|
|
|
|
|
|
no strict "refs"; |
|
1844
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SequenceNumber'; }; |
|
1845
|
|
|
|
|
|
|
} |
|
1846
|
|
|
|
|
|
|
|
|
1847
|
|
|
|
|
|
|
#=============================================================================== |
|
1848
|
|
|
|
|
|
|
# MIDI::XML::SequenceNumber::Value |
|
1849
|
|
|
|
|
|
|
|
|
1850
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
1851
|
|
|
|
|
|
|
|
|
1852
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
1853
|
|
|
|
|
|
|
|
|
1854
|
|
|
|
|
|
|
|
|
1855
|
|
|
|
|
|
|
Type: int |
|
1856
|
|
|
|
|
|
|
Lower: 1 |
|
1857
|
|
|
|
|
|
|
Upper: 1 |
|
1858
|
|
|
|
|
|
|
|
|
1859
|
|
|
|
|
|
|
=cut |
|
1860
|
|
|
|
|
|
|
|
|
1861
|
|
|
|
|
|
|
sub Value() { |
|
1862
|
|
|
|
|
|
|
my $self = shift; |
|
1863
|
|
|
|
|
|
|
if (@_) { |
|
1864
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
1865
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
1866
|
|
|
|
|
|
|
} else { |
|
1867
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
1868
|
|
|
|
|
|
|
} |
|
1869
|
|
|
|
|
|
|
} |
|
1870
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
1871
|
|
|
|
|
|
|
} |
|
1872
|
|
|
|
|
|
|
|
|
1873
|
|
|
|
|
|
|
#=============================================================================== |
|
1874
|
|
|
|
|
|
|
|
|
1875
|
|
|
|
|
|
|
sub _bytes { |
|
1876
|
|
|
|
|
|
|
my $self = shift; |
|
1877
|
|
|
|
|
|
|
|
|
1878
|
|
|
|
|
|
|
my $value = $self->Value(); |
|
1879
|
|
|
|
|
|
|
my $hi = ($value >> 8) & 0xFF; |
|
1880
|
|
|
|
|
|
|
my $lo = $value & 0xFF; |
|
1881
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x00, 0x02, $hi, $lo); |
|
1882
|
|
|
|
|
|
|
|
|
1883
|
|
|
|
|
|
|
if(wantarray()) { |
|
1884
|
|
|
|
|
|
|
return @bytes; |
|
1885
|
|
|
|
|
|
|
} |
|
1886
|
|
|
|
|
|
|
|
|
1887
|
|
|
|
|
|
|
return \@bytes; |
|
1888
|
|
|
|
|
|
|
} |
|
1889
|
|
|
|
|
|
|
|
|
1890
|
|
|
|
|
|
|
##END_PACKAGE SequenceNumber |
|
1891
|
|
|
|
|
|
|
|
|
1892
|
|
|
|
|
|
|
#=============================================================================== |
|
1893
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1894
|
|
|
|
|
|
|
# UML Model UUID: 4a76f5c2-45da-11dd-8bf4-00502c05c241 |
|
1895
|
|
|
|
|
|
|
|
|
1896
|
|
|
|
|
|
|
package MIDI::XML::SequencerSpecific; |
|
1897
|
|
|
|
|
|
|
|
|
1898
|
|
|
|
|
|
|
use Carp; |
|
1899
|
|
|
|
|
|
|
|
|
1900
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1901
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1902
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1903
|
|
|
|
|
|
|
|
|
1904
|
|
|
|
|
|
|
=head1 DESCRIPTION of SequencerSpecific |
|
1905
|
|
|
|
|
|
|
|
|
1906
|
|
|
|
|
|
|
MIDI::XML::SequencerSpecific is used for representing SequencerSpecific objects |
|
1907
|
|
|
|
|
|
|
|
|
1908
|
|
|
|
|
|
|
=cut |
|
1909
|
|
|
|
|
|
|
|
|
1910
|
|
|
|
|
|
|
#=============================================================================== |
|
1911
|
|
|
|
|
|
|
|
|
1912
|
|
|
|
|
|
|
{ |
|
1913
|
|
|
|
|
|
|
no strict "refs"; |
|
1914
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SequencerSpecific'; }; |
|
1915
|
|
|
|
|
|
|
} |
|
1916
|
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
#=============================================================================== |
|
1918
|
|
|
|
|
|
|
|
|
1919
|
|
|
|
|
|
|
sub _bytes { |
|
1920
|
|
|
|
|
|
|
my $self = shift; |
|
1921
|
|
|
|
|
|
|
|
|
1922
|
|
|
|
|
|
|
my $text = $self->text(); |
|
1923
|
|
|
|
|
|
|
my @t = split(' ',$text); |
|
1924
|
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x7F, MIDI::XML::Document::var_len_int($#t+1)); |
|
1926
|
|
|
|
|
|
|
map {push @bytes,ord(pack('H2',"$_"));} @t; |
|
1927
|
|
|
|
|
|
|
|
|
1928
|
|
|
|
|
|
|
if(wantarray()) { |
|
1929
|
|
|
|
|
|
|
return @bytes; |
|
1930
|
|
|
|
|
|
|
} |
|
1931
|
|
|
|
|
|
|
|
|
1932
|
|
|
|
|
|
|
return \@bytes; |
|
1933
|
|
|
|
|
|
|
} |
|
1934
|
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
##END_PACKAGE SequencerSpecific |
|
1936
|
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
#=============================================================================== |
|
1938
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
1939
|
|
|
|
|
|
|
# UML Model UUID: e58fa939-45d9-11dd-8bf4-00502c05c241 |
|
1940
|
|
|
|
|
|
|
|
|
1941
|
|
|
|
|
|
|
package MIDI::XML::SetTempo; |
|
1942
|
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
use Carp; |
|
1944
|
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
1946
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
1947
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
1948
|
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
=head1 DESCRIPTION of SetTempo |
|
1950
|
|
|
|
|
|
|
|
|
1951
|
|
|
|
|
|
|
MIDI::XML::SetTempo is used for representing SetTempo objects |
|
1952
|
|
|
|
|
|
|
|
|
1953
|
|
|
|
|
|
|
=cut |
|
1954
|
|
|
|
|
|
|
|
|
1955
|
|
|
|
|
|
|
#=============================================================================== |
|
1956
|
|
|
|
|
|
|
|
|
1957
|
|
|
|
|
|
|
{ |
|
1958
|
|
|
|
|
|
|
no strict "refs"; |
|
1959
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SetTempo'; }; |
|
1960
|
|
|
|
|
|
|
} |
|
1961
|
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
#=============================================================================== |
|
1963
|
|
|
|
|
|
|
# MIDI::XML::SetTempo::Value |
|
1964
|
|
|
|
|
|
|
|
|
1965
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
1966
|
|
|
|
|
|
|
|
|
1967
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
1968
|
|
|
|
|
|
|
|
|
1969
|
|
|
|
|
|
|
|
|
1970
|
|
|
|
|
|
|
Type: int |
|
1971
|
|
|
|
|
|
|
Lower: 1 |
|
1972
|
|
|
|
|
|
|
Upper: 1 |
|
1973
|
|
|
|
|
|
|
|
|
1974
|
|
|
|
|
|
|
=cut |
|
1975
|
|
|
|
|
|
|
|
|
1976
|
|
|
|
|
|
|
sub Value() { |
|
1977
|
|
|
|
|
|
|
my $self = shift; |
|
1978
|
|
|
|
|
|
|
if (@_) { |
|
1979
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
1980
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
1981
|
|
|
|
|
|
|
} else { |
|
1982
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
1983
|
|
|
|
|
|
|
} |
|
1984
|
|
|
|
|
|
|
} |
|
1985
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
1986
|
|
|
|
|
|
|
} |
|
1987
|
|
|
|
|
|
|
|
|
1988
|
|
|
|
|
|
|
#=============================================================================== |
|
1989
|
|
|
|
|
|
|
|
|
1990
|
|
|
|
|
|
|
sub _bytes { |
|
1991
|
|
|
|
|
|
|
my $self = shift; |
|
1992
|
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
my $v = $self->Value(); |
|
1994
|
|
|
|
|
|
|
my $hi = ($v >> 16) & 0x7F; |
|
1995
|
|
|
|
|
|
|
my $mid = ($v >> 8) &0x7F; |
|
1996
|
|
|
|
|
|
|
my $lo = $v & 0x7F; |
|
1997
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x51, 0x03, $hi, $mid, $lo); |
|
1998
|
|
|
|
|
|
|
|
|
1999
|
|
|
|
|
|
|
if(wantarray()) { |
|
2000
|
|
|
|
|
|
|
return @bytes; |
|
2001
|
|
|
|
|
|
|
} |
|
2002
|
|
|
|
|
|
|
|
|
2003
|
|
|
|
|
|
|
return \@bytes; |
|
2004
|
|
|
|
|
|
|
} |
|
2005
|
|
|
|
|
|
|
|
|
2006
|
|
|
|
|
|
|
##END_PACKAGE SetTempo |
|
2007
|
|
|
|
|
|
|
|
|
2008
|
|
|
|
|
|
|
#=============================================================================== |
|
2009
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2010
|
|
|
|
|
|
|
# UML Model UUID: f8883a7c-45d9-11dd-8bf4-00502c05c241 |
|
2011
|
|
|
|
|
|
|
|
|
2012
|
|
|
|
|
|
|
package MIDI::XML::SMPTEOffset; |
|
2013
|
|
|
|
|
|
|
|
|
2014
|
|
|
|
|
|
|
use Carp; |
|
2015
|
|
|
|
|
|
|
|
|
2016
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
2017
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2018
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2019
|
|
|
|
|
|
|
|
|
2020
|
|
|
|
|
|
|
=head1 DESCRIPTION of SMPTEOffset |
|
2021
|
|
|
|
|
|
|
|
|
2022
|
|
|
|
|
|
|
MIDI::XML::SMPTEOffset is used for representing SMPTEOffset objects |
|
2023
|
|
|
|
|
|
|
|
|
2024
|
|
|
|
|
|
|
=cut |
|
2025
|
|
|
|
|
|
|
|
|
2026
|
|
|
|
|
|
|
#=============================================================================== |
|
2027
|
|
|
|
|
|
|
|
|
2028
|
|
|
|
|
|
|
{ |
|
2029
|
|
|
|
|
|
|
no strict "refs"; |
|
2030
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SMPTEOffset'; }; |
|
2031
|
|
|
|
|
|
|
} |
|
2032
|
|
|
|
|
|
|
|
|
2033
|
|
|
|
|
|
|
#=============================================================================== |
|
2034
|
|
|
|
|
|
|
# MIDI::XML::SMPTEOffset::TimeCodeType |
|
2035
|
|
|
|
|
|
|
|
|
2036
|
|
|
|
|
|
|
=head2 $value = $Object->TimeCodeType([$new_value]); |
|
2037
|
|
|
|
|
|
|
|
|
2038
|
|
|
|
|
|
|
Set or get value of the TimeCodeType attribute. |
|
2039
|
|
|
|
|
|
|
|
|
2040
|
|
|
|
|
|
|
|
|
2041
|
|
|
|
|
|
|
Type: int |
|
2042
|
|
|
|
|
|
|
Lower: 1 |
|
2043
|
|
|
|
|
|
|
Upper: 1 |
|
2044
|
|
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
|
=cut |
|
2046
|
|
|
|
|
|
|
|
|
2047
|
|
|
|
|
|
|
sub TimeCodeType() { |
|
2048
|
|
|
|
|
|
|
my $self = shift; |
|
2049
|
|
|
|
|
|
|
if (@_) { |
|
2050
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2051
|
|
|
|
|
|
|
$self->setAttribute('TimeCodeType', shift); |
|
2052
|
|
|
|
|
|
|
} else { |
|
2053
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'TimeCodeType\''; |
|
2054
|
|
|
|
|
|
|
} |
|
2055
|
|
|
|
|
|
|
} |
|
2056
|
|
|
|
|
|
|
return $self->getAttribute('TimeCodeType'); |
|
2057
|
|
|
|
|
|
|
} |
|
2058
|
|
|
|
|
|
|
|
|
2059
|
|
|
|
|
|
|
#=============================================================================== |
|
2060
|
|
|
|
|
|
|
# MIDI::XML::SMPTEOffset::Hour |
|
2061
|
|
|
|
|
|
|
|
|
2062
|
|
|
|
|
|
|
=head2 $value = $Object->Hour([$new_value]); |
|
2063
|
|
|
|
|
|
|
|
|
2064
|
|
|
|
|
|
|
Set or get value of the Hour attribute. |
|
2065
|
|
|
|
|
|
|
|
|
2066
|
|
|
|
|
|
|
|
|
2067
|
|
|
|
|
|
|
Type: int |
|
2068
|
|
|
|
|
|
|
Lower: 1 |
|
2069
|
|
|
|
|
|
|
Upper: 1 |
|
2070
|
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
=cut |
|
2072
|
|
|
|
|
|
|
|
|
2073
|
|
|
|
|
|
|
sub Hour() { |
|
2074
|
|
|
|
|
|
|
my $self = shift; |
|
2075
|
|
|
|
|
|
|
if (@_) { |
|
2076
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2077
|
|
|
|
|
|
|
$self->setAttribute('Hour', shift); |
|
2078
|
|
|
|
|
|
|
} else { |
|
2079
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Hour\''; |
|
2080
|
|
|
|
|
|
|
} |
|
2081
|
|
|
|
|
|
|
} |
|
2082
|
|
|
|
|
|
|
return $self->getAttribute('Hour'); |
|
2083
|
|
|
|
|
|
|
} |
|
2084
|
|
|
|
|
|
|
|
|
2085
|
|
|
|
|
|
|
#=============================================================================== |
|
2086
|
|
|
|
|
|
|
# MIDI::XML::SMPTEOffset::Minute |
|
2087
|
|
|
|
|
|
|
|
|
2088
|
|
|
|
|
|
|
=head2 $value = $Object->Minute([$new_value]); |
|
2089
|
|
|
|
|
|
|
|
|
2090
|
|
|
|
|
|
|
Set or get value of the Minute attribute. |
|
2091
|
|
|
|
|
|
|
|
|
2092
|
|
|
|
|
|
|
|
|
2093
|
|
|
|
|
|
|
Type: int |
|
2094
|
|
|
|
|
|
|
Lower: 1 |
|
2095
|
|
|
|
|
|
|
Upper: 1 |
|
2096
|
|
|
|
|
|
|
|
|
2097
|
|
|
|
|
|
|
=cut |
|
2098
|
|
|
|
|
|
|
|
|
2099
|
|
|
|
|
|
|
sub Minute() { |
|
2100
|
|
|
|
|
|
|
my $self = shift; |
|
2101
|
|
|
|
|
|
|
if (@_) { |
|
2102
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2103
|
|
|
|
|
|
|
$self->setAttribute('Minute', shift); |
|
2104
|
|
|
|
|
|
|
} else { |
|
2105
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Minute\''; |
|
2106
|
|
|
|
|
|
|
} |
|
2107
|
|
|
|
|
|
|
} |
|
2108
|
|
|
|
|
|
|
return $self->getAttribute('Minute'); |
|
2109
|
|
|
|
|
|
|
} |
|
2110
|
|
|
|
|
|
|
|
|
2111
|
|
|
|
|
|
|
#=============================================================================== |
|
2112
|
|
|
|
|
|
|
# MIDI::XML::SMPTEOffset::Second |
|
2113
|
|
|
|
|
|
|
|
|
2114
|
|
|
|
|
|
|
=head2 $value = $Object->Second([$new_value]); |
|
2115
|
|
|
|
|
|
|
|
|
2116
|
|
|
|
|
|
|
Set or get value of the Second attribute. |
|
2117
|
|
|
|
|
|
|
|
|
2118
|
|
|
|
|
|
|
|
|
2119
|
|
|
|
|
|
|
Type: int |
|
2120
|
|
|
|
|
|
|
Lower: 1 |
|
2121
|
|
|
|
|
|
|
Upper: 1 |
|
2122
|
|
|
|
|
|
|
|
|
2123
|
|
|
|
|
|
|
=cut |
|
2124
|
|
|
|
|
|
|
|
|
2125
|
|
|
|
|
|
|
sub Second() { |
|
2126
|
|
|
|
|
|
|
my $self = shift; |
|
2127
|
|
|
|
|
|
|
if (@_) { |
|
2128
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2129
|
|
|
|
|
|
|
$self->setAttribute('Second', shift); |
|
2130
|
|
|
|
|
|
|
} else { |
|
2131
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Second\''; |
|
2132
|
|
|
|
|
|
|
} |
|
2133
|
|
|
|
|
|
|
} |
|
2134
|
|
|
|
|
|
|
return $self->getAttribute('Second'); |
|
2135
|
|
|
|
|
|
|
} |
|
2136
|
|
|
|
|
|
|
|
|
2137
|
|
|
|
|
|
|
#=============================================================================== |
|
2138
|
|
|
|
|
|
|
# MIDI::XML::SMPTEOffset::Frame |
|
2139
|
|
|
|
|
|
|
|
|
2140
|
|
|
|
|
|
|
=head2 $value = $Object->Frame([$new_value]); |
|
2141
|
|
|
|
|
|
|
|
|
2142
|
|
|
|
|
|
|
Set or get value of the Frame attribute. |
|
2143
|
|
|
|
|
|
|
|
|
2144
|
|
|
|
|
|
|
|
|
2145
|
|
|
|
|
|
|
Type: int |
|
2146
|
|
|
|
|
|
|
Lower: 1 |
|
2147
|
|
|
|
|
|
|
Upper: 1 |
|
2148
|
|
|
|
|
|
|
|
|
2149
|
|
|
|
|
|
|
=cut |
|
2150
|
|
|
|
|
|
|
|
|
2151
|
|
|
|
|
|
|
sub Frame() { |
|
2152
|
|
|
|
|
|
|
my $self = shift; |
|
2153
|
|
|
|
|
|
|
if (@_) { |
|
2154
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2155
|
|
|
|
|
|
|
$self->setAttribute('Frame', shift); |
|
2156
|
|
|
|
|
|
|
} else { |
|
2157
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Frame\''; |
|
2158
|
|
|
|
|
|
|
} |
|
2159
|
|
|
|
|
|
|
} |
|
2160
|
|
|
|
|
|
|
return $self->getAttribute('Frame'); |
|
2161
|
|
|
|
|
|
|
} |
|
2162
|
|
|
|
|
|
|
|
|
2163
|
|
|
|
|
|
|
#=============================================================================== |
|
2164
|
|
|
|
|
|
|
# MIDI::XML::SMPTEOffset::FractionalFrame |
|
2165
|
|
|
|
|
|
|
|
|
2166
|
|
|
|
|
|
|
=head2 $value = $Object->FractionalFrame([$new_value]); |
|
2167
|
|
|
|
|
|
|
|
|
2168
|
|
|
|
|
|
|
Set or get value of the FractionalFrame attribute. |
|
2169
|
|
|
|
|
|
|
|
|
2170
|
|
|
|
|
|
|
|
|
2171
|
|
|
|
|
|
|
Type: int |
|
2172
|
|
|
|
|
|
|
Lower: 1 |
|
2173
|
|
|
|
|
|
|
Upper: 1 |
|
2174
|
|
|
|
|
|
|
|
|
2175
|
|
|
|
|
|
|
=cut |
|
2176
|
|
|
|
|
|
|
|
|
2177
|
|
|
|
|
|
|
sub FractionalFrame() { |
|
2178
|
|
|
|
|
|
|
my $self = shift; |
|
2179
|
|
|
|
|
|
|
if (@_) { |
|
2180
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2181
|
|
|
|
|
|
|
$self->setAttribute('FractionalFrame', shift); |
|
2182
|
|
|
|
|
|
|
} else { |
|
2183
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'FractionalFrame\''; |
|
2184
|
|
|
|
|
|
|
} |
|
2185
|
|
|
|
|
|
|
} |
|
2186
|
|
|
|
|
|
|
return $self->getAttribute('FractionalFrame'); |
|
2187
|
|
|
|
|
|
|
} |
|
2188
|
|
|
|
|
|
|
|
|
2189
|
|
|
|
|
|
|
#=============================================================================== |
|
2190
|
|
|
|
|
|
|
|
|
2191
|
|
|
|
|
|
|
sub _bytes { |
|
2192
|
|
|
|
|
|
|
my $self = shift; |
|
2193
|
|
|
|
|
|
|
|
|
2194
|
|
|
|
|
|
|
# my $text = $self->text(); |
|
2195
|
|
|
|
|
|
|
my $d1 = ($self->TimeCodeType()<< 5) + ($self->Hour() & 0x1F); |
|
2196
|
|
|
|
|
|
|
my $d2 = $self->Minute(); |
|
2197
|
|
|
|
|
|
|
my $d3 = $self->Second(); |
|
2198
|
|
|
|
|
|
|
my $d4 = $self->Frame(); |
|
2199
|
|
|
|
|
|
|
my $d5 = $self->FractionalFrame(); |
|
2200
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x54, 0x05, $d1, $d2, $d3, $d4, $d5); |
|
2201
|
|
|
|
|
|
|
|
|
2202
|
|
|
|
|
|
|
if(wantarray()) { |
|
2203
|
|
|
|
|
|
|
return @bytes; |
|
2204
|
|
|
|
|
|
|
} |
|
2205
|
|
|
|
|
|
|
|
|
2206
|
|
|
|
|
|
|
return \@bytes; |
|
2207
|
|
|
|
|
|
|
} |
|
2208
|
|
|
|
|
|
|
|
|
2209
|
|
|
|
|
|
|
##END_PACKAGE SMPTEOffset |
|
2210
|
|
|
|
|
|
|
|
|
2211
|
|
|
|
|
|
|
#=============================================================================== |
|
2212
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2213
|
|
|
|
|
|
|
# UML Model UUID: 153625bf-45da-11dd-8bf4-00502c05c241 |
|
2214
|
|
|
|
|
|
|
|
|
2215
|
|
|
|
|
|
|
package MIDI::XML::TextEvent; |
|
2216
|
|
|
|
|
|
|
|
|
2217
|
|
|
|
|
|
|
use Carp; |
|
2218
|
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
2220
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2221
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2222
|
|
|
|
|
|
|
|
|
2223
|
|
|
|
|
|
|
=head1 DESCRIPTION of TextEvent |
|
2224
|
|
|
|
|
|
|
|
|
2225
|
|
|
|
|
|
|
MIDI::XML::TextEvent is used for representing TextEvent objects |
|
2226
|
|
|
|
|
|
|
|
|
2227
|
|
|
|
|
|
|
=cut |
|
2228
|
|
|
|
|
|
|
|
|
2229
|
|
|
|
|
|
|
#=============================================================================== |
|
2230
|
|
|
|
|
|
|
|
|
2231
|
|
|
|
|
|
|
{ |
|
2232
|
|
|
|
|
|
|
no strict "refs"; |
|
2233
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TextEvent'; }; |
|
2234
|
|
|
|
|
|
|
} |
|
2235
|
|
|
|
|
|
|
|
|
2236
|
|
|
|
|
|
|
#=============================================================================== |
|
2237
|
|
|
|
|
|
|
|
|
2238
|
|
|
|
|
|
|
sub _bytes { |
|
2239
|
|
|
|
|
|
|
my $self = shift; |
|
2240
|
|
|
|
|
|
|
|
|
2241
|
|
|
|
|
|
|
my $text = $self->text(); |
|
2242
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x01, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
2243
|
|
|
|
|
|
|
|
|
2244
|
|
|
|
|
|
|
if(wantarray()) { |
|
2245
|
|
|
|
|
|
|
return @bytes; |
|
2246
|
|
|
|
|
|
|
} |
|
2247
|
|
|
|
|
|
|
|
|
2248
|
|
|
|
|
|
|
return \@bytes; |
|
2249
|
|
|
|
|
|
|
} |
|
2250
|
|
|
|
|
|
|
|
|
2251
|
|
|
|
|
|
|
##END_PACKAGE TextEvent |
|
2252
|
|
|
|
|
|
|
|
|
2253
|
|
|
|
|
|
|
#=============================================================================== |
|
2254
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2255
|
|
|
|
|
|
|
# UML Model UUID: 68d55025-45da-11dd-8bf4-00502c05c241 |
|
2256
|
|
|
|
|
|
|
|
|
2257
|
|
|
|
|
|
|
package MIDI::XML::TimeSignature; |
|
2258
|
|
|
|
|
|
|
|
|
2259
|
|
|
|
|
|
|
use Carp; |
|
2260
|
|
|
|
|
|
|
|
|
2261
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
2262
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2263
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2264
|
|
|
|
|
|
|
|
|
2265
|
|
|
|
|
|
|
=head1 DESCRIPTION of TimeSignature |
|
2266
|
|
|
|
|
|
|
|
|
2267
|
|
|
|
|
|
|
MIDI::XML::TimeSignature is used for representing TimeSignature objects |
|
2268
|
|
|
|
|
|
|
|
|
2269
|
|
|
|
|
|
|
=cut |
|
2270
|
|
|
|
|
|
|
|
|
2271
|
|
|
|
|
|
|
#=============================================================================== |
|
2272
|
|
|
|
|
|
|
|
|
2273
|
|
|
|
|
|
|
{ |
|
2274
|
|
|
|
|
|
|
no strict "refs"; |
|
2275
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TimeSignature'; }; |
|
2276
|
|
|
|
|
|
|
} |
|
2277
|
|
|
|
|
|
|
|
|
2278
|
|
|
|
|
|
|
#=============================================================================== |
|
2279
|
|
|
|
|
|
|
# MIDI::XML::TimeSignature::Numerator |
|
2280
|
|
|
|
|
|
|
|
|
2281
|
|
|
|
|
|
|
=head2 $value = $Object->Numerator([$new_value]); |
|
2282
|
|
|
|
|
|
|
|
|
2283
|
|
|
|
|
|
|
Set or get value of the Numerator attribute. |
|
2284
|
|
|
|
|
|
|
|
|
2285
|
|
|
|
|
|
|
|
|
2286
|
|
|
|
|
|
|
Type: int |
|
2287
|
|
|
|
|
|
|
Lower: 1 |
|
2288
|
|
|
|
|
|
|
Upper: 1 |
|
2289
|
|
|
|
|
|
|
|
|
2290
|
|
|
|
|
|
|
=cut |
|
2291
|
|
|
|
|
|
|
|
|
2292
|
|
|
|
|
|
|
sub Numerator() { |
|
2293
|
|
|
|
|
|
|
my $self = shift; |
|
2294
|
|
|
|
|
|
|
if (@_) { |
|
2295
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2296
|
|
|
|
|
|
|
$self->setAttribute('Numerator', shift); |
|
2297
|
|
|
|
|
|
|
} else { |
|
2298
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Numerator\''; |
|
2299
|
|
|
|
|
|
|
} |
|
2300
|
|
|
|
|
|
|
} |
|
2301
|
|
|
|
|
|
|
return $self->getAttribute('Numerator'); |
|
2302
|
|
|
|
|
|
|
} |
|
2303
|
|
|
|
|
|
|
|
|
2304
|
|
|
|
|
|
|
#=============================================================================== |
|
2305
|
|
|
|
|
|
|
# MIDI::XML::TimeSignature::LogDenominator |
|
2306
|
|
|
|
|
|
|
|
|
2307
|
|
|
|
|
|
|
=head2 $value = $Object->LogDenominator([$new_value]); |
|
2308
|
|
|
|
|
|
|
|
|
2309
|
|
|
|
|
|
|
Set or get value of the LogDenominator attribute. |
|
2310
|
|
|
|
|
|
|
|
|
2311
|
|
|
|
|
|
|
|
|
2312
|
|
|
|
|
|
|
Type: int |
|
2313
|
|
|
|
|
|
|
Lower: 1 |
|
2314
|
|
|
|
|
|
|
Upper: 1 |
|
2315
|
|
|
|
|
|
|
|
|
2316
|
|
|
|
|
|
|
=cut |
|
2317
|
|
|
|
|
|
|
|
|
2318
|
|
|
|
|
|
|
sub LogDenominator() { |
|
2319
|
|
|
|
|
|
|
my $self = shift; |
|
2320
|
|
|
|
|
|
|
if (@_) { |
|
2321
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2322
|
|
|
|
|
|
|
$self->setAttribute('LogDenominator', shift); |
|
2323
|
|
|
|
|
|
|
} else { |
|
2324
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'LogDenominator\''; |
|
2325
|
|
|
|
|
|
|
} |
|
2326
|
|
|
|
|
|
|
} |
|
2327
|
|
|
|
|
|
|
return $self->getAttribute('LogDenominator'); |
|
2328
|
|
|
|
|
|
|
} |
|
2329
|
|
|
|
|
|
|
|
|
2330
|
|
|
|
|
|
|
#=============================================================================== |
|
2331
|
|
|
|
|
|
|
# MIDI::XML::TimeSignature::MIDIClocksPerMetronomeClick |
|
2332
|
|
|
|
|
|
|
|
|
2333
|
|
|
|
|
|
|
=head2 $value = $Object->MIDIClocksPerMetronomeClick([$new_value]); |
|
2334
|
|
|
|
|
|
|
|
|
2335
|
|
|
|
|
|
|
Set or get value of the MIDIClocksPerMetronomeClick attribute. |
|
2336
|
|
|
|
|
|
|
|
|
2337
|
|
|
|
|
|
|
|
|
2338
|
|
|
|
|
|
|
Type: int |
|
2339
|
|
|
|
|
|
|
Lower: 1 |
|
2340
|
|
|
|
|
|
|
Upper: 1 |
|
2341
|
|
|
|
|
|
|
|
|
2342
|
|
|
|
|
|
|
=cut |
|
2343
|
|
|
|
|
|
|
|
|
2344
|
|
|
|
|
|
|
sub MIDIClocksPerMetronomeClick() { |
|
2345
|
|
|
|
|
|
|
my $self = shift; |
|
2346
|
|
|
|
|
|
|
if (@_) { |
|
2347
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2348
|
|
|
|
|
|
|
$self->setAttribute('MIDIClocksPerMetronomeClick', shift); |
|
2349
|
|
|
|
|
|
|
} else { |
|
2350
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'MIDIClocksPerMetronomeClick\''; |
|
2351
|
|
|
|
|
|
|
} |
|
2352
|
|
|
|
|
|
|
} |
|
2353
|
|
|
|
|
|
|
return $self->getAttribute('MIDIClocksPerMetronomeClick'); |
|
2354
|
|
|
|
|
|
|
} |
|
2355
|
|
|
|
|
|
|
|
|
2356
|
|
|
|
|
|
|
#=============================================================================== |
|
2357
|
|
|
|
|
|
|
# MIDI::XML::TimeSignature::ThirtySecondsPer24Clocks |
|
2358
|
|
|
|
|
|
|
|
|
2359
|
|
|
|
|
|
|
=head2 $value = $Object->ThirtySecondsPer24Clocks([$new_value]); |
|
2360
|
|
|
|
|
|
|
|
|
2361
|
|
|
|
|
|
|
Set or get value of the ThirtySecondsPer24Clocks attribute. |
|
2362
|
|
|
|
|
|
|
|
|
2363
|
|
|
|
|
|
|
|
|
2364
|
|
|
|
|
|
|
Type: int |
|
2365
|
|
|
|
|
|
|
Lower: 1 |
|
2366
|
|
|
|
|
|
|
Upper: 1 |
|
2367
|
|
|
|
|
|
|
|
|
2368
|
|
|
|
|
|
|
=cut |
|
2369
|
|
|
|
|
|
|
|
|
2370
|
|
|
|
|
|
|
sub ThirtySecondsPer24Clocks() { |
|
2371
|
|
|
|
|
|
|
my $self = shift; |
|
2372
|
|
|
|
|
|
|
if (@_) { |
|
2373
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2374
|
|
|
|
|
|
|
$self->setAttribute('ThirtySecondsPer24Clocks', shift); |
|
2375
|
|
|
|
|
|
|
} else { |
|
2376
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'ThirtySecondsPer24Clocks\''; |
|
2377
|
|
|
|
|
|
|
} |
|
2378
|
|
|
|
|
|
|
} |
|
2379
|
|
|
|
|
|
|
return $self->getAttribute('ThirtySecondsPer24Clocks'); |
|
2380
|
|
|
|
|
|
|
} |
|
2381
|
|
|
|
|
|
|
|
|
2382
|
|
|
|
|
|
|
#=============================================================================== |
|
2383
|
|
|
|
|
|
|
|
|
2384
|
|
|
|
|
|
|
sub _bytes { |
|
2385
|
|
|
|
|
|
|
my $self = shift; |
|
2386
|
|
|
|
|
|
|
|
|
2387
|
|
|
|
|
|
|
my $d1 = $self->Numerator(); |
|
2388
|
|
|
|
|
|
|
my $d2 = $self->LogDenominator(); |
|
2389
|
|
|
|
|
|
|
my $d3 = $self->MIDIClocksPerMetronomeClick(); |
|
2390
|
|
|
|
|
|
|
my $d4 = $self->ThirtySecondsPer24Clocks(); |
|
2391
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x58, 0x04, $d1, $d2, $d3, $d4); |
|
2392
|
|
|
|
|
|
|
|
|
2393
|
|
|
|
|
|
|
if(wantarray()) { |
|
2394
|
|
|
|
|
|
|
return @bytes; |
|
2395
|
|
|
|
|
|
|
} |
|
2396
|
|
|
|
|
|
|
|
|
2397
|
|
|
|
|
|
|
return \@bytes; |
|
2398
|
|
|
|
|
|
|
} |
|
2399
|
|
|
|
|
|
|
|
|
2400
|
|
|
|
|
|
|
##END_PACKAGE TimeSignature |
|
2401
|
|
|
|
|
|
|
|
|
2402
|
|
|
|
|
|
|
#=============================================================================== |
|
2403
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2404
|
|
|
|
|
|
|
# UML Model UUID: 8c03a928-45da-11dd-8bf4-00502c05c241 |
|
2405
|
|
|
|
|
|
|
|
|
2406
|
|
|
|
|
|
|
package MIDI::XML::TrackName; |
|
2407
|
|
|
|
|
|
|
|
|
2408
|
|
|
|
|
|
|
use Carp; |
|
2409
|
|
|
|
|
|
|
|
|
2410
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
2411
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2412
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2413
|
|
|
|
|
|
|
|
|
2414
|
|
|
|
|
|
|
=head1 DESCRIPTION of TrackName |
|
2415
|
|
|
|
|
|
|
|
|
2416
|
|
|
|
|
|
|
MIDI::XML::TrackName is used for representing TrackName objects |
|
2417
|
|
|
|
|
|
|
|
|
2418
|
|
|
|
|
|
|
=cut |
|
2419
|
|
|
|
|
|
|
|
|
2420
|
|
|
|
|
|
|
#=============================================================================== |
|
2421
|
|
|
|
|
|
|
|
|
2422
|
|
|
|
|
|
|
{ |
|
2423
|
|
|
|
|
|
|
no strict "refs"; |
|
2424
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TrackName'; }; |
|
2425
|
|
|
|
|
|
|
} |
|
2426
|
|
|
|
|
|
|
|
|
2427
|
|
|
|
|
|
|
#=============================================================================== |
|
2428
|
|
|
|
|
|
|
|
|
2429
|
|
|
|
|
|
|
sub _bytes { |
|
2430
|
|
|
|
|
|
|
my $self = shift; |
|
2431
|
|
|
|
|
|
|
|
|
2432
|
|
|
|
|
|
|
my $text = $self->text(); |
|
2433
|
|
|
|
|
|
|
my @bytes = (0xFF, 0x03, MIDI::XML::Document::var_len_int(length($text)), unpack('C*',$text)); |
|
2434
|
|
|
|
|
|
|
|
|
2435
|
|
|
|
|
|
|
if(wantarray()) { |
|
2436
|
|
|
|
|
|
|
return @bytes; |
|
2437
|
|
|
|
|
|
|
} |
|
2438
|
|
|
|
|
|
|
|
|
2439
|
|
|
|
|
|
|
return \@bytes; |
|
2440
|
|
|
|
|
|
|
} |
|
2441
|
|
|
|
|
|
|
|
|
2442
|
|
|
|
|
|
|
##END_PACKAGE TrackName |
|
2443
|
|
|
|
|
|
|
|
|
2444
|
|
|
|
|
|
|
#=============================================================================== |
|
2445
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2446
|
|
|
|
|
|
|
# UML Model UUID: 5faf654c-4757-11dd-8bf4-00502c05c241 |
|
2447
|
|
|
|
|
|
|
|
|
2448
|
|
|
|
|
|
|
package MIDI::XML::XMFPatchTypePrefix; |
|
2449
|
|
|
|
|
|
|
|
|
2450
|
|
|
|
|
|
|
use Carp; |
|
2451
|
|
|
|
|
|
|
|
|
2452
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MetaEvent); |
|
2453
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2454
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2455
|
|
|
|
|
|
|
|
|
2456
|
|
|
|
|
|
|
=head1 DESCRIPTION of XMFPatchTypePrefix |
|
2457
|
|
|
|
|
|
|
|
|
2458
|
|
|
|
|
|
|
MIDI::XML::XMFPatchTypePrefix is used for representing XMFPatchTypePrefix objects The XMFPatchTypePrefix meta-event is described in RP-032 from the MMA. It allows specification of using General MIDI 1, General MIDI 2, or DLS to interpret subsequent program change and bank select messages in the same track. |
|
2459
|
|
|
|
|
|
|
|
|
2460
|
|
|
|
|
|
|
=cut |
|
2461
|
|
|
|
|
|
|
|
|
2462
|
|
|
|
|
|
|
#=============================================================================== |
|
2463
|
|
|
|
|
|
|
|
|
2464
|
|
|
|
|
|
|
{ |
|
2465
|
|
|
|
|
|
|
no strict "refs"; |
|
2466
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'XMFPatchTypePrefix'; }; |
|
2467
|
|
|
|
|
|
|
} |
|
2468
|
|
|
|
|
|
|
|
|
2469
|
|
|
|
|
|
|
#=============================================================================== |
|
2470
|
|
|
|
|
|
|
# MIDI::XML::XMFPatchTypePrefix::Value |
|
2471
|
|
|
|
|
|
|
|
|
2472
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
2473
|
|
|
|
|
|
|
|
|
2474
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
2475
|
|
|
|
|
|
|
|
|
2476
|
|
|
|
|
|
|
|
|
2477
|
|
|
|
|
|
|
Type: NMTOKEN |
|
2478
|
|
|
|
|
|
|
Lower: 1 |
|
2479
|
|
|
|
|
|
|
Upper: 1 |
|
2480
|
|
|
|
|
|
|
|
|
2481
|
|
|
|
|
|
|
=cut |
|
2482
|
|
|
|
|
|
|
|
|
2483
|
|
|
|
|
|
|
sub Value() { |
|
2484
|
|
|
|
|
|
|
my $self = shift; |
|
2485
|
|
|
|
|
|
|
if (@_) { |
|
2486
|
|
|
|
|
|
|
if ($_[0] =~ /^[-0-9A-Za-z_.:]+$/ ) { |
|
2487
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
2488
|
|
|
|
|
|
|
} else { |
|
2489
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'NMTOKEN\' for attribute \'Value\''; |
|
2490
|
|
|
|
|
|
|
} |
|
2491
|
|
|
|
|
|
|
} |
|
2492
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
2493
|
|
|
|
|
|
|
} |
|
2494
|
|
|
|
|
|
|
|
|
2495
|
|
|
|
|
|
|
#=============================================================================== |
|
2496
|
|
|
|
|
|
|
|
|
2497
|
|
|
|
|
|
|
#sub _bytes { |
|
2498
|
|
|
|
|
|
|
# my $self = shift; |
|
2499
|
|
|
|
|
|
|
|
|
2500
|
|
|
|
|
|
|
# my @bytes = (0xFF, 0x7E, 0x00); |
|
2501
|
|
|
|
|
|
|
|
|
2502
|
|
|
|
|
|
|
# if(wantarray()) { |
|
2503
|
|
|
|
|
|
|
# return @bytes; |
|
2504
|
|
|
|
|
|
|
# } |
|
2505
|
|
|
|
|
|
|
|
|
2506
|
|
|
|
|
|
|
# return \@bytes; |
|
2507
|
|
|
|
|
|
|
#} |
|
2508
|
|
|
|
|
|
|
|
|
2509
|
|
|
|
|
|
|
##END_PACKAGE XMFPatchTypePrefix |
|
2510
|
|
|
|
|
|
|
|
|
2511
|
|
|
|
|
|
|
#=============================================================================== |
|
2512
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2513
|
|
|
|
|
|
|
# UML Model UUID: cd100a51-45f4-11dd-8bf4-00502c05c241 |
|
2514
|
|
|
|
|
|
|
|
|
2515
|
|
|
|
|
|
|
package MIDI::XML::ChannelMessage; |
|
2516
|
|
|
|
|
|
|
|
|
2517
|
|
|
|
|
|
|
use Carp; |
|
2518
|
|
|
|
|
|
|
|
|
2519
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::SmfEvent); |
|
2520
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2521
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2522
|
|
|
|
|
|
|
|
|
2523
|
|
|
|
|
|
|
=head1 DESCRIPTION of ChannelMessage |
|
2524
|
|
|
|
|
|
|
|
|
2525
|
|
|
|
|
|
|
MIDI::XML::ChannelMessage is used for representing ChannelMessage objects MIDI::XML::Channel is the base class from which MIDI Channel objects are derived. |
|
2526
|
|
|
|
|
|
|
|
|
2527
|
|
|
|
|
|
|
=cut |
|
2528
|
|
|
|
|
|
|
|
|
2529
|
|
|
|
|
|
|
#=============================================================================== |
|
2530
|
|
|
|
|
|
|
|
|
2531
|
|
|
|
|
|
|
{ |
|
2532
|
|
|
|
|
|
|
no strict "refs"; |
|
2533
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ChannelMessage'; }; |
|
2534
|
|
|
|
|
|
|
} |
|
2535
|
|
|
|
|
|
|
|
|
2536
|
|
|
|
|
|
|
#=============================================================================== |
|
2537
|
|
|
|
|
|
|
# MIDI::XML::ChannelMessage::Channel |
|
2538
|
|
|
|
|
|
|
|
|
2539
|
|
|
|
|
|
|
=head2 $value = $Object->Channel([$new_value]); |
|
2540
|
|
|
|
|
|
|
|
|
2541
|
|
|
|
|
|
|
Set or get value of the Channel attribute. |
|
2542
|
|
|
|
|
|
|
|
|
2543
|
|
|
|
|
|
|
|
|
2544
|
|
|
|
|
|
|
Type: nybble |
|
2545
|
|
|
|
|
|
|
Lower: 1 |
|
2546
|
|
|
|
|
|
|
Upper: 1 |
|
2547
|
|
|
|
|
|
|
|
|
2548
|
|
|
|
|
|
|
=cut |
|
2549
|
|
|
|
|
|
|
|
|
2550
|
|
|
|
|
|
|
sub Channel() { |
|
2551
|
|
|
|
|
|
|
my $self = shift; |
|
2552
|
|
|
|
|
|
|
if (@_) { |
|
2553
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2554
|
|
|
|
|
|
|
$self->setAttribute('Channel', shift); |
|
2555
|
|
|
|
|
|
|
} else { |
|
2556
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Channel\''; |
|
2557
|
|
|
|
|
|
|
} |
|
2558
|
|
|
|
|
|
|
} |
|
2559
|
|
|
|
|
|
|
return $self->getAttribute('Channel'); |
|
2560
|
|
|
|
|
|
|
} |
|
2561
|
|
|
|
|
|
|
|
|
2562
|
|
|
|
|
|
|
##END_PACKAGE ChannelMessage |
|
2563
|
|
|
|
|
|
|
|
|
2564
|
|
|
|
|
|
|
#=============================================================================== |
|
2565
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2566
|
|
|
|
|
|
|
# UML Model UUID: d61f6053-45f4-11dd-8bf4-00502c05c241 |
|
2567
|
|
|
|
|
|
|
|
|
2568
|
|
|
|
|
|
|
package MIDI::XML::NoteOff; |
|
2569
|
|
|
|
|
|
|
|
|
2570
|
|
|
|
|
|
|
use Carp; |
|
2571
|
|
|
|
|
|
|
|
|
2572
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ChannelMessage); |
|
2573
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2574
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2575
|
|
|
|
|
|
|
|
|
2576
|
|
|
|
|
|
|
=head1 DESCRIPTION of NoteOff |
|
2577
|
|
|
|
|
|
|
|
|
2578
|
|
|
|
|
|
|
MIDI::XML::NoteOff is used for representing NoteOff objects MIDI::XML::NoteOff is a class encapsulating MIDI Note Off messages. A Note Off message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Note Off event encoded in 3 bytes as follows: |
|
2579
|
|
|
|
|
|
|
|
|
2580
|
|
|
|
|
|
|
1000cccc 0nnnnnnn 0vvvvvvv |
|
2581
|
|
|
|
|
|
|
|
|
2582
|
|
|
|
|
|
|
cccc = channel; |
|
2583
|
|
|
|
|
|
|
nnnnnnn = note number |
|
2584
|
|
|
|
|
|
|
vvvvvvv = velocity |
|
2585
|
|
|
|
|
|
|
|
|
2586
|
|
|
|
|
|
|
The classes for MIDI Note Off messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
2587
|
|
|
|
|
|
|
|
|
2588
|
|
|
|
|
|
|
|
|
2589
|
|
|
|
|
|
|
=cut |
|
2590
|
|
|
|
|
|
|
|
|
2591
|
|
|
|
|
|
|
#=============================================================================== |
|
2592
|
|
|
|
|
|
|
|
|
2593
|
|
|
|
|
|
|
{ |
|
2594
|
|
|
|
|
|
|
no strict "refs"; |
|
2595
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'NoteOff'; }; |
|
2596
|
|
|
|
|
|
|
} |
|
2597
|
|
|
|
|
|
|
|
|
2598
|
|
|
|
|
|
|
#=============================================================================== |
|
2599
|
|
|
|
|
|
|
# MIDI::XML::NoteOff::Note |
|
2600
|
|
|
|
|
|
|
|
|
2601
|
|
|
|
|
|
|
=head2 $value = $Object->Note([$new_value]); |
|
2602
|
|
|
|
|
|
|
|
|
2603
|
|
|
|
|
|
|
Set or get value of the Note attribute. |
|
2604
|
|
|
|
|
|
|
|
|
2605
|
|
|
|
|
|
|
|
|
2606
|
|
|
|
|
|
|
Type: byte |
|
2607
|
|
|
|
|
|
|
Lower: 1 |
|
2608
|
|
|
|
|
|
|
Upper: 1 |
|
2609
|
|
|
|
|
|
|
|
|
2610
|
|
|
|
|
|
|
=cut |
|
2611
|
|
|
|
|
|
|
|
|
2612
|
|
|
|
|
|
|
sub Note() { |
|
2613
|
|
|
|
|
|
|
my $self = shift; |
|
2614
|
|
|
|
|
|
|
if (@_) { |
|
2615
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2616
|
|
|
|
|
|
|
$self->setAttribute('Note', shift); |
|
2617
|
|
|
|
|
|
|
} else { |
|
2618
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Note\''; |
|
2619
|
|
|
|
|
|
|
} |
|
2620
|
|
|
|
|
|
|
} |
|
2621
|
|
|
|
|
|
|
return $self->getAttribute('Note'); |
|
2622
|
|
|
|
|
|
|
} |
|
2623
|
|
|
|
|
|
|
|
|
2624
|
|
|
|
|
|
|
#=============================================================================== |
|
2625
|
|
|
|
|
|
|
# MIDI::XML::NoteOff::Velocity |
|
2626
|
|
|
|
|
|
|
|
|
2627
|
|
|
|
|
|
|
=head2 $value = $Object->Velocity([$new_value]); |
|
2628
|
|
|
|
|
|
|
|
|
2629
|
|
|
|
|
|
|
Set or get value of the Velocity attribute. |
|
2630
|
|
|
|
|
|
|
|
|
2631
|
|
|
|
|
|
|
|
|
2632
|
|
|
|
|
|
|
Type: byte |
|
2633
|
|
|
|
|
|
|
Lower: 1 |
|
2634
|
|
|
|
|
|
|
Upper: 1 |
|
2635
|
|
|
|
|
|
|
|
|
2636
|
|
|
|
|
|
|
=cut |
|
2637
|
|
|
|
|
|
|
|
|
2638
|
|
|
|
|
|
|
sub Velocity() { |
|
2639
|
|
|
|
|
|
|
my $self = shift; |
|
2640
|
|
|
|
|
|
|
if (@_) { |
|
2641
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2642
|
|
|
|
|
|
|
$self->setAttribute('Velocity', shift); |
|
2643
|
|
|
|
|
|
|
} else { |
|
2644
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Velocity\''; |
|
2645
|
|
|
|
|
|
|
} |
|
2646
|
|
|
|
|
|
|
} |
|
2647
|
|
|
|
|
|
|
return $self->getAttribute('Velocity'); |
|
2648
|
|
|
|
|
|
|
} |
|
2649
|
|
|
|
|
|
|
|
|
2650
|
|
|
|
|
|
|
#=============================================================================== |
|
2651
|
|
|
|
|
|
|
|
|
2652
|
|
|
|
|
|
|
sub _bytes { |
|
2653
|
|
|
|
|
|
|
my $self = shift; |
|
2654
|
|
|
|
|
|
|
|
|
2655
|
|
|
|
|
|
|
my $status = 0x80+$self->Channel()-1; |
|
2656
|
|
|
|
|
|
|
my $d1 = $self->Note(); |
|
2657
|
|
|
|
|
|
|
my $d2 = $self->Velocity(); |
|
2658
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2); |
|
2659
|
|
|
|
|
|
|
|
|
2660
|
|
|
|
|
|
|
if(wantarray()) { |
|
2661
|
|
|
|
|
|
|
return @bytes; |
|
2662
|
|
|
|
|
|
|
} |
|
2663
|
|
|
|
|
|
|
|
|
2664
|
|
|
|
|
|
|
return \@bytes; |
|
2665
|
|
|
|
|
|
|
} |
|
2666
|
|
|
|
|
|
|
|
|
2667
|
|
|
|
|
|
|
##END_PACKAGE NoteOff |
|
2668
|
|
|
|
|
|
|
|
|
2669
|
|
|
|
|
|
|
#=============================================================================== |
|
2670
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2671
|
|
|
|
|
|
|
# UML Model UUID: 09512676-45f5-11dd-8bf4-00502c05c241 |
|
2672
|
|
|
|
|
|
|
|
|
2673
|
|
|
|
|
|
|
package MIDI::XML::NoteOn; |
|
2674
|
|
|
|
|
|
|
|
|
2675
|
|
|
|
|
|
|
use Carp; |
|
2676
|
|
|
|
|
|
|
|
|
2677
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ChannelMessage); |
|
2678
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2679
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2680
|
|
|
|
|
|
|
|
|
2681
|
|
|
|
|
|
|
=head1 DESCRIPTION of NoteOn |
|
2682
|
|
|
|
|
|
|
|
|
2683
|
|
|
|
|
|
|
MIDI::XML::NoteOn is used for representing NoteOn objects MIDI::XML::NoteOn is a class encapsulating MIDI Note On messages. A Note On message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Note On event encoded in 3 bytes as follows: |
|
2684
|
|
|
|
|
|
|
|
|
2685
|
|
|
|
|
|
|
1001cccc 0nnnnnnn 0vvvvvvv |
|
2686
|
|
|
|
|
|
|
|
|
2687
|
|
|
|
|
|
|
cccc = channel; |
|
2688
|
|
|
|
|
|
|
nnnnnnn = note number |
|
2689
|
|
|
|
|
|
|
vvvvvvv = velocity |
|
2690
|
|
|
|
|
|
|
|
|
2691
|
|
|
|
|
|
|
The classes for MIDI Note On messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
2692
|
|
|
|
|
|
|
|
|
2693
|
|
|
|
|
|
|
|
|
2694
|
|
|
|
|
|
|
=cut |
|
2695
|
|
|
|
|
|
|
|
|
2696
|
|
|
|
|
|
|
#=============================================================================== |
|
2697
|
|
|
|
|
|
|
|
|
2698
|
|
|
|
|
|
|
{ |
|
2699
|
|
|
|
|
|
|
no strict "refs"; |
|
2700
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'NoteOn'; }; |
|
2701
|
|
|
|
|
|
|
} |
|
2702
|
|
|
|
|
|
|
|
|
2703
|
|
|
|
|
|
|
#=============================================================================== |
|
2704
|
|
|
|
|
|
|
# MIDI::XML::NoteOn::Note |
|
2705
|
|
|
|
|
|
|
|
|
2706
|
|
|
|
|
|
|
=head2 $value = $Object->Note([$new_value]); |
|
2707
|
|
|
|
|
|
|
|
|
2708
|
|
|
|
|
|
|
Set or get value of the Note attribute. |
|
2709
|
|
|
|
|
|
|
|
|
2710
|
|
|
|
|
|
|
|
|
2711
|
|
|
|
|
|
|
Type: byte |
|
2712
|
|
|
|
|
|
|
Lower: 1 |
|
2713
|
|
|
|
|
|
|
Upper: 1 |
|
2714
|
|
|
|
|
|
|
|
|
2715
|
|
|
|
|
|
|
=cut |
|
2716
|
|
|
|
|
|
|
|
|
2717
|
|
|
|
|
|
|
sub Note() { |
|
2718
|
|
|
|
|
|
|
my $self = shift; |
|
2719
|
|
|
|
|
|
|
if (@_) { |
|
2720
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2721
|
|
|
|
|
|
|
$self->setAttribute('Note', shift); |
|
2722
|
|
|
|
|
|
|
} else { |
|
2723
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Note\''; |
|
2724
|
|
|
|
|
|
|
} |
|
2725
|
|
|
|
|
|
|
} |
|
2726
|
|
|
|
|
|
|
return $self->getAttribute('Note'); |
|
2727
|
|
|
|
|
|
|
} |
|
2728
|
|
|
|
|
|
|
|
|
2729
|
|
|
|
|
|
|
#=============================================================================== |
|
2730
|
|
|
|
|
|
|
# MIDI::XML::NoteOn::Velocity |
|
2731
|
|
|
|
|
|
|
|
|
2732
|
|
|
|
|
|
|
=head2 $value = $Object->Velocity([$new_value]); |
|
2733
|
|
|
|
|
|
|
|
|
2734
|
|
|
|
|
|
|
Set or get value of the Velocity attribute. |
|
2735
|
|
|
|
|
|
|
|
|
2736
|
|
|
|
|
|
|
|
|
2737
|
|
|
|
|
|
|
Type: byte |
|
2738
|
|
|
|
|
|
|
Lower: 1 |
|
2739
|
|
|
|
|
|
|
Upper: 1 |
|
2740
|
|
|
|
|
|
|
|
|
2741
|
|
|
|
|
|
|
=cut |
|
2742
|
|
|
|
|
|
|
|
|
2743
|
|
|
|
|
|
|
sub Velocity() { |
|
2744
|
|
|
|
|
|
|
my $self = shift; |
|
2745
|
|
|
|
|
|
|
if (@_) { |
|
2746
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2747
|
|
|
|
|
|
|
$self->setAttribute('Velocity', shift); |
|
2748
|
|
|
|
|
|
|
} else { |
|
2749
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Velocity\''; |
|
2750
|
|
|
|
|
|
|
} |
|
2751
|
|
|
|
|
|
|
} |
|
2752
|
|
|
|
|
|
|
return $self->getAttribute('Velocity'); |
|
2753
|
|
|
|
|
|
|
} |
|
2754
|
|
|
|
|
|
|
|
|
2755
|
|
|
|
|
|
|
#=============================================================================== |
|
2756
|
|
|
|
|
|
|
|
|
2757
|
|
|
|
|
|
|
sub _bytes { |
|
2758
|
|
|
|
|
|
|
my $self = shift; |
|
2759
|
|
|
|
|
|
|
|
|
2760
|
|
|
|
|
|
|
my $status = 0x90+$self->Channel()-1; |
|
2761
|
|
|
|
|
|
|
my $d1 = $self->Note(); |
|
2762
|
|
|
|
|
|
|
my $d2 = $self->Velocity(); |
|
2763
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2); |
|
2764
|
|
|
|
|
|
|
|
|
2765
|
|
|
|
|
|
|
if(wantarray()) { |
|
2766
|
|
|
|
|
|
|
return @bytes; |
|
2767
|
|
|
|
|
|
|
} |
|
2768
|
|
|
|
|
|
|
|
|
2769
|
|
|
|
|
|
|
return \@bytes; |
|
2770
|
|
|
|
|
|
|
} |
|
2771
|
|
|
|
|
|
|
|
|
2772
|
|
|
|
|
|
|
##END_PACKAGE NoteOn |
|
2773
|
|
|
|
|
|
|
|
|
2774
|
|
|
|
|
|
|
#=============================================================================== |
|
2775
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2776
|
|
|
|
|
|
|
# UML Model UUID: ad7f2df9-45f5-11dd-8bf4-00502c05c241 |
|
2777
|
|
|
|
|
|
|
|
|
2778
|
|
|
|
|
|
|
package MIDI::XML::PolyKeyPressure; |
|
2779
|
|
|
|
|
|
|
|
|
2780
|
|
|
|
|
|
|
use Carp; |
|
2781
|
|
|
|
|
|
|
|
|
2782
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ChannelMessage); |
|
2783
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2784
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2785
|
|
|
|
|
|
|
|
|
2786
|
|
|
|
|
|
|
=head1 DESCRIPTION of PolyKeyPressure |
|
2787
|
|
|
|
|
|
|
|
|
2788
|
|
|
|
|
|
|
MIDI::XML::PolyKeyPressure is used for representing PolyKeyPressure objects MIDI::XML::PolyKeyPressure is a class encapsulating MIDI Poly Key Pressure messages. A Poly Key Pressure message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Poly Key Pressure event encoded in 3 bytes as follows: |
|
2789
|
|
|
|
|
|
|
|
|
2790
|
|
|
|
|
|
|
1010cccc 0nnnnnnn 0ppppppp |
|
2791
|
|
|
|
|
|
|
|
|
2792
|
|
|
|
|
|
|
cccc = channel; |
|
2793
|
|
|
|
|
|
|
nnnnnnn = note number |
|
2794
|
|
|
|
|
|
|
ppppppp = pressure |
|
2795
|
|
|
|
|
|
|
|
|
2796
|
|
|
|
|
|
|
The classes for MIDI Poly Key Pressure messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
2797
|
|
|
|
|
|
|
|
|
2798
|
|
|
|
|
|
|
|
|
2799
|
|
|
|
|
|
|
=cut |
|
2800
|
|
|
|
|
|
|
|
|
2801
|
|
|
|
|
|
|
#=============================================================================== |
|
2802
|
|
|
|
|
|
|
|
|
2803
|
|
|
|
|
|
|
{ |
|
2804
|
|
|
|
|
|
|
no strict "refs"; |
|
2805
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'PolyKeyPressure'; }; |
|
2806
|
|
|
|
|
|
|
} |
|
2807
|
|
|
|
|
|
|
|
|
2808
|
|
|
|
|
|
|
#=============================================================================== |
|
2809
|
|
|
|
|
|
|
# MIDI::XML::PolyKeyPressure::Note |
|
2810
|
|
|
|
|
|
|
|
|
2811
|
|
|
|
|
|
|
=head2 $value = $Object->Note([$new_value]); |
|
2812
|
|
|
|
|
|
|
|
|
2813
|
|
|
|
|
|
|
Set or get value of the Note attribute. |
|
2814
|
|
|
|
|
|
|
|
|
2815
|
|
|
|
|
|
|
|
|
2816
|
|
|
|
|
|
|
Type: byte |
|
2817
|
|
|
|
|
|
|
Lower: 1 |
|
2818
|
|
|
|
|
|
|
Upper: 1 |
|
2819
|
|
|
|
|
|
|
|
|
2820
|
|
|
|
|
|
|
=cut |
|
2821
|
|
|
|
|
|
|
|
|
2822
|
|
|
|
|
|
|
sub Note() { |
|
2823
|
|
|
|
|
|
|
my $self = shift; |
|
2824
|
|
|
|
|
|
|
if (@_) { |
|
2825
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2826
|
|
|
|
|
|
|
$self->setAttribute('Note', shift); |
|
2827
|
|
|
|
|
|
|
} else { |
|
2828
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Note\''; |
|
2829
|
|
|
|
|
|
|
} |
|
2830
|
|
|
|
|
|
|
} |
|
2831
|
|
|
|
|
|
|
return $self->getAttribute('Note'); |
|
2832
|
|
|
|
|
|
|
} |
|
2833
|
|
|
|
|
|
|
|
|
2834
|
|
|
|
|
|
|
#=============================================================================== |
|
2835
|
|
|
|
|
|
|
# MIDI::XML::PolyKeyPressure::Pressure |
|
2836
|
|
|
|
|
|
|
|
|
2837
|
|
|
|
|
|
|
=head2 $value = $Object->Pressure([$new_value]); |
|
2838
|
|
|
|
|
|
|
|
|
2839
|
|
|
|
|
|
|
Set or get value of the Pressure attribute. |
|
2840
|
|
|
|
|
|
|
|
|
2841
|
|
|
|
|
|
|
|
|
2842
|
|
|
|
|
|
|
Type: byte |
|
2843
|
|
|
|
|
|
|
Lower: 1 |
|
2844
|
|
|
|
|
|
|
Upper: 1 |
|
2845
|
|
|
|
|
|
|
|
|
2846
|
|
|
|
|
|
|
=cut |
|
2847
|
|
|
|
|
|
|
|
|
2848
|
|
|
|
|
|
|
sub Pressure() { |
|
2849
|
|
|
|
|
|
|
my $self = shift; |
|
2850
|
|
|
|
|
|
|
if (@_) { |
|
2851
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2852
|
|
|
|
|
|
|
$self->setAttribute('Pressure', shift); |
|
2853
|
|
|
|
|
|
|
} else { |
|
2854
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Pressure\''; |
|
2855
|
|
|
|
|
|
|
} |
|
2856
|
|
|
|
|
|
|
} |
|
2857
|
|
|
|
|
|
|
return $self->getAttribute('Pressure'); |
|
2858
|
|
|
|
|
|
|
} |
|
2859
|
|
|
|
|
|
|
|
|
2860
|
|
|
|
|
|
|
#=============================================================================== |
|
2861
|
|
|
|
|
|
|
|
|
2862
|
|
|
|
|
|
|
sub _bytes { |
|
2863
|
|
|
|
|
|
|
my $self = shift; |
|
2864
|
|
|
|
|
|
|
|
|
2865
|
|
|
|
|
|
|
my $status = 0xA0+$self->Channel()-1; |
|
2866
|
|
|
|
|
|
|
my $d1 = $self->Note(); |
|
2867
|
|
|
|
|
|
|
my $d2 = $self->Pressure(); |
|
2868
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2); |
|
2869
|
|
|
|
|
|
|
|
|
2870
|
|
|
|
|
|
|
if(wantarray()) { |
|
2871
|
|
|
|
|
|
|
return @bytes; |
|
2872
|
|
|
|
|
|
|
} |
|
2873
|
|
|
|
|
|
|
|
|
2874
|
|
|
|
|
|
|
return \@bytes; |
|
2875
|
|
|
|
|
|
|
} |
|
2876
|
|
|
|
|
|
|
|
|
2877
|
|
|
|
|
|
|
##END_PACKAGE PolyKeyPressure |
|
2878
|
|
|
|
|
|
|
|
|
2879
|
|
|
|
|
|
|
#=============================================================================== |
|
2880
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2881
|
|
|
|
|
|
|
# UML Model UUID: 4489733c-45f7-11dd-8bf4-00502c05c241 |
|
2882
|
|
|
|
|
|
|
|
|
2883
|
|
|
|
|
|
|
package MIDI::XML::ControlChangeMessage; |
|
2884
|
|
|
|
|
|
|
|
|
2885
|
|
|
|
|
|
|
use Carp; |
|
2886
|
|
|
|
|
|
|
|
|
2887
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ChannelMessage); |
|
2888
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2889
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2890
|
|
|
|
|
|
|
|
|
2891
|
|
|
|
|
|
|
=head1 DESCRIPTION of ControlChangeMessage |
|
2892
|
|
|
|
|
|
|
|
|
2893
|
|
|
|
|
|
|
MIDI::XML::ControlChangeMessage is used for representing ControlChangeMessage objects MIDI::XML::ControlChangeMessage is a class encapsulating MIDI Control Change messages. A Control Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Control Change event encoded in 3 bytes as follows: |
|
2894
|
|
|
|
|
|
|
|
|
2895
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
2896
|
|
|
|
|
|
|
|
|
2897
|
|
|
|
|
|
|
cccc = channel; |
|
2898
|
|
|
|
|
|
|
nnnnnnn = control number |
|
2899
|
|
|
|
|
|
|
vvvvvvv = value |
|
2900
|
|
|
|
|
|
|
|
|
2901
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
2902
|
|
|
|
|
|
|
|
|
2903
|
|
|
|
|
|
|
|
|
2904
|
|
|
|
|
|
|
=cut |
|
2905
|
|
|
|
|
|
|
|
|
2906
|
|
|
|
|
|
|
#=============================================================================== |
|
2907
|
|
|
|
|
|
|
|
|
2908
|
|
|
|
|
|
|
{ |
|
2909
|
|
|
|
|
|
|
no strict "refs"; |
|
2910
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'control-change-message'; }; |
|
2911
|
|
|
|
|
|
|
} |
|
2912
|
|
|
|
|
|
|
|
|
2913
|
|
|
|
|
|
|
#=============================================================================== |
|
2914
|
|
|
|
|
|
|
|
|
2915
|
|
|
|
|
|
|
sub _bytes { |
|
2916
|
|
|
|
|
|
|
my $self = shift; |
|
2917
|
|
|
|
|
|
|
|
|
2918
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
2919
|
|
|
|
|
|
|
my $d1 = $self->Control(); |
|
2920
|
|
|
|
|
|
|
my $d2 = $self->Value(); |
|
2921
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2); |
|
2922
|
|
|
|
|
|
|
|
|
2923
|
|
|
|
|
|
|
if(wantarray()) { |
|
2924
|
|
|
|
|
|
|
return @bytes; |
|
2925
|
|
|
|
|
|
|
} |
|
2926
|
|
|
|
|
|
|
|
|
2927
|
|
|
|
|
|
|
return \@bytes; |
|
2928
|
|
|
|
|
|
|
} |
|
2929
|
|
|
|
|
|
|
|
|
2930
|
|
|
|
|
|
|
##END_PACKAGE ControlChangeMessage |
|
2931
|
|
|
|
|
|
|
|
|
2932
|
|
|
|
|
|
|
#=============================================================================== |
|
2933
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
2934
|
|
|
|
|
|
|
# UML Model UUID: 589178af-45f7-11dd-8bf4-00502c05c241 |
|
2935
|
|
|
|
|
|
|
|
|
2936
|
|
|
|
|
|
|
package MIDI::XML::ProgramChange; |
|
2937
|
|
|
|
|
|
|
|
|
2938
|
|
|
|
|
|
|
use Carp; |
|
2939
|
|
|
|
|
|
|
|
|
2940
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ChannelMessage); |
|
2941
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
2942
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
2943
|
|
|
|
|
|
|
|
|
2944
|
|
|
|
|
|
|
=head1 DESCRIPTION of ProgramChange |
|
2945
|
|
|
|
|
|
|
|
|
2946
|
|
|
|
|
|
|
MIDI::XML::ProgramChange is used for representing ProgramChange objects MIDI::XML::ProgramChange is a class encapsulating MIDI Program Change messages. |
|
2947
|
|
|
|
|
|
|
A Program_Change message includes either a delta time or absolute time as |
|
2948
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Program Change event encoded |
|
2949
|
|
|
|
|
|
|
in 2 bytes as follows: |
|
2950
|
|
|
|
|
|
|
|
|
2951
|
|
|
|
|
|
|
1100cccc 0nnnnnnn |
|
2952
|
|
|
|
|
|
|
|
|
2953
|
|
|
|
|
|
|
cccc = channel; |
|
2954
|
|
|
|
|
|
|
nnnnnnn = program number |
|
2955
|
|
|
|
|
|
|
|
|
2956
|
|
|
|
|
|
|
The classes for MIDI Program Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
2957
|
|
|
|
|
|
|
|
|
2958
|
|
|
|
|
|
|
|
|
2959
|
|
|
|
|
|
|
=cut |
|
2960
|
|
|
|
|
|
|
|
|
2961
|
|
|
|
|
|
|
#=============================================================================== |
|
2962
|
|
|
|
|
|
|
|
|
2963
|
|
|
|
|
|
|
{ |
|
2964
|
|
|
|
|
|
|
no strict "refs"; |
|
2965
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ProgramChange'; }; |
|
2966
|
|
|
|
|
|
|
} |
|
2967
|
|
|
|
|
|
|
|
|
2968
|
|
|
|
|
|
|
#=============================================================================== |
|
2969
|
|
|
|
|
|
|
# MIDI::XML::ProgramChange::Number |
|
2970
|
|
|
|
|
|
|
|
|
2971
|
|
|
|
|
|
|
=head2 $value = $Object->Number([$new_value]); |
|
2972
|
|
|
|
|
|
|
|
|
2973
|
|
|
|
|
|
|
Set or get value of the Number attribute. |
|
2974
|
|
|
|
|
|
|
|
|
2975
|
|
|
|
|
|
|
|
|
2976
|
|
|
|
|
|
|
Type: byte |
|
2977
|
|
|
|
|
|
|
Lower: 1 |
|
2978
|
|
|
|
|
|
|
Upper: 1 |
|
2979
|
|
|
|
|
|
|
|
|
2980
|
|
|
|
|
|
|
=cut |
|
2981
|
|
|
|
|
|
|
|
|
2982
|
|
|
|
|
|
|
sub Number() { |
|
2983
|
|
|
|
|
|
|
my $self = shift; |
|
2984
|
|
|
|
|
|
|
if (@_) { |
|
2985
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
2986
|
|
|
|
|
|
|
$self->setAttribute('Number', shift); |
|
2987
|
|
|
|
|
|
|
} else { |
|
2988
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Number\''; |
|
2989
|
|
|
|
|
|
|
} |
|
2990
|
|
|
|
|
|
|
} |
|
2991
|
|
|
|
|
|
|
return $self->getAttribute('Number'); |
|
2992
|
|
|
|
|
|
|
} |
|
2993
|
|
|
|
|
|
|
|
|
2994
|
|
|
|
|
|
|
#=============================================================================== |
|
2995
|
|
|
|
|
|
|
|
|
2996
|
|
|
|
|
|
|
sub _bytes { |
|
2997
|
|
|
|
|
|
|
my $self = shift; |
|
2998
|
|
|
|
|
|
|
|
|
2999
|
|
|
|
|
|
|
my $status = 0xC0+$self->Channel()-1; |
|
3000
|
|
|
|
|
|
|
my $d1 = $self->Number(); |
|
3001
|
|
|
|
|
|
|
my @bytes = ($status, $d1); |
|
3002
|
|
|
|
|
|
|
|
|
3003
|
|
|
|
|
|
|
if(wantarray()) { |
|
3004
|
|
|
|
|
|
|
return @bytes; |
|
3005
|
|
|
|
|
|
|
} |
|
3006
|
|
|
|
|
|
|
|
|
3007
|
|
|
|
|
|
|
return \@bytes; |
|
3008
|
|
|
|
|
|
|
} |
|
3009
|
|
|
|
|
|
|
|
|
3010
|
|
|
|
|
|
|
##END_PACKAGE ProgramChange |
|
3011
|
|
|
|
|
|
|
|
|
3012
|
|
|
|
|
|
|
#=============================================================================== |
|
3013
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3014
|
|
|
|
|
|
|
# UML Model UUID: 9be6de22-45f7-11dd-8bf4-00502c05c241 |
|
3015
|
|
|
|
|
|
|
|
|
3016
|
|
|
|
|
|
|
package MIDI::XML::ChannelKeyPressure; |
|
3017
|
|
|
|
|
|
|
|
|
3018
|
|
|
|
|
|
|
use Carp; |
|
3019
|
|
|
|
|
|
|
|
|
3020
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ChannelMessage); |
|
3021
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3022
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3023
|
|
|
|
|
|
|
|
|
3024
|
|
|
|
|
|
|
=head1 DESCRIPTION of ChannelKeyPressure |
|
3025
|
|
|
|
|
|
|
|
|
3026
|
|
|
|
|
|
|
MIDI::XML::ChannelKeyPressure is used for representing ChannelKeyPressure objects MIDI::XML::ChannelKeyPressure is a class encapsulating MIDI Channel Key Pressure |
|
3027
|
|
|
|
|
|
|
messages. A Channel Key Pressure message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Channel Key Pressure event encoded in 2 bytes as follows: |
|
3028
|
|
|
|
|
|
|
|
|
3029
|
|
|
|
|
|
|
1101cccc 0ppppppp |
|
3030
|
|
|
|
|
|
|
|
|
3031
|
|
|
|
|
|
|
cccc = channel; |
|
3032
|
|
|
|
|
|
|
ppppppp = pressure |
|
3033
|
|
|
|
|
|
|
|
|
3034
|
|
|
|
|
|
|
The classes for MIDI Channel Key Pressure messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3035
|
|
|
|
|
|
|
|
|
3036
|
|
|
|
|
|
|
|
|
3037
|
|
|
|
|
|
|
=cut |
|
3038
|
|
|
|
|
|
|
|
|
3039
|
|
|
|
|
|
|
#=============================================================================== |
|
3040
|
|
|
|
|
|
|
|
|
3041
|
|
|
|
|
|
|
{ |
|
3042
|
|
|
|
|
|
|
no strict "refs"; |
|
3043
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ChannelKeyPressure'; }; |
|
3044
|
|
|
|
|
|
|
} |
|
3045
|
|
|
|
|
|
|
|
|
3046
|
|
|
|
|
|
|
#=============================================================================== |
|
3047
|
|
|
|
|
|
|
# MIDI::XML::ChannelKeyPressure::Pressure |
|
3048
|
|
|
|
|
|
|
|
|
3049
|
|
|
|
|
|
|
=head2 $value = $Object->Pressure([$new_value]); |
|
3050
|
|
|
|
|
|
|
|
|
3051
|
|
|
|
|
|
|
Set or get value of the Pressure attribute. |
|
3052
|
|
|
|
|
|
|
|
|
3053
|
|
|
|
|
|
|
|
|
3054
|
|
|
|
|
|
|
Type: byte |
|
3055
|
|
|
|
|
|
|
Lower: 1 |
|
3056
|
|
|
|
|
|
|
Upper: 1 |
|
3057
|
|
|
|
|
|
|
|
|
3058
|
|
|
|
|
|
|
=cut |
|
3059
|
|
|
|
|
|
|
|
|
3060
|
|
|
|
|
|
|
sub Pressure() { |
|
3061
|
|
|
|
|
|
|
my $self = shift; |
|
3062
|
|
|
|
|
|
|
if (@_) { |
|
3063
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3064
|
|
|
|
|
|
|
$self->setAttribute('Pressure', shift); |
|
3065
|
|
|
|
|
|
|
} else { |
|
3066
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Pressure\''; |
|
3067
|
|
|
|
|
|
|
} |
|
3068
|
|
|
|
|
|
|
} |
|
3069
|
|
|
|
|
|
|
return $self->getAttribute('Pressure'); |
|
3070
|
|
|
|
|
|
|
} |
|
3071
|
|
|
|
|
|
|
|
|
3072
|
|
|
|
|
|
|
#=============================================================================== |
|
3073
|
|
|
|
|
|
|
|
|
3074
|
|
|
|
|
|
|
sub _bytes { |
|
3075
|
|
|
|
|
|
|
my $self = shift; |
|
3076
|
|
|
|
|
|
|
|
|
3077
|
|
|
|
|
|
|
my $status = 0xD0+$self->Channel()-1; |
|
3078
|
|
|
|
|
|
|
my $d1 = $self->Pressure(); |
|
3079
|
|
|
|
|
|
|
my @bytes = ($status, $d1); |
|
3080
|
|
|
|
|
|
|
|
|
3081
|
|
|
|
|
|
|
if(wantarray()) { |
|
3082
|
|
|
|
|
|
|
return @bytes; |
|
3083
|
|
|
|
|
|
|
} |
|
3084
|
|
|
|
|
|
|
|
|
3085
|
|
|
|
|
|
|
return \@bytes; |
|
3086
|
|
|
|
|
|
|
} |
|
3087
|
|
|
|
|
|
|
|
|
3088
|
|
|
|
|
|
|
##END_PACKAGE ChannelKeyPressure |
|
3089
|
|
|
|
|
|
|
|
|
3090
|
|
|
|
|
|
|
#=============================================================================== |
|
3091
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3092
|
|
|
|
|
|
|
# UML Model UUID: e28701c5-45f7-11dd-8bf4-00502c05c241 |
|
3093
|
|
|
|
|
|
|
|
|
3094
|
|
|
|
|
|
|
package MIDI::XML::PitchBendChange; |
|
3095
|
|
|
|
|
|
|
|
|
3096
|
|
|
|
|
|
|
use Carp; |
|
3097
|
|
|
|
|
|
|
|
|
3098
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ChannelMessage); |
|
3099
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3100
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3101
|
|
|
|
|
|
|
|
|
3102
|
|
|
|
|
|
|
=head1 DESCRIPTION of PitchBendChange |
|
3103
|
|
|
|
|
|
|
|
|
3104
|
|
|
|
|
|
|
MIDI::XML::PitchBendChange is used for representing PitchBendChange objects MIDI::XML::PitchBendChange is a class encapsulating MIDI Pitch Bend Change messages. A Pitch Bend Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Pitch Bend Change event encoded in 3 bytes as follows: |
|
3105
|
|
|
|
|
|
|
|
|
3106
|
|
|
|
|
|
|
1110cccc 0xxxxxxx 0yyyyyyy |
|
3107
|
|
|
|
|
|
|
|
|
3108
|
|
|
|
|
|
|
cccc = channel; |
|
3109
|
|
|
|
|
|
|
xxxxxxx = least significant bits |
|
3110
|
|
|
|
|
|
|
yyyyyyy = most significant bits |
|
3111
|
|
|
|
|
|
|
|
|
3112
|
|
|
|
|
|
|
The classes for MIDI Pitch Bend messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3113
|
|
|
|
|
|
|
|
|
3114
|
|
|
|
|
|
|
|
|
3115
|
|
|
|
|
|
|
=cut |
|
3116
|
|
|
|
|
|
|
|
|
3117
|
|
|
|
|
|
|
#=============================================================================== |
|
3118
|
|
|
|
|
|
|
|
|
3119
|
|
|
|
|
|
|
{ |
|
3120
|
|
|
|
|
|
|
no strict "refs"; |
|
3121
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'PitchBendChange'; }; |
|
3122
|
|
|
|
|
|
|
} |
|
3123
|
|
|
|
|
|
|
|
|
3124
|
|
|
|
|
|
|
#=============================================================================== |
|
3125
|
|
|
|
|
|
|
# MIDI::XML::PitchBendChange::Value |
|
3126
|
|
|
|
|
|
|
|
|
3127
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
3128
|
|
|
|
|
|
|
|
|
3129
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
3130
|
|
|
|
|
|
|
|
|
3131
|
|
|
|
|
|
|
|
|
3132
|
|
|
|
|
|
|
Type: short |
|
3133
|
|
|
|
|
|
|
Lower: 1 |
|
3134
|
|
|
|
|
|
|
Upper: 1 |
|
3135
|
|
|
|
|
|
|
|
|
3136
|
|
|
|
|
|
|
=cut |
|
3137
|
|
|
|
|
|
|
|
|
3138
|
|
|
|
|
|
|
sub Value() { |
|
3139
|
|
|
|
|
|
|
my $self = shift; |
|
3140
|
|
|
|
|
|
|
if (@_) { |
|
3141
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3142
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
3143
|
|
|
|
|
|
|
} else { |
|
3144
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
3145
|
|
|
|
|
|
|
} |
|
3146
|
|
|
|
|
|
|
} |
|
3147
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
3148
|
|
|
|
|
|
|
} |
|
3149
|
|
|
|
|
|
|
|
|
3150
|
|
|
|
|
|
|
#=============================================================================== |
|
3151
|
|
|
|
|
|
|
|
|
3152
|
|
|
|
|
|
|
sub _bytes { |
|
3153
|
|
|
|
|
|
|
my $self = shift; |
|
3154
|
|
|
|
|
|
|
|
|
3155
|
|
|
|
|
|
|
my $status = 0xE0+$self->Channel()-1; |
|
3156
|
|
|
|
|
|
|
my $v = $self->Value(); |
|
3157
|
|
|
|
|
|
|
my $d1 = ($v >> 7) &0x7f; |
|
3158
|
|
|
|
|
|
|
my $d2 = $v & 0x7F; |
|
3159
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2); |
|
3160
|
|
|
|
|
|
|
|
|
3161
|
|
|
|
|
|
|
if(wantarray()) { |
|
3162
|
|
|
|
|
|
|
return @bytes; |
|
3163
|
|
|
|
|
|
|
} |
|
3164
|
|
|
|
|
|
|
|
|
3165
|
|
|
|
|
|
|
return \@bytes; |
|
3166
|
|
|
|
|
|
|
} |
|
3167
|
|
|
|
|
|
|
|
|
3168
|
|
|
|
|
|
|
##END_PACKAGE PitchBendChange |
|
3169
|
|
|
|
|
|
|
|
|
3170
|
|
|
|
|
|
|
#=============================================================================== |
|
3171
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3172
|
|
|
|
|
|
|
# UML Model UUID: cde37ce1-463d-11dd-8bf4-00502c05c241 |
|
3173
|
|
|
|
|
|
|
|
|
3174
|
|
|
|
|
|
|
package MIDI::XML::AllSoundOff; |
|
3175
|
|
|
|
|
|
|
|
|
3176
|
|
|
|
|
|
|
use Carp; |
|
3177
|
|
|
|
|
|
|
|
|
3178
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3179
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3180
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3181
|
|
|
|
|
|
|
|
|
3182
|
|
|
|
|
|
|
=head1 DESCRIPTION of AllSoundOff |
|
3183
|
|
|
|
|
|
|
|
|
3184
|
|
|
|
|
|
|
MIDI::XML::AllSoundOff is used for representing AllSoundOff objects MIDI::XML::AllSoundOff is a class encapsulating MIDI All Sound Off messages. An All Sound Off message includes either a delta time or absolute time as |
|
3185
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI All Sound Off event encoded in 3 bytes as follows: |
|
3186
|
|
|
|
|
|
|
|
|
3187
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3188
|
|
|
|
|
|
|
|
|
3189
|
|
|
|
|
|
|
cccc = channel; |
|
3190
|
|
|
|
|
|
|
nnnnnnn = control number (120) |
|
3191
|
|
|
|
|
|
|
vvvvvvv = value (0) |
|
3192
|
|
|
|
|
|
|
|
|
3193
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3194
|
|
|
|
|
|
|
|
|
3195
|
|
|
|
|
|
|
=cut |
|
3196
|
|
|
|
|
|
|
|
|
3197
|
|
|
|
|
|
|
#=============================================================================== |
|
3198
|
|
|
|
|
|
|
|
|
3199
|
|
|
|
|
|
|
{ |
|
3200
|
|
|
|
|
|
|
no strict "refs"; |
|
3201
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'AllSoundOff'; }; |
|
3202
|
|
|
|
|
|
|
} |
|
3203
|
|
|
|
|
|
|
|
|
3204
|
|
|
|
|
|
|
#=============================================================================== |
|
3205
|
|
|
|
|
|
|
|
|
3206
|
|
|
|
|
|
|
sub _bytes { |
|
3207
|
|
|
|
|
|
|
my $self = shift; |
|
3208
|
|
|
|
|
|
|
|
|
3209
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3210
|
|
|
|
|
|
|
my @bytes = ($status, 120, 0); |
|
3211
|
|
|
|
|
|
|
|
|
3212
|
|
|
|
|
|
|
if(wantarray()) { |
|
3213
|
|
|
|
|
|
|
return @bytes; |
|
3214
|
|
|
|
|
|
|
} |
|
3215
|
|
|
|
|
|
|
|
|
3216
|
|
|
|
|
|
|
return \@bytes; |
|
3217
|
|
|
|
|
|
|
} |
|
3218
|
|
|
|
|
|
|
|
|
3219
|
|
|
|
|
|
|
##END_PACKAGE AllSoundOff |
|
3220
|
|
|
|
|
|
|
|
|
3221
|
|
|
|
|
|
|
#=============================================================================== |
|
3222
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3223
|
|
|
|
|
|
|
# UML Model UUID: 47c481d4-463e-11dd-8bf4-00502c05c241 |
|
3224
|
|
|
|
|
|
|
|
|
3225
|
|
|
|
|
|
|
package MIDI::XML::ResetAllControllers; |
|
3226
|
|
|
|
|
|
|
|
|
3227
|
|
|
|
|
|
|
use Carp; |
|
3228
|
|
|
|
|
|
|
|
|
3229
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3230
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3231
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3232
|
|
|
|
|
|
|
|
|
3233
|
|
|
|
|
|
|
=head1 DESCRIPTION of ResetAllControllers |
|
3234
|
|
|
|
|
|
|
|
|
3235
|
|
|
|
|
|
|
MIDI::XML::ResetAllControllers is used for representing ResetAllControllers objects MIDI::XML::ResetAllControllers is a class encapsulating MIDI Reset All Controllers messages. A Reset All Controllers message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Reset All Controllers event encoded in 3 bytes as follows: |
|
3236
|
|
|
|
|
|
|
|
|
3237
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3238
|
|
|
|
|
|
|
|
|
3239
|
|
|
|
|
|
|
cccc = channel; |
|
3240
|
|
|
|
|
|
|
nnnnnnn = control number (121) |
|
3241
|
|
|
|
|
|
|
vvvvvvv = value (0) |
|
3242
|
|
|
|
|
|
|
|
|
3243
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3244
|
|
|
|
|
|
|
|
|
3245
|
|
|
|
|
|
|
=cut |
|
3246
|
|
|
|
|
|
|
|
|
3247
|
|
|
|
|
|
|
#=============================================================================== |
|
3248
|
|
|
|
|
|
|
|
|
3249
|
|
|
|
|
|
|
{ |
|
3250
|
|
|
|
|
|
|
no strict "refs"; |
|
3251
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ResetAllControllers'; }; |
|
3252
|
|
|
|
|
|
|
} |
|
3253
|
|
|
|
|
|
|
|
|
3254
|
|
|
|
|
|
|
#=============================================================================== |
|
3255
|
|
|
|
|
|
|
|
|
3256
|
|
|
|
|
|
|
sub _bytes { |
|
3257
|
|
|
|
|
|
|
my $self = shift; |
|
3258
|
|
|
|
|
|
|
|
|
3259
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3260
|
|
|
|
|
|
|
my @bytes = ($status, 121, 0); |
|
3261
|
|
|
|
|
|
|
|
|
3262
|
|
|
|
|
|
|
if(wantarray()) { |
|
3263
|
|
|
|
|
|
|
return @bytes; |
|
3264
|
|
|
|
|
|
|
} |
|
3265
|
|
|
|
|
|
|
|
|
3266
|
|
|
|
|
|
|
return \@bytes; |
|
3267
|
|
|
|
|
|
|
} |
|
3268
|
|
|
|
|
|
|
|
|
3269
|
|
|
|
|
|
|
##END_PACKAGE ResetAllControllers |
|
3270
|
|
|
|
|
|
|
|
|
3271
|
|
|
|
|
|
|
#=============================================================================== |
|
3272
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3273
|
|
|
|
|
|
|
# UML Model UUID: 5f6ba707-463e-11dd-8bf4-00502c05c241 |
|
3274
|
|
|
|
|
|
|
|
|
3275
|
|
|
|
|
|
|
package MIDI::XML::LocalControl; |
|
3276
|
|
|
|
|
|
|
|
|
3277
|
|
|
|
|
|
|
use Carp; |
|
3278
|
|
|
|
|
|
|
|
|
3279
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3280
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3281
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3282
|
|
|
|
|
|
|
|
|
3283
|
|
|
|
|
|
|
=head1 DESCRIPTION of LocalControl |
|
3284
|
|
|
|
|
|
|
|
|
3285
|
|
|
|
|
|
|
MIDI::XML::LocalControl is used for representing LocalControl objects MIDI::XML::LocalControl is a class encapsulating MIDI Local Control messages. A Local Control message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Local Control event encoded in 3 bytes as follows: |
|
3286
|
|
|
|
|
|
|
|
|
3287
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3288
|
|
|
|
|
|
|
|
|
3289
|
|
|
|
|
|
|
cccc = channel; |
|
3290
|
|
|
|
|
|
|
nnnnnnn = control number (122) |
|
3291
|
|
|
|
|
|
|
vvvvvvv = value |
|
3292
|
|
|
|
|
|
|
|
|
3293
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3294
|
|
|
|
|
|
|
|
|
3295
|
|
|
|
|
|
|
=cut |
|
3296
|
|
|
|
|
|
|
|
|
3297
|
|
|
|
|
|
|
#=============================================================================== |
|
3298
|
|
|
|
|
|
|
|
|
3299
|
|
|
|
|
|
|
{ |
|
3300
|
|
|
|
|
|
|
no strict "refs"; |
|
3301
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'LocalControl'; }; |
|
3302
|
|
|
|
|
|
|
} |
|
3303
|
|
|
|
|
|
|
|
|
3304
|
|
|
|
|
|
|
#=============================================================================== |
|
3305
|
|
|
|
|
|
|
# MIDI::XML::LocalControl::Value |
|
3306
|
|
|
|
|
|
|
|
|
3307
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
3308
|
|
|
|
|
|
|
|
|
3309
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
3310
|
|
|
|
|
|
|
|
|
3311
|
|
|
|
|
|
|
|
|
3312
|
|
|
|
|
|
|
Type: byte |
|
3313
|
|
|
|
|
|
|
Lower: 1 |
|
3314
|
|
|
|
|
|
|
Upper: 1 |
|
3315
|
|
|
|
|
|
|
|
|
3316
|
|
|
|
|
|
|
=cut |
|
3317
|
|
|
|
|
|
|
|
|
3318
|
|
|
|
|
|
|
sub Value() { |
|
3319
|
|
|
|
|
|
|
my $self = shift; |
|
3320
|
|
|
|
|
|
|
if (@_) { |
|
3321
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3322
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
3323
|
|
|
|
|
|
|
} else { |
|
3324
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
3325
|
|
|
|
|
|
|
} |
|
3326
|
|
|
|
|
|
|
} |
|
3327
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
3328
|
|
|
|
|
|
|
} |
|
3329
|
|
|
|
|
|
|
|
|
3330
|
|
|
|
|
|
|
#=============================================================================== |
|
3331
|
|
|
|
|
|
|
|
|
3332
|
|
|
|
|
|
|
sub _bytes { |
|
3333
|
|
|
|
|
|
|
my $self = shift; |
|
3334
|
|
|
|
|
|
|
|
|
3335
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3336
|
|
|
|
|
|
|
my $d2 = $self->Value(); |
|
3337
|
|
|
|
|
|
|
my @bytes = ($status, 122, $d2); |
|
3338
|
|
|
|
|
|
|
|
|
3339
|
|
|
|
|
|
|
if(wantarray()) { |
|
3340
|
|
|
|
|
|
|
return @bytes; |
|
3341
|
|
|
|
|
|
|
} |
|
3342
|
|
|
|
|
|
|
|
|
3343
|
|
|
|
|
|
|
return \@bytes; |
|
3344
|
|
|
|
|
|
|
} |
|
3345
|
|
|
|
|
|
|
|
|
3346
|
|
|
|
|
|
|
##END_PACKAGE LocalControl |
|
3347
|
|
|
|
|
|
|
|
|
3348
|
|
|
|
|
|
|
#=============================================================================== |
|
3349
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3350
|
|
|
|
|
|
|
# UML Model UUID: 7a41c50a-463e-11dd-8bf4-00502c05c241 |
|
3351
|
|
|
|
|
|
|
|
|
3352
|
|
|
|
|
|
|
package MIDI::XML::AllNotesOff; |
|
3353
|
|
|
|
|
|
|
|
|
3354
|
|
|
|
|
|
|
use Carp; |
|
3355
|
|
|
|
|
|
|
|
|
3356
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3357
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3358
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3359
|
|
|
|
|
|
|
|
|
3360
|
|
|
|
|
|
|
=head1 DESCRIPTION of AllNotesOff |
|
3361
|
|
|
|
|
|
|
|
|
3362
|
|
|
|
|
|
|
MIDI::XML::AllNotesOff is used for representing AllNotesOff objects MIDI::XML::AllNotesOff is a class encapsulating MIDI All Notes Off messages. An All Notes Off message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI All Notes Off event encoded in 3 bytes as follows: |
|
3363
|
|
|
|
|
|
|
|
|
3364
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3365
|
|
|
|
|
|
|
|
|
3366
|
|
|
|
|
|
|
cccc = channel; |
|
3367
|
|
|
|
|
|
|
nnnnnnn = control number (123) |
|
3368
|
|
|
|
|
|
|
vvvvvvv = value (0) |
|
3369
|
|
|
|
|
|
|
|
|
3370
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3371
|
|
|
|
|
|
|
|
|
3372
|
|
|
|
|
|
|
=cut |
|
3373
|
|
|
|
|
|
|
|
|
3374
|
|
|
|
|
|
|
#=============================================================================== |
|
3375
|
|
|
|
|
|
|
|
|
3376
|
|
|
|
|
|
|
{ |
|
3377
|
|
|
|
|
|
|
no strict "refs"; |
|
3378
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'AllNotesOff'; }; |
|
3379
|
|
|
|
|
|
|
} |
|
3380
|
|
|
|
|
|
|
|
|
3381
|
|
|
|
|
|
|
#=============================================================================== |
|
3382
|
|
|
|
|
|
|
|
|
3383
|
|
|
|
|
|
|
sub _bytes { |
|
3384
|
|
|
|
|
|
|
my $self = shift; |
|
3385
|
|
|
|
|
|
|
|
|
3386
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3387
|
|
|
|
|
|
|
my @bytes = ($status, 123, 0); |
|
3388
|
|
|
|
|
|
|
|
|
3389
|
|
|
|
|
|
|
if(wantarray()) { |
|
3390
|
|
|
|
|
|
|
return @bytes; |
|
3391
|
|
|
|
|
|
|
} |
|
3392
|
|
|
|
|
|
|
|
|
3393
|
|
|
|
|
|
|
return \@bytes; |
|
3394
|
|
|
|
|
|
|
} |
|
3395
|
|
|
|
|
|
|
|
|
3396
|
|
|
|
|
|
|
##END_PACKAGE AllNotesOff |
|
3397
|
|
|
|
|
|
|
|
|
3398
|
|
|
|
|
|
|
#=============================================================================== |
|
3399
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3400
|
|
|
|
|
|
|
# UML Model UUID: a80f62dd-463e-11dd-8bf4-00502c05c241 |
|
3401
|
|
|
|
|
|
|
|
|
3402
|
|
|
|
|
|
|
package MIDI::XML::OmniOff; |
|
3403
|
|
|
|
|
|
|
|
|
3404
|
|
|
|
|
|
|
use Carp; |
|
3405
|
|
|
|
|
|
|
|
|
3406
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3407
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3408
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3409
|
|
|
|
|
|
|
|
|
3410
|
|
|
|
|
|
|
=head1 DESCRIPTION of OmniOff |
|
3411
|
|
|
|
|
|
|
|
|
3412
|
|
|
|
|
|
|
MIDI::XML::OmniOff is used for representing OmniOff objects MIDI::XML::OmniOff is a class encapsulating MIDI Omni Off messages. An Omni Off message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Omni Off event encoded in 3 bytes as follows: |
|
3413
|
|
|
|
|
|
|
|
|
3414
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3415
|
|
|
|
|
|
|
|
|
3416
|
|
|
|
|
|
|
cccc = channel; |
|
3417
|
|
|
|
|
|
|
nnnnnnn = control number (124) |
|
3418
|
|
|
|
|
|
|
vvvvvvv = value (0) |
|
3419
|
|
|
|
|
|
|
|
|
3420
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3421
|
|
|
|
|
|
|
|
|
3422
|
|
|
|
|
|
|
=cut |
|
3423
|
|
|
|
|
|
|
|
|
3424
|
|
|
|
|
|
|
#=============================================================================== |
|
3425
|
|
|
|
|
|
|
|
|
3426
|
|
|
|
|
|
|
{ |
|
3427
|
|
|
|
|
|
|
no strict "refs"; |
|
3428
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'OmniOff'; }; |
|
3429
|
|
|
|
|
|
|
} |
|
3430
|
|
|
|
|
|
|
|
|
3431
|
|
|
|
|
|
|
#=============================================================================== |
|
3432
|
|
|
|
|
|
|
|
|
3433
|
|
|
|
|
|
|
sub _bytes { |
|
3434
|
|
|
|
|
|
|
my $self = shift; |
|
3435
|
|
|
|
|
|
|
|
|
3436
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3437
|
|
|
|
|
|
|
my @bytes = ($status, 124, 0); |
|
3438
|
|
|
|
|
|
|
|
|
3439
|
|
|
|
|
|
|
if(wantarray()) { |
|
3440
|
|
|
|
|
|
|
return @bytes; |
|
3441
|
|
|
|
|
|
|
} |
|
3442
|
|
|
|
|
|
|
|
|
3443
|
|
|
|
|
|
|
return \@bytes; |
|
3444
|
|
|
|
|
|
|
} |
|
3445
|
|
|
|
|
|
|
|
|
3446
|
|
|
|
|
|
|
##END_PACKAGE OmniOff |
|
3447
|
|
|
|
|
|
|
|
|
3448
|
|
|
|
|
|
|
#=============================================================================== |
|
3449
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3450
|
|
|
|
|
|
|
# UML Model UUID: 63ff91a0-463f-11dd-8bf4-00502c05c241 |
|
3451
|
|
|
|
|
|
|
|
|
3452
|
|
|
|
|
|
|
package MIDI::XML::OmniOn; |
|
3453
|
|
|
|
|
|
|
|
|
3454
|
|
|
|
|
|
|
use Carp; |
|
3455
|
|
|
|
|
|
|
|
|
3456
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3457
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3458
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3459
|
|
|
|
|
|
|
|
|
3460
|
|
|
|
|
|
|
=head1 DESCRIPTION of OmniOn |
|
3461
|
|
|
|
|
|
|
|
|
3462
|
|
|
|
|
|
|
MIDI::XML::OmniOn is used for representing OmniOn objects MIDI::XML::OmniOn is a class encapsulating MIDI Omni On messages. An Omni On message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Omni On event encoded in 3 bytes as follows: |
|
3463
|
|
|
|
|
|
|
|
|
3464
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3465
|
|
|
|
|
|
|
|
|
3466
|
|
|
|
|
|
|
cccc = channel; |
|
3467
|
|
|
|
|
|
|
nnnnnnn = control number (125) |
|
3468
|
|
|
|
|
|
|
vvvvvvv = value (0) |
|
3469
|
|
|
|
|
|
|
|
|
3470
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3471
|
|
|
|
|
|
|
|
|
3472
|
|
|
|
|
|
|
=cut |
|
3473
|
|
|
|
|
|
|
|
|
3474
|
|
|
|
|
|
|
#=============================================================================== |
|
3475
|
|
|
|
|
|
|
|
|
3476
|
|
|
|
|
|
|
{ |
|
3477
|
|
|
|
|
|
|
no strict "refs"; |
|
3478
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'OmniOn'; }; |
|
3479
|
|
|
|
|
|
|
} |
|
3480
|
|
|
|
|
|
|
|
|
3481
|
|
|
|
|
|
|
#=============================================================================== |
|
3482
|
|
|
|
|
|
|
|
|
3483
|
|
|
|
|
|
|
sub _bytes { |
|
3484
|
|
|
|
|
|
|
my $self = shift; |
|
3485
|
|
|
|
|
|
|
|
|
3486
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3487
|
|
|
|
|
|
|
my @bytes = ($status, 125, 0); |
|
3488
|
|
|
|
|
|
|
|
|
3489
|
|
|
|
|
|
|
if(wantarray()) { |
|
3490
|
|
|
|
|
|
|
return @bytes; |
|
3491
|
|
|
|
|
|
|
} |
|
3492
|
|
|
|
|
|
|
|
|
3493
|
|
|
|
|
|
|
return \@bytes; |
|
3494
|
|
|
|
|
|
|
} |
|
3495
|
|
|
|
|
|
|
|
|
3496
|
|
|
|
|
|
|
##END_PACKAGE OmniOn |
|
3497
|
|
|
|
|
|
|
|
|
3498
|
|
|
|
|
|
|
#=============================================================================== |
|
3499
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3500
|
|
|
|
|
|
|
# UML Model UUID: 72cacce3-463f-11dd-8bf4-00502c05c241 |
|
3501
|
|
|
|
|
|
|
|
|
3502
|
|
|
|
|
|
|
package MIDI::XML::MonoMode; |
|
3503
|
|
|
|
|
|
|
|
|
3504
|
|
|
|
|
|
|
use Carp; |
|
3505
|
|
|
|
|
|
|
|
|
3506
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3507
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3508
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3509
|
|
|
|
|
|
|
|
|
3510
|
|
|
|
|
|
|
=head1 DESCRIPTION of MonoMode |
|
3511
|
|
|
|
|
|
|
|
|
3512
|
|
|
|
|
|
|
MIDI::XML::MonoMode is used for representing MonoMode objects MIDI::XML::MonoMode is a class encapsulating MIDI Mono Mode messages. A Mono Mode message includes either a delta time or absolute time as |
|
3513
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Mono Mode event encoded in 3 bytes as follows: |
|
3514
|
|
|
|
|
|
|
|
|
3515
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3516
|
|
|
|
|
|
|
|
|
3517
|
|
|
|
|
|
|
cccc = channel; |
|
3518
|
|
|
|
|
|
|
nnnnnnn = control number (126) |
|
3519
|
|
|
|
|
|
|
vvvvvvv = value |
|
3520
|
|
|
|
|
|
|
|
|
3521
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3522
|
|
|
|
|
|
|
|
|
3523
|
|
|
|
|
|
|
=cut |
|
3524
|
|
|
|
|
|
|
|
|
3525
|
|
|
|
|
|
|
#=============================================================================== |
|
3526
|
|
|
|
|
|
|
|
|
3527
|
|
|
|
|
|
|
{ |
|
3528
|
|
|
|
|
|
|
no strict "refs"; |
|
3529
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'MonoMode'; }; |
|
3530
|
|
|
|
|
|
|
} |
|
3531
|
|
|
|
|
|
|
|
|
3532
|
|
|
|
|
|
|
#=============================================================================== |
|
3533
|
|
|
|
|
|
|
# MIDI::XML::MonoMode::Value |
|
3534
|
|
|
|
|
|
|
|
|
3535
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
3536
|
|
|
|
|
|
|
|
|
3537
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
3538
|
|
|
|
|
|
|
|
|
3539
|
|
|
|
|
|
|
|
|
3540
|
|
|
|
|
|
|
Type: byte |
|
3541
|
|
|
|
|
|
|
Lower: 1 |
|
3542
|
|
|
|
|
|
|
Upper: 1 |
|
3543
|
|
|
|
|
|
|
|
|
3544
|
|
|
|
|
|
|
=cut |
|
3545
|
|
|
|
|
|
|
|
|
3546
|
|
|
|
|
|
|
sub Value() { |
|
3547
|
|
|
|
|
|
|
my $self = shift; |
|
3548
|
|
|
|
|
|
|
if (@_) { |
|
3549
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3550
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
3551
|
|
|
|
|
|
|
} else { |
|
3552
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
3553
|
|
|
|
|
|
|
} |
|
3554
|
|
|
|
|
|
|
} |
|
3555
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
3556
|
|
|
|
|
|
|
} |
|
3557
|
|
|
|
|
|
|
|
|
3558
|
|
|
|
|
|
|
#=============================================================================== |
|
3559
|
|
|
|
|
|
|
|
|
3560
|
|
|
|
|
|
|
sub _bytes { |
|
3561
|
|
|
|
|
|
|
my $self = shift; |
|
3562
|
|
|
|
|
|
|
|
|
3563
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3564
|
|
|
|
|
|
|
my $d2 = $self->Value(); |
|
3565
|
|
|
|
|
|
|
my @bytes = ($status, 126, $d2); |
|
3566
|
|
|
|
|
|
|
|
|
3567
|
|
|
|
|
|
|
if(wantarray()) { |
|
3568
|
|
|
|
|
|
|
return @bytes; |
|
3569
|
|
|
|
|
|
|
} |
|
3570
|
|
|
|
|
|
|
|
|
3571
|
|
|
|
|
|
|
return \@bytes; |
|
3572
|
|
|
|
|
|
|
} |
|
3573
|
|
|
|
|
|
|
|
|
3574
|
|
|
|
|
|
|
##END_PACKAGE MonoMode |
|
3575
|
|
|
|
|
|
|
|
|
3576
|
|
|
|
|
|
|
#=============================================================================== |
|
3577
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3578
|
|
|
|
|
|
|
# UML Model UUID: 86fdd9f6-463f-11dd-8bf4-00502c05c241 |
|
3579
|
|
|
|
|
|
|
|
|
3580
|
|
|
|
|
|
|
package MIDI::XML::PolyMode; |
|
3581
|
|
|
|
|
|
|
|
|
3582
|
|
|
|
|
|
|
use Carp; |
|
3583
|
|
|
|
|
|
|
|
|
3584
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3585
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3586
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3587
|
|
|
|
|
|
|
|
|
3588
|
|
|
|
|
|
|
=head1 DESCRIPTION of PolyMode |
|
3589
|
|
|
|
|
|
|
|
|
3590
|
|
|
|
|
|
|
MIDI::XML::PolyMode is used for representing PolyMode objects MIDI::XML::PolyMode is a class encapsulating MIDI Poly Mode messages. A Poly Mode message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Poly Mode event encoded in 3 bytes as follows: |
|
3591
|
|
|
|
|
|
|
|
|
3592
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3593
|
|
|
|
|
|
|
|
|
3594
|
|
|
|
|
|
|
cccc = channel; |
|
3595
|
|
|
|
|
|
|
nnnnnnn = control number (127) |
|
3596
|
|
|
|
|
|
|
vvvvvvv = value (0) |
|
3597
|
|
|
|
|
|
|
|
|
3598
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3599
|
|
|
|
|
|
|
|
|
3600
|
|
|
|
|
|
|
=cut |
|
3601
|
|
|
|
|
|
|
|
|
3602
|
|
|
|
|
|
|
#=============================================================================== |
|
3603
|
|
|
|
|
|
|
|
|
3604
|
|
|
|
|
|
|
{ |
|
3605
|
|
|
|
|
|
|
no strict "refs"; |
|
3606
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'PolyMode'; }; |
|
3607
|
|
|
|
|
|
|
} |
|
3608
|
|
|
|
|
|
|
|
|
3609
|
|
|
|
|
|
|
#=============================================================================== |
|
3610
|
|
|
|
|
|
|
|
|
3611
|
|
|
|
|
|
|
sub _bytes { |
|
3612
|
|
|
|
|
|
|
my $self = shift; |
|
3613
|
|
|
|
|
|
|
|
|
3614
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3615
|
|
|
|
|
|
|
my @bytes = ($status, 127, 0); |
|
3616
|
|
|
|
|
|
|
|
|
3617
|
|
|
|
|
|
|
if(wantarray()) { |
|
3618
|
|
|
|
|
|
|
return @bytes; |
|
3619
|
|
|
|
|
|
|
} |
|
3620
|
|
|
|
|
|
|
|
|
3621
|
|
|
|
|
|
|
return \@bytes; |
|
3622
|
|
|
|
|
|
|
} |
|
3623
|
|
|
|
|
|
|
|
|
3624
|
|
|
|
|
|
|
##END_PACKAGE PolyMode |
|
3625
|
|
|
|
|
|
|
|
|
3626
|
|
|
|
|
|
|
#=============================================================================== |
|
3627
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3628
|
|
|
|
|
|
|
# UML Model UUID: 23859159-4640-11dd-8bf4-00502c05c241 |
|
3629
|
|
|
|
|
|
|
|
|
3630
|
|
|
|
|
|
|
package MIDI::XML::ControlChange; |
|
3631
|
|
|
|
|
|
|
|
|
3632
|
|
|
|
|
|
|
use Carp; |
|
3633
|
|
|
|
|
|
|
|
|
3634
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3635
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3636
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3637
|
|
|
|
|
|
|
|
|
3638
|
|
|
|
|
|
|
=head1 DESCRIPTION of ControlChange |
|
3639
|
|
|
|
|
|
|
|
|
3640
|
|
|
|
|
|
|
MIDI::XML::ControlChange is used for representing ControlChange objects MIDI::XML::ControlChange is a class encapsulating MIDI Control Change messages. A Control Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Control Change event encoded in 3 bytes as follows: |
|
3641
|
|
|
|
|
|
|
|
|
3642
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3643
|
|
|
|
|
|
|
|
|
3644
|
|
|
|
|
|
|
cccc = channel; |
|
3645
|
|
|
|
|
|
|
nnnnnnn = control number |
|
3646
|
|
|
|
|
|
|
vvvvvvv = value |
|
3647
|
|
|
|
|
|
|
|
|
3648
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3649
|
|
|
|
|
|
|
|
|
3650
|
|
|
|
|
|
|
=cut |
|
3651
|
|
|
|
|
|
|
|
|
3652
|
|
|
|
|
|
|
#=============================================================================== |
|
3653
|
|
|
|
|
|
|
|
|
3654
|
|
|
|
|
|
|
{ |
|
3655
|
|
|
|
|
|
|
no strict "refs"; |
|
3656
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ControlChange'; }; |
|
3657
|
|
|
|
|
|
|
} |
|
3658
|
|
|
|
|
|
|
|
|
3659
|
|
|
|
|
|
|
#=============================================================================== |
|
3660
|
|
|
|
|
|
|
# MIDI::XML::ControlChange::Control |
|
3661
|
|
|
|
|
|
|
|
|
3662
|
|
|
|
|
|
|
=head2 $value = $Object->Control([$new_value]); |
|
3663
|
|
|
|
|
|
|
|
|
3664
|
|
|
|
|
|
|
Set or get value of the Control attribute. |
|
3665
|
|
|
|
|
|
|
|
|
3666
|
|
|
|
|
|
|
|
|
3667
|
|
|
|
|
|
|
Type: byte |
|
3668
|
|
|
|
|
|
|
Lower: 1 |
|
3669
|
|
|
|
|
|
|
Upper: 1 |
|
3670
|
|
|
|
|
|
|
|
|
3671
|
|
|
|
|
|
|
=cut |
|
3672
|
|
|
|
|
|
|
|
|
3673
|
|
|
|
|
|
|
sub Control() { |
|
3674
|
|
|
|
|
|
|
my $self = shift; |
|
3675
|
|
|
|
|
|
|
if (@_) { |
|
3676
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3677
|
|
|
|
|
|
|
$self->setAttribute('Control', shift); |
|
3678
|
|
|
|
|
|
|
} else { |
|
3679
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Control\''; |
|
3680
|
|
|
|
|
|
|
} |
|
3681
|
|
|
|
|
|
|
} |
|
3682
|
|
|
|
|
|
|
return $self->getAttribute('Control'); |
|
3683
|
|
|
|
|
|
|
} |
|
3684
|
|
|
|
|
|
|
|
|
3685
|
|
|
|
|
|
|
#=============================================================================== |
|
3686
|
|
|
|
|
|
|
# MIDI::XML::ControlChange::Value |
|
3687
|
|
|
|
|
|
|
|
|
3688
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
3689
|
|
|
|
|
|
|
|
|
3690
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
3691
|
|
|
|
|
|
|
|
|
3692
|
|
|
|
|
|
|
|
|
3693
|
|
|
|
|
|
|
Type: byte |
|
3694
|
|
|
|
|
|
|
Lower: 1 |
|
3695
|
|
|
|
|
|
|
Upper: 1 |
|
3696
|
|
|
|
|
|
|
|
|
3697
|
|
|
|
|
|
|
=cut |
|
3698
|
|
|
|
|
|
|
|
|
3699
|
|
|
|
|
|
|
sub Value() { |
|
3700
|
|
|
|
|
|
|
my $self = shift; |
|
3701
|
|
|
|
|
|
|
if (@_) { |
|
3702
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3703
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
3704
|
|
|
|
|
|
|
} else { |
|
3705
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
3706
|
|
|
|
|
|
|
} |
|
3707
|
|
|
|
|
|
|
} |
|
3708
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
3709
|
|
|
|
|
|
|
} |
|
3710
|
|
|
|
|
|
|
|
|
3711
|
|
|
|
|
|
|
#=============================================================================== |
|
3712
|
|
|
|
|
|
|
|
|
3713
|
|
|
|
|
|
|
sub _bytes { |
|
3714
|
|
|
|
|
|
|
my $self = shift; |
|
3715
|
|
|
|
|
|
|
|
|
3716
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3717
|
|
|
|
|
|
|
my $d1 = $self->Control(); |
|
3718
|
|
|
|
|
|
|
my $d2 = $self->Value(); |
|
3719
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2); |
|
3720
|
|
|
|
|
|
|
|
|
3721
|
|
|
|
|
|
|
if(wantarray()) { |
|
3722
|
|
|
|
|
|
|
return @bytes; |
|
3723
|
|
|
|
|
|
|
} |
|
3724
|
|
|
|
|
|
|
|
|
3725
|
|
|
|
|
|
|
return \@bytes; |
|
3726
|
|
|
|
|
|
|
} |
|
3727
|
|
|
|
|
|
|
|
|
3728
|
|
|
|
|
|
|
##END_PACKAGE ControlChange |
|
3729
|
|
|
|
|
|
|
|
|
3730
|
|
|
|
|
|
|
#=============================================================================== |
|
3731
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3732
|
|
|
|
|
|
|
# UML Model UUID: 0ffb7e73-4654-11dd-8bf4-00502c05c241 |
|
3733
|
|
|
|
|
|
|
|
|
3734
|
|
|
|
|
|
|
package MIDI::XML::ControlChange14; |
|
3735
|
|
|
|
|
|
|
|
|
3736
|
|
|
|
|
|
|
use Carp; |
|
3737
|
|
|
|
|
|
|
|
|
3738
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3739
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3740
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3741
|
|
|
|
|
|
|
|
|
3742
|
|
|
|
|
|
|
=head1 DESCRIPTION of ControlChange14 |
|
3743
|
|
|
|
|
|
|
|
|
3744
|
|
|
|
|
|
|
MIDI::XML::ControlChange14 is used for representing ControlChange14 objects MIDI::XML::ControlChange14 is a class encapsulating MIDI Control Change messages. A Control Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Control Change event encoded in 6 bytes as follows: |
|
3745
|
|
|
|
|
|
|
|
|
3746
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3747
|
|
|
|
|
|
|
|
|
3748
|
|
|
|
|
|
|
cccc = channel; |
|
3749
|
|
|
|
|
|
|
nnnnnnn = control number |
|
3750
|
|
|
|
|
|
|
vvvvvvv = value MSB |
|
3751
|
|
|
|
|
|
|
|
|
3752
|
|
|
|
|
|
|
1011cccc 0nnnnnnn 0vvvvvvv |
|
3753
|
|
|
|
|
|
|
|
|
3754
|
|
|
|
|
|
|
cccc = channel; |
|
3755
|
|
|
|
|
|
|
nnnnnnn = control number + 32 |
|
3756
|
|
|
|
|
|
|
vvvvvvv = value LSB |
|
3757
|
|
|
|
|
|
|
|
|
3758
|
|
|
|
|
|
|
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel. |
|
3759
|
|
|
|
|
|
|
|
|
3760
|
|
|
|
|
|
|
=cut |
|
3761
|
|
|
|
|
|
|
|
|
3762
|
|
|
|
|
|
|
#=============================================================================== |
|
3763
|
|
|
|
|
|
|
|
|
3764
|
|
|
|
|
|
|
{ |
|
3765
|
|
|
|
|
|
|
no strict "refs"; |
|
3766
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ControlChange14'; }; |
|
3767
|
|
|
|
|
|
|
} |
|
3768
|
|
|
|
|
|
|
|
|
3769
|
|
|
|
|
|
|
#=============================================================================== |
|
3770
|
|
|
|
|
|
|
# MIDI::XML::ControlChange14::Control |
|
3771
|
|
|
|
|
|
|
|
|
3772
|
|
|
|
|
|
|
=head2 $value = $Object->Control([$new_value]); |
|
3773
|
|
|
|
|
|
|
|
|
3774
|
|
|
|
|
|
|
Set or get value of the Control attribute. |
|
3775
|
|
|
|
|
|
|
|
|
3776
|
|
|
|
|
|
|
|
|
3777
|
|
|
|
|
|
|
Type: byte |
|
3778
|
|
|
|
|
|
|
Lower: 1 |
|
3779
|
|
|
|
|
|
|
Upper: 1 |
|
3780
|
|
|
|
|
|
|
|
|
3781
|
|
|
|
|
|
|
=cut |
|
3782
|
|
|
|
|
|
|
|
|
3783
|
|
|
|
|
|
|
sub Control() { |
|
3784
|
|
|
|
|
|
|
my $self = shift; |
|
3785
|
|
|
|
|
|
|
if (@_) { |
|
3786
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3787
|
|
|
|
|
|
|
$self->setAttribute('Control', shift); |
|
3788
|
|
|
|
|
|
|
} else { |
|
3789
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Control\''; |
|
3790
|
|
|
|
|
|
|
} |
|
3791
|
|
|
|
|
|
|
} |
|
3792
|
|
|
|
|
|
|
return $self->getAttribute('Control'); |
|
3793
|
|
|
|
|
|
|
} |
|
3794
|
|
|
|
|
|
|
|
|
3795
|
|
|
|
|
|
|
#=============================================================================== |
|
3796
|
|
|
|
|
|
|
# MIDI::XML::ControlChange14::Value |
|
3797
|
|
|
|
|
|
|
|
|
3798
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
3799
|
|
|
|
|
|
|
|
|
3800
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
3801
|
|
|
|
|
|
|
|
|
3802
|
|
|
|
|
|
|
|
|
3803
|
|
|
|
|
|
|
Type: short |
|
3804
|
|
|
|
|
|
|
Lower: 1 |
|
3805
|
|
|
|
|
|
|
Upper: 1 |
|
3806
|
|
|
|
|
|
|
|
|
3807
|
|
|
|
|
|
|
=cut |
|
3808
|
|
|
|
|
|
|
|
|
3809
|
|
|
|
|
|
|
sub Value() { |
|
3810
|
|
|
|
|
|
|
my $self = shift; |
|
3811
|
|
|
|
|
|
|
if (@_) { |
|
3812
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3813
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
3814
|
|
|
|
|
|
|
} else { |
|
3815
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
3816
|
|
|
|
|
|
|
} |
|
3817
|
|
|
|
|
|
|
} |
|
3818
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
3819
|
|
|
|
|
|
|
} |
|
3820
|
|
|
|
|
|
|
|
|
3821
|
|
|
|
|
|
|
#=============================================================================== |
|
3822
|
|
|
|
|
|
|
|
|
3823
|
|
|
|
|
|
|
sub _bytes { |
|
3824
|
|
|
|
|
|
|
my $self = shift; |
|
3825
|
|
|
|
|
|
|
|
|
3826
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3827
|
|
|
|
|
|
|
my $v = $self->Value(); |
|
3828
|
|
|
|
|
|
|
my $d1 = $self->Control(); |
|
3829
|
|
|
|
|
|
|
my $d2 = ($v >> 7) & 0x7F; |
|
3830
|
|
|
|
|
|
|
my $d3 = $d1 + 32; |
|
3831
|
|
|
|
|
|
|
my $d4 = $v & 0x7F; |
|
3832
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2, 0, $d3, $d4); |
|
3833
|
|
|
|
|
|
|
|
|
3834
|
|
|
|
|
|
|
if(wantarray()) { |
|
3835
|
|
|
|
|
|
|
return @bytes; |
|
3836
|
|
|
|
|
|
|
} |
|
3837
|
|
|
|
|
|
|
|
|
3838
|
|
|
|
|
|
|
return \@bytes; |
|
3839
|
|
|
|
|
|
|
} |
|
3840
|
|
|
|
|
|
|
|
|
3841
|
|
|
|
|
|
|
##END_PACKAGE ControlChange14 |
|
3842
|
|
|
|
|
|
|
|
|
3843
|
|
|
|
|
|
|
#=============================================================================== |
|
3844
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3845
|
|
|
|
|
|
|
# UML Model UUID: 60c40936-4654-11dd-8bf4-00502c05c241 |
|
3846
|
|
|
|
|
|
|
|
|
3847
|
|
|
|
|
|
|
package MIDI::XML::RPNChange; |
|
3848
|
|
|
|
|
|
|
|
|
3849
|
|
|
|
|
|
|
use Carp; |
|
3850
|
|
|
|
|
|
|
|
|
3851
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3852
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3853
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3854
|
|
|
|
|
|
|
|
|
3855
|
|
|
|
|
|
|
=head1 DESCRIPTION of RPNChange |
|
3856
|
|
|
|
|
|
|
|
|
3857
|
|
|
|
|
|
|
MIDI::XML::RPNChange is used for representing RPNChange objects |
|
3858
|
|
|
|
|
|
|
|
|
3859
|
|
|
|
|
|
|
=cut |
|
3860
|
|
|
|
|
|
|
|
|
3861
|
|
|
|
|
|
|
#=============================================================================== |
|
3862
|
|
|
|
|
|
|
|
|
3863
|
|
|
|
|
|
|
{ |
|
3864
|
|
|
|
|
|
|
no strict "refs"; |
|
3865
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'RPNChange'; }; |
|
3866
|
|
|
|
|
|
|
} |
|
3867
|
|
|
|
|
|
|
|
|
3868
|
|
|
|
|
|
|
#=============================================================================== |
|
3869
|
|
|
|
|
|
|
# MIDI::XML::RPNChange::RPN |
|
3870
|
|
|
|
|
|
|
|
|
3871
|
|
|
|
|
|
|
=head2 $value = $Object->RPN([$new_value]); |
|
3872
|
|
|
|
|
|
|
|
|
3873
|
|
|
|
|
|
|
Set or get value of the RPN attribute. |
|
3874
|
|
|
|
|
|
|
|
|
3875
|
|
|
|
|
|
|
|
|
3876
|
|
|
|
|
|
|
Type: short |
|
3877
|
|
|
|
|
|
|
Lower: 1 |
|
3878
|
|
|
|
|
|
|
Upper: 1 |
|
3879
|
|
|
|
|
|
|
|
|
3880
|
|
|
|
|
|
|
=cut |
|
3881
|
|
|
|
|
|
|
|
|
3882
|
|
|
|
|
|
|
sub RPN() { |
|
3883
|
|
|
|
|
|
|
my $self = shift; |
|
3884
|
|
|
|
|
|
|
if (@_) { |
|
3885
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3886
|
|
|
|
|
|
|
$self->setAttribute('RPN', shift); |
|
3887
|
|
|
|
|
|
|
} else { |
|
3888
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'RPN\''; |
|
3889
|
|
|
|
|
|
|
} |
|
3890
|
|
|
|
|
|
|
} |
|
3891
|
|
|
|
|
|
|
return $self->getAttribute('RPN'); |
|
3892
|
|
|
|
|
|
|
} |
|
3893
|
|
|
|
|
|
|
|
|
3894
|
|
|
|
|
|
|
#=============================================================================== |
|
3895
|
|
|
|
|
|
|
# MIDI::XML::RPNChange::Value |
|
3896
|
|
|
|
|
|
|
|
|
3897
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
3898
|
|
|
|
|
|
|
|
|
3899
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
3900
|
|
|
|
|
|
|
|
|
3901
|
|
|
|
|
|
|
|
|
3902
|
|
|
|
|
|
|
Type: short |
|
3903
|
|
|
|
|
|
|
Lower: 1 |
|
3904
|
|
|
|
|
|
|
Upper: 1 |
|
3905
|
|
|
|
|
|
|
|
|
3906
|
|
|
|
|
|
|
=cut |
|
3907
|
|
|
|
|
|
|
|
|
3908
|
|
|
|
|
|
|
sub Value() { |
|
3909
|
|
|
|
|
|
|
my $self = shift; |
|
3910
|
|
|
|
|
|
|
if (@_) { |
|
3911
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3912
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
3913
|
|
|
|
|
|
|
} else { |
|
3914
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
3915
|
|
|
|
|
|
|
} |
|
3916
|
|
|
|
|
|
|
} |
|
3917
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
3918
|
|
|
|
|
|
|
} |
|
3919
|
|
|
|
|
|
|
|
|
3920
|
|
|
|
|
|
|
#=============================================================================== |
|
3921
|
|
|
|
|
|
|
# A chain of four messages with the three zeros being cheat delta times; |
|
3922
|
|
|
|
|
|
|
|
|
3923
|
|
|
|
|
|
|
sub _bytes { |
|
3924
|
|
|
|
|
|
|
my $self = shift; |
|
3925
|
|
|
|
|
|
|
|
|
3926
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
3927
|
|
|
|
|
|
|
my $r = $self->RPN(); |
|
3928
|
|
|
|
|
|
|
my $v = $self->Value(); |
|
3929
|
|
|
|
|
|
|
my $d1 = ($r >> 7) & 0x7F; |
|
3930
|
|
|
|
|
|
|
my $d2 = $r & 0x7F; |
|
3931
|
|
|
|
|
|
|
my $d3 = ($v >> 7) & 0x7F; |
|
3932
|
|
|
|
|
|
|
my $d4 = $v & 0x7F; |
|
3933
|
|
|
|
|
|
|
my @bytes = ($status, 0x65, $d1, 0, 0x64, $d2, 0, 0x06, $d3, 0, 0x26, $d4); |
|
3934
|
|
|
|
|
|
|
|
|
3935
|
|
|
|
|
|
|
if(wantarray()) { |
|
3936
|
|
|
|
|
|
|
return @bytes; |
|
3937
|
|
|
|
|
|
|
} |
|
3938
|
|
|
|
|
|
|
|
|
3939
|
|
|
|
|
|
|
return \@bytes; |
|
3940
|
|
|
|
|
|
|
} |
|
3941
|
|
|
|
|
|
|
|
|
3942
|
|
|
|
|
|
|
##END_PACKAGE RPNChange |
|
3943
|
|
|
|
|
|
|
|
|
3944
|
|
|
|
|
|
|
#=============================================================================== |
|
3945
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
3946
|
|
|
|
|
|
|
# UML Model UUID: 9c39bf09-4654-11dd-8bf4-00502c05c241 |
|
3947
|
|
|
|
|
|
|
|
|
3948
|
|
|
|
|
|
|
package MIDI::XML::NRPNChange; |
|
3949
|
|
|
|
|
|
|
|
|
3950
|
|
|
|
|
|
|
use Carp; |
|
3951
|
|
|
|
|
|
|
|
|
3952
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::ControlChangeMessage); |
|
3953
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
3954
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
3955
|
|
|
|
|
|
|
|
|
3956
|
|
|
|
|
|
|
=head1 DESCRIPTION of NRPNChange |
|
3957
|
|
|
|
|
|
|
|
|
3958
|
|
|
|
|
|
|
MIDI::XML::NRPNChange is used for representing NRPNChange objects |
|
3959
|
|
|
|
|
|
|
|
|
3960
|
|
|
|
|
|
|
=cut |
|
3961
|
|
|
|
|
|
|
|
|
3962
|
|
|
|
|
|
|
#=============================================================================== |
|
3963
|
|
|
|
|
|
|
|
|
3964
|
|
|
|
|
|
|
{ |
|
3965
|
|
|
|
|
|
|
no strict "refs"; |
|
3966
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'NRPNChange'; }; |
|
3967
|
|
|
|
|
|
|
} |
|
3968
|
|
|
|
|
|
|
|
|
3969
|
|
|
|
|
|
|
#=============================================================================== |
|
3970
|
|
|
|
|
|
|
# MIDI::XML::NRPNChange::NRPN |
|
3971
|
|
|
|
|
|
|
|
|
3972
|
|
|
|
|
|
|
=head2 $value = $Object->NRPN([$new_value]); |
|
3973
|
|
|
|
|
|
|
|
|
3974
|
|
|
|
|
|
|
Set or get value of the NRPN attribute. |
|
3975
|
|
|
|
|
|
|
|
|
3976
|
|
|
|
|
|
|
|
|
3977
|
|
|
|
|
|
|
Type: short |
|
3978
|
|
|
|
|
|
|
Lower: 1 |
|
3979
|
|
|
|
|
|
|
Upper: 1 |
|
3980
|
|
|
|
|
|
|
|
|
3981
|
|
|
|
|
|
|
=cut |
|
3982
|
|
|
|
|
|
|
|
|
3983
|
|
|
|
|
|
|
sub NRPN() { |
|
3984
|
|
|
|
|
|
|
my $self = shift; |
|
3985
|
|
|
|
|
|
|
if (@_) { |
|
3986
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
3987
|
|
|
|
|
|
|
$self->setAttribute('NRPN', shift); |
|
3988
|
|
|
|
|
|
|
} else { |
|
3989
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'NRPN\''; |
|
3990
|
|
|
|
|
|
|
} |
|
3991
|
|
|
|
|
|
|
} |
|
3992
|
|
|
|
|
|
|
return $self->getAttribute('NRPN'); |
|
3993
|
|
|
|
|
|
|
} |
|
3994
|
|
|
|
|
|
|
|
|
3995
|
|
|
|
|
|
|
#=============================================================================== |
|
3996
|
|
|
|
|
|
|
# MIDI::XML::NRPNChange::Value |
|
3997
|
|
|
|
|
|
|
|
|
3998
|
|
|
|
|
|
|
=head2 $value = $Object->Value([$new_value]); |
|
3999
|
|
|
|
|
|
|
|
|
4000
|
|
|
|
|
|
|
Set or get value of the Value attribute. |
|
4001
|
|
|
|
|
|
|
|
|
4002
|
|
|
|
|
|
|
|
|
4003
|
|
|
|
|
|
|
Type: short |
|
4004
|
|
|
|
|
|
|
Lower: 1 |
|
4005
|
|
|
|
|
|
|
Upper: 1 |
|
4006
|
|
|
|
|
|
|
|
|
4007
|
|
|
|
|
|
|
=cut |
|
4008
|
|
|
|
|
|
|
|
|
4009
|
|
|
|
|
|
|
sub Value() { |
|
4010
|
|
|
|
|
|
|
my $self = shift; |
|
4011
|
|
|
|
|
|
|
if (@_) { |
|
4012
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4013
|
|
|
|
|
|
|
$self->setAttribute('Value', shift); |
|
4014
|
|
|
|
|
|
|
} else { |
|
4015
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Value\''; |
|
4016
|
|
|
|
|
|
|
} |
|
4017
|
|
|
|
|
|
|
} |
|
4018
|
|
|
|
|
|
|
return $self->getAttribute('Value'); |
|
4019
|
|
|
|
|
|
|
} |
|
4020
|
|
|
|
|
|
|
|
|
4021
|
|
|
|
|
|
|
#=============================================================================== |
|
4022
|
|
|
|
|
|
|
# A chain of four messages with the three zeros being cheat delta times; |
|
4023
|
|
|
|
|
|
|
|
|
4024
|
|
|
|
|
|
|
sub _bytes { |
|
4025
|
|
|
|
|
|
|
my $self = shift; |
|
4026
|
|
|
|
|
|
|
|
|
4027
|
|
|
|
|
|
|
my $status = 0xB0+$self->Channel()-1; |
|
4028
|
|
|
|
|
|
|
my $n = $self->NRPN(); |
|
4029
|
|
|
|
|
|
|
my $v = $self->Value(); |
|
4030
|
|
|
|
|
|
|
my $d1 = ($n >> 7) & 0x7F; |
|
4031
|
|
|
|
|
|
|
my $d2 = $n & 0x7F; |
|
4032
|
|
|
|
|
|
|
my $d3 = ($v >> 7) & 0x7F; |
|
4033
|
|
|
|
|
|
|
my $d4 = $v & 0x7F; |
|
4034
|
|
|
|
|
|
|
my @bytes = ($status, 0x65, $d1, 0, 0x64, $d2, 0, 0x06, $d3, 0, 0x26, $d4); |
|
4035
|
|
|
|
|
|
|
|
|
4036
|
|
|
|
|
|
|
if(wantarray()) { |
|
4037
|
|
|
|
|
|
|
return @bytes; |
|
4038
|
|
|
|
|
|
|
} |
|
4039
|
|
|
|
|
|
|
|
|
4040
|
|
|
|
|
|
|
return \@bytes; |
|
4041
|
|
|
|
|
|
|
} |
|
4042
|
|
|
|
|
|
|
|
|
4043
|
|
|
|
|
|
|
##END_PACKAGE NRPNChange |
|
4044
|
|
|
|
|
|
|
|
|
4045
|
|
|
|
|
|
|
#=============================================================================== |
|
4046
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4047
|
|
|
|
|
|
|
# UML Model UUID: 74507384-468f-11dd-8bf4-00502c05c241 |
|
4048
|
|
|
|
|
|
|
|
|
4049
|
|
|
|
|
|
|
package MIDI::XML::SysEx; |
|
4050
|
|
|
|
|
|
|
|
|
4051
|
|
|
|
|
|
|
use Carp; |
|
4052
|
|
|
|
|
|
|
|
|
4053
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4054
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4055
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4056
|
|
|
|
|
|
|
|
|
4057
|
|
|
|
|
|
|
=head1 DESCRIPTION of SysEx |
|
4058
|
|
|
|
|
|
|
|
|
4059
|
|
|
|
|
|
|
MIDI::XML::SysEx is used for representing SysEx objects |
|
4060
|
|
|
|
|
|
|
|
|
4061
|
|
|
|
|
|
|
=cut |
|
4062
|
|
|
|
|
|
|
|
|
4063
|
|
|
|
|
|
|
#=============================================================================== |
|
4064
|
|
|
|
|
|
|
|
|
4065
|
|
|
|
|
|
|
{ |
|
4066
|
|
|
|
|
|
|
no strict "refs"; |
|
4067
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SysEx'; }; |
|
4068
|
|
|
|
|
|
|
} |
|
4069
|
|
|
|
|
|
|
|
|
4070
|
|
|
|
|
|
|
#=============================================================================== |
|
4071
|
|
|
|
|
|
|
|
|
4072
|
|
|
|
|
|
|
sub _bytes { |
|
4073
|
|
|
|
|
|
|
my $self = shift; |
|
4074
|
|
|
|
|
|
|
|
|
4075
|
|
|
|
|
|
|
my $text = $self->text(); |
|
4076
|
|
|
|
|
|
|
my @t = split(' ',$text); |
|
4077
|
|
|
|
|
|
|
|
|
4078
|
|
|
|
|
|
|
my @bytes = (0xF0, MIDI::XML::Document::var_len_int($#t+1)); |
|
4079
|
|
|
|
|
|
|
map {push @bytes,ord(pack('H2',"$_"));} @t; |
|
4080
|
|
|
|
|
|
|
|
|
4081
|
|
|
|
|
|
|
if(wantarray()) { |
|
4082
|
|
|
|
|
|
|
return @bytes; |
|
4083
|
|
|
|
|
|
|
} |
|
4084
|
|
|
|
|
|
|
|
|
4085
|
|
|
|
|
|
|
return \@bytes; |
|
4086
|
|
|
|
|
|
|
} |
|
4087
|
|
|
|
|
|
|
|
|
4088
|
|
|
|
|
|
|
##END_PACKAGE SysEx |
|
4089
|
|
|
|
|
|
|
|
|
4090
|
|
|
|
|
|
|
#=============================================================================== |
|
4091
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4092
|
|
|
|
|
|
|
# UML Model UUID: 88829636-468f-11dd-8bf4-00502c05c241 |
|
4093
|
|
|
|
|
|
|
|
|
4094
|
|
|
|
|
|
|
package MIDI::XML::SysExDeviceID; |
|
4095
|
|
|
|
|
|
|
|
|
4096
|
|
|
|
|
|
|
use Carp; |
|
4097
|
|
|
|
|
|
|
|
|
4098
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element); |
|
4099
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4100
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4101
|
|
|
|
|
|
|
|
|
4102
|
|
|
|
|
|
|
=head1 DESCRIPTION of SysExDeviceID |
|
4103
|
|
|
|
|
|
|
|
|
4104
|
|
|
|
|
|
|
MIDI::XML::SysExDeviceID is used for representing SysExDeviceID objects |
|
4105
|
|
|
|
|
|
|
|
|
4106
|
|
|
|
|
|
|
=cut |
|
4107
|
|
|
|
|
|
|
|
|
4108
|
|
|
|
|
|
|
#=============================================================================== |
|
4109
|
|
|
|
|
|
|
|
|
4110
|
|
|
|
|
|
|
{ |
|
4111
|
|
|
|
|
|
|
no strict "refs"; |
|
4112
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SysExDeviceID'; }; |
|
4113
|
|
|
|
|
|
|
} |
|
4114
|
|
|
|
|
|
|
|
|
4115
|
|
|
|
|
|
|
#=============================================================================== |
|
4116
|
|
|
|
|
|
|
# MIDI::XML::SysExDeviceID::Multiplier |
|
4117
|
|
|
|
|
|
|
|
|
4118
|
|
|
|
|
|
|
=head2 $value = $Object->Multiplier([$new_value]); |
|
4119
|
|
|
|
|
|
|
|
|
4120
|
|
|
|
|
|
|
Set or get value of the Multiplier attribute. |
|
4121
|
|
|
|
|
|
|
|
|
4122
|
|
|
|
|
|
|
|
|
4123
|
|
|
|
|
|
|
Type: int |
|
4124
|
|
|
|
|
|
|
Lower: 1 |
|
4125
|
|
|
|
|
|
|
Upper: 1 |
|
4126
|
|
|
|
|
|
|
|
|
4127
|
|
|
|
|
|
|
=cut |
|
4128
|
|
|
|
|
|
|
|
|
4129
|
|
|
|
|
|
|
sub Multiplier() { |
|
4130
|
|
|
|
|
|
|
my $self = shift; |
|
4131
|
|
|
|
|
|
|
if (@_) { |
|
4132
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4133
|
|
|
|
|
|
|
$self->setAttribute('Multiplier', shift); |
|
4134
|
|
|
|
|
|
|
} else { |
|
4135
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Multiplier\''; |
|
4136
|
|
|
|
|
|
|
} |
|
4137
|
|
|
|
|
|
|
} |
|
4138
|
|
|
|
|
|
|
return $self->getAttribute('Multiplier'); |
|
4139
|
|
|
|
|
|
|
} |
|
4140
|
|
|
|
|
|
|
|
|
4141
|
|
|
|
|
|
|
#=============================================================================== |
|
4142
|
|
|
|
|
|
|
# MIDI::XML::SysExDeviceID::Offset |
|
4143
|
|
|
|
|
|
|
|
|
4144
|
|
|
|
|
|
|
=head2 $value = $Object->Offset([$new_value]); |
|
4145
|
|
|
|
|
|
|
|
|
4146
|
|
|
|
|
|
|
Set or get value of the Offset attribute. |
|
4147
|
|
|
|
|
|
|
|
|
4148
|
|
|
|
|
|
|
|
|
4149
|
|
|
|
|
|
|
Type: int |
|
4150
|
|
|
|
|
|
|
Lower: 1 |
|
4151
|
|
|
|
|
|
|
Upper: 1 |
|
4152
|
|
|
|
|
|
|
|
|
4153
|
|
|
|
|
|
|
=cut |
|
4154
|
|
|
|
|
|
|
|
|
4155
|
|
|
|
|
|
|
sub Offset() { |
|
4156
|
|
|
|
|
|
|
my $self = shift; |
|
4157
|
|
|
|
|
|
|
if (@_) { |
|
4158
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4159
|
|
|
|
|
|
|
$self->setAttribute('Offset', shift); |
|
4160
|
|
|
|
|
|
|
} else { |
|
4161
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Offset\''; |
|
4162
|
|
|
|
|
|
|
} |
|
4163
|
|
|
|
|
|
|
} |
|
4164
|
|
|
|
|
|
|
return $self->getAttribute('Offset'); |
|
4165
|
|
|
|
|
|
|
} |
|
4166
|
|
|
|
|
|
|
|
|
4167
|
|
|
|
|
|
|
#=============================================================================== |
|
4168
|
|
|
|
|
|
|
|
|
4169
|
|
|
|
|
|
|
sub _bytes { |
|
4170
|
|
|
|
|
|
|
my $self = shift; |
|
4171
|
|
|
|
|
|
|
|
|
4172
|
|
|
|
|
|
|
my @bytes; |
|
4173
|
|
|
|
|
|
|
|
|
4174
|
|
|
|
|
|
|
return \@bytes; |
|
4175
|
|
|
|
|
|
|
} |
|
4176
|
|
|
|
|
|
|
|
|
4177
|
|
|
|
|
|
|
##END_PACKAGE SysExDeviceID |
|
4178
|
|
|
|
|
|
|
|
|
4179
|
|
|
|
|
|
|
#=============================================================================== |
|
4180
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4181
|
|
|
|
|
|
|
# UML Model UUID: 941da028-468f-11dd-8bf4-00502c05c241 |
|
4182
|
|
|
|
|
|
|
|
|
4183
|
|
|
|
|
|
|
package MIDI::XML::SysExChannel; |
|
4184
|
|
|
|
|
|
|
|
|
4185
|
|
|
|
|
|
|
use Carp; |
|
4186
|
|
|
|
|
|
|
|
|
4187
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element); |
|
4188
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4189
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4190
|
|
|
|
|
|
|
|
|
4191
|
|
|
|
|
|
|
=head1 DESCRIPTION of SysExChannel |
|
4192
|
|
|
|
|
|
|
|
|
4193
|
|
|
|
|
|
|
MIDI::XML::SysExChannel is used for representing SysExChannel objects |
|
4194
|
|
|
|
|
|
|
|
|
4195
|
|
|
|
|
|
|
=cut |
|
4196
|
|
|
|
|
|
|
|
|
4197
|
|
|
|
|
|
|
#=============================================================================== |
|
4198
|
|
|
|
|
|
|
|
|
4199
|
|
|
|
|
|
|
{ |
|
4200
|
|
|
|
|
|
|
no strict "refs"; |
|
4201
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SysExChannel'; }; |
|
4202
|
|
|
|
|
|
|
} |
|
4203
|
|
|
|
|
|
|
|
|
4204
|
|
|
|
|
|
|
#=============================================================================== |
|
4205
|
|
|
|
|
|
|
# MIDI::XML::SysExChannel::Multiplier |
|
4206
|
|
|
|
|
|
|
|
|
4207
|
|
|
|
|
|
|
=head2 $value = $Object->Multiplier([$new_value]); |
|
4208
|
|
|
|
|
|
|
|
|
4209
|
|
|
|
|
|
|
Set or get value of the Multiplier attribute. |
|
4210
|
|
|
|
|
|
|
|
|
4211
|
|
|
|
|
|
|
|
|
4212
|
|
|
|
|
|
|
Type: int |
|
4213
|
|
|
|
|
|
|
Lower: 1 |
|
4214
|
|
|
|
|
|
|
Upper: 1 |
|
4215
|
|
|
|
|
|
|
|
|
4216
|
|
|
|
|
|
|
=cut |
|
4217
|
|
|
|
|
|
|
|
|
4218
|
|
|
|
|
|
|
sub Multiplier() { |
|
4219
|
|
|
|
|
|
|
my $self = shift; |
|
4220
|
|
|
|
|
|
|
if (@_) { |
|
4221
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4222
|
|
|
|
|
|
|
$self->setAttribute('Multiplier', shift); |
|
4223
|
|
|
|
|
|
|
} else { |
|
4224
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Multiplier\''; |
|
4225
|
|
|
|
|
|
|
} |
|
4226
|
|
|
|
|
|
|
} |
|
4227
|
|
|
|
|
|
|
return $self->getAttribute('Multiplier'); |
|
4228
|
|
|
|
|
|
|
} |
|
4229
|
|
|
|
|
|
|
|
|
4230
|
|
|
|
|
|
|
#=============================================================================== |
|
4231
|
|
|
|
|
|
|
# MIDI::XML::SysExChannel::Offset |
|
4232
|
|
|
|
|
|
|
|
|
4233
|
|
|
|
|
|
|
=head2 $value = $Object->Offset([$new_value]); |
|
4234
|
|
|
|
|
|
|
|
|
4235
|
|
|
|
|
|
|
Set or get value of the Offset attribute. |
|
4236
|
|
|
|
|
|
|
|
|
4237
|
|
|
|
|
|
|
|
|
4238
|
|
|
|
|
|
|
Type: int |
|
4239
|
|
|
|
|
|
|
Lower: 1 |
|
4240
|
|
|
|
|
|
|
Upper: 1 |
|
4241
|
|
|
|
|
|
|
|
|
4242
|
|
|
|
|
|
|
=cut |
|
4243
|
|
|
|
|
|
|
|
|
4244
|
|
|
|
|
|
|
sub Offset() { |
|
4245
|
|
|
|
|
|
|
my $self = shift; |
|
4246
|
|
|
|
|
|
|
if (@_) { |
|
4247
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4248
|
|
|
|
|
|
|
$self->setAttribute('Offset', shift); |
|
4249
|
|
|
|
|
|
|
} else { |
|
4250
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Offset\''; |
|
4251
|
|
|
|
|
|
|
} |
|
4252
|
|
|
|
|
|
|
} |
|
4253
|
|
|
|
|
|
|
return $self->getAttribute('Offset'); |
|
4254
|
|
|
|
|
|
|
} |
|
4255
|
|
|
|
|
|
|
|
|
4256
|
|
|
|
|
|
|
##END_PACKAGE SysExChannel |
|
4257
|
|
|
|
|
|
|
|
|
4258
|
|
|
|
|
|
|
#=============================================================================== |
|
4259
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4260
|
|
|
|
|
|
|
# UML Model UUID: aa85196a-468f-11dd-8bf4-00502c05c241 |
|
4261
|
|
|
|
|
|
|
|
|
4262
|
|
|
|
|
|
|
package MIDI::XML::MTCQuarterFrame; |
|
4263
|
|
|
|
|
|
|
|
|
4264
|
|
|
|
|
|
|
use Carp; |
|
4265
|
|
|
|
|
|
|
|
|
4266
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4267
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4268
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4269
|
|
|
|
|
|
|
|
|
4270
|
|
|
|
|
|
|
=head1 DESCRIPTION of MTCQuarterFrame |
|
4271
|
|
|
|
|
|
|
|
|
4272
|
|
|
|
|
|
|
MIDI::XML::MTCQuarterFrame is used for representing MTCQuarterFrame objects |
|
4273
|
|
|
|
|
|
|
|
|
4274
|
|
|
|
|
|
|
=cut |
|
4275
|
|
|
|
|
|
|
|
|
4276
|
|
|
|
|
|
|
#=============================================================================== |
|
4277
|
|
|
|
|
|
|
|
|
4278
|
|
|
|
|
|
|
{ |
|
4279
|
|
|
|
|
|
|
no strict "refs"; |
|
4280
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'MTCQuarterFrame'; }; |
|
4281
|
|
|
|
|
|
|
} |
|
4282
|
|
|
|
|
|
|
|
|
4283
|
|
|
|
|
|
|
#=============================================================================== |
|
4284
|
|
|
|
|
|
|
# MIDI::XML::MTCQuarterFrame::MessageType |
|
4285
|
|
|
|
|
|
|
|
|
4286
|
|
|
|
|
|
|
=head2 $value = $Object->MessageType([$new_value]); |
|
4287
|
|
|
|
|
|
|
|
|
4288
|
|
|
|
|
|
|
Set or get value of the MessageType attribute. |
|
4289
|
|
|
|
|
|
|
|
|
4290
|
|
|
|
|
|
|
|
|
4291
|
|
|
|
|
|
|
Type: mtc_category |
|
4292
|
|
|
|
|
|
|
Lower: 1 |
|
4293
|
|
|
|
|
|
|
Upper: 1 |
|
4294
|
|
|
|
|
|
|
|
|
4295
|
|
|
|
|
|
|
=cut |
|
4296
|
|
|
|
|
|
|
|
|
4297
|
|
|
|
|
|
|
sub MessageType() { |
|
4298
|
|
|
|
|
|
|
my $self = shift; |
|
4299
|
|
|
|
|
|
|
if (@_) { |
|
4300
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4301
|
|
|
|
|
|
|
$self->setAttribute('MessageType', shift); |
|
4302
|
|
|
|
|
|
|
} else { |
|
4303
|
|
|
|
|
|
|
if(ref($_[0])) { |
|
4304
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::mtc_category\' for attribute \'MessageType\''; |
|
4305
|
|
|
|
|
|
|
} else { |
|
4306
|
|
|
|
|
|
|
carp 'Found scalar \'' . $_[0] . '\', expecting type \'MIDI::XML::mtc_category\' for attribute \'MessageType\''; |
|
4307
|
|
|
|
|
|
|
} |
|
4308
|
|
|
|
|
|
|
} |
|
4309
|
|
|
|
|
|
|
} |
|
4310
|
|
|
|
|
|
|
return $self->getAttribute('MessageType'); |
|
4311
|
|
|
|
|
|
|
} |
|
4312
|
|
|
|
|
|
|
|
|
4313
|
|
|
|
|
|
|
#=============================================================================== |
|
4314
|
|
|
|
|
|
|
# MIDI::XML::MTCQuarterFrame::DataNibble |
|
4315
|
|
|
|
|
|
|
|
|
4316
|
|
|
|
|
|
|
=head2 $value = $Object->DataNibble([$new_value]); |
|
4317
|
|
|
|
|
|
|
|
|
4318
|
|
|
|
|
|
|
Set or get value of the DataNibble attribute. |
|
4319
|
|
|
|
|
|
|
|
|
4320
|
|
|
|
|
|
|
|
|
4321
|
|
|
|
|
|
|
Type: nybble |
|
4322
|
|
|
|
|
|
|
Lower: 1 |
|
4323
|
|
|
|
|
|
|
Upper: 1 |
|
4324
|
|
|
|
|
|
|
|
|
4325
|
|
|
|
|
|
|
=cut |
|
4326
|
|
|
|
|
|
|
|
|
4327
|
|
|
|
|
|
|
sub DataNibble() { |
|
4328
|
|
|
|
|
|
|
my $self = shift; |
|
4329
|
|
|
|
|
|
|
if (@_) { |
|
4330
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4331
|
|
|
|
|
|
|
$self->setAttribute('DataNibble', shift); |
|
4332
|
|
|
|
|
|
|
} else { |
|
4333
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'DataNibble\''; |
|
4334
|
|
|
|
|
|
|
} |
|
4335
|
|
|
|
|
|
|
} |
|
4336
|
|
|
|
|
|
|
return $self->getAttribute('DataNibble'); |
|
4337
|
|
|
|
|
|
|
} |
|
4338
|
|
|
|
|
|
|
|
|
4339
|
|
|
|
|
|
|
#=============================================================================== |
|
4340
|
|
|
|
|
|
|
|
|
4341
|
|
|
|
|
|
|
sub _bytes { |
|
4342
|
|
|
|
|
|
|
my $self = shift; |
|
4343
|
|
|
|
|
|
|
|
|
4344
|
|
|
|
|
|
|
my $status = 0xF1; |
|
4345
|
|
|
|
|
|
|
my $d1 = ($self->MessageType() << 4) + ($self->DataNibble() & 0x0f);; |
|
4346
|
|
|
|
|
|
|
my @bytes = ($status, $d1); |
|
4347
|
|
|
|
|
|
|
|
|
4348
|
|
|
|
|
|
|
if(wantarray()) { |
|
4349
|
|
|
|
|
|
|
return @bytes; |
|
4350
|
|
|
|
|
|
|
} |
|
4351
|
|
|
|
|
|
|
|
|
4352
|
|
|
|
|
|
|
return \@bytes; |
|
4353
|
|
|
|
|
|
|
} |
|
4354
|
|
|
|
|
|
|
|
|
4355
|
|
|
|
|
|
|
##END_PACKAGE MTCQuarterFrame |
|
4356
|
|
|
|
|
|
|
|
|
4357
|
|
|
|
|
|
|
#=============================================================================== |
|
4358
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4359
|
|
|
|
|
|
|
# UML Model UUID: bdb7313c-468f-11dd-8bf4-00502c05c241 |
|
4360
|
|
|
|
|
|
|
|
|
4361
|
|
|
|
|
|
|
package MIDI::XML::SongPositionPointer; |
|
4362
|
|
|
|
|
|
|
|
|
4363
|
|
|
|
|
|
|
use Carp; |
|
4364
|
|
|
|
|
|
|
|
|
4365
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4366
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4367
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4368
|
|
|
|
|
|
|
|
|
4369
|
|
|
|
|
|
|
=head1 DESCRIPTION of SongPositionPointer |
|
4370
|
|
|
|
|
|
|
|
|
4371
|
|
|
|
|
|
|
MIDI::XML::SongPositionPointer is used for representing SongPositionPointer objects |
|
4372
|
|
|
|
|
|
|
|
|
4373
|
|
|
|
|
|
|
=cut |
|
4374
|
|
|
|
|
|
|
|
|
4375
|
|
|
|
|
|
|
#=============================================================================== |
|
4376
|
|
|
|
|
|
|
|
|
4377
|
|
|
|
|
|
|
{ |
|
4378
|
|
|
|
|
|
|
no strict "refs"; |
|
4379
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SongPositionPointer'; }; |
|
4380
|
|
|
|
|
|
|
} |
|
4381
|
|
|
|
|
|
|
|
|
4382
|
|
|
|
|
|
|
#=============================================================================== |
|
4383
|
|
|
|
|
|
|
# MIDI::XML::SongPositionPointer::Position |
|
4384
|
|
|
|
|
|
|
|
|
4385
|
|
|
|
|
|
|
=head2 $value = $Object->Position([$new_value]); |
|
4386
|
|
|
|
|
|
|
|
|
4387
|
|
|
|
|
|
|
Set or get value of the Position attribute. |
|
4388
|
|
|
|
|
|
|
|
|
4389
|
|
|
|
|
|
|
|
|
4390
|
|
|
|
|
|
|
Type: short |
|
4391
|
|
|
|
|
|
|
Lower: 1 |
|
4392
|
|
|
|
|
|
|
Upper: 1 |
|
4393
|
|
|
|
|
|
|
|
|
4394
|
|
|
|
|
|
|
=cut |
|
4395
|
|
|
|
|
|
|
|
|
4396
|
|
|
|
|
|
|
sub Position() { |
|
4397
|
|
|
|
|
|
|
my $self = shift; |
|
4398
|
|
|
|
|
|
|
if (@_) { |
|
4399
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4400
|
|
|
|
|
|
|
$self->setAttribute('Position', shift); |
|
4401
|
|
|
|
|
|
|
} else { |
|
4402
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Position\''; |
|
4403
|
|
|
|
|
|
|
} |
|
4404
|
|
|
|
|
|
|
} |
|
4405
|
|
|
|
|
|
|
return $self->getAttribute('Position'); |
|
4406
|
|
|
|
|
|
|
} |
|
4407
|
|
|
|
|
|
|
|
|
4408
|
|
|
|
|
|
|
#=============================================================================== |
|
4409
|
|
|
|
|
|
|
|
|
4410
|
|
|
|
|
|
|
sub _bytes { |
|
4411
|
|
|
|
|
|
|
my $self = shift; |
|
4412
|
|
|
|
|
|
|
|
|
4413
|
|
|
|
|
|
|
my $status = 0xF2; |
|
4414
|
|
|
|
|
|
|
my $p = $self->Position(); |
|
4415
|
|
|
|
|
|
|
my $d1 = $p & 0x7F; |
|
4416
|
|
|
|
|
|
|
my $d2 = ($p >> 7) & 0x7F; |
|
4417
|
|
|
|
|
|
|
my @bytes = ($status, $d1, $d2); |
|
4418
|
|
|
|
|
|
|
|
|
4419
|
|
|
|
|
|
|
if(wantarray()) { |
|
4420
|
|
|
|
|
|
|
return @bytes; |
|
4421
|
|
|
|
|
|
|
} |
|
4422
|
|
|
|
|
|
|
|
|
4423
|
|
|
|
|
|
|
return \@bytes; |
|
4424
|
|
|
|
|
|
|
} |
|
4425
|
|
|
|
|
|
|
|
|
4426
|
|
|
|
|
|
|
##END_PACKAGE SongPositionPointer |
|
4427
|
|
|
|
|
|
|
|
|
4428
|
|
|
|
|
|
|
#=============================================================================== |
|
4429
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4430
|
|
|
|
|
|
|
# UML Model UUID: d62b435e-468f-11dd-8bf4-00502c05c241 |
|
4431
|
|
|
|
|
|
|
|
|
4432
|
|
|
|
|
|
|
package MIDI::XML::SongSelect; |
|
4433
|
|
|
|
|
|
|
|
|
4434
|
|
|
|
|
|
|
use Carp; |
|
4435
|
|
|
|
|
|
|
|
|
4436
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4437
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4438
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4439
|
|
|
|
|
|
|
|
|
4440
|
|
|
|
|
|
|
=head1 DESCRIPTION of SongSelect |
|
4441
|
|
|
|
|
|
|
|
|
4442
|
|
|
|
|
|
|
MIDI::XML::SongSelect is used for representing SongSelect objects |
|
4443
|
|
|
|
|
|
|
|
|
4444
|
|
|
|
|
|
|
=cut |
|
4445
|
|
|
|
|
|
|
|
|
4446
|
|
|
|
|
|
|
#=============================================================================== |
|
4447
|
|
|
|
|
|
|
|
|
4448
|
|
|
|
|
|
|
{ |
|
4449
|
|
|
|
|
|
|
no strict "refs"; |
|
4450
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SongSelect'; }; |
|
4451
|
|
|
|
|
|
|
} |
|
4452
|
|
|
|
|
|
|
|
|
4453
|
|
|
|
|
|
|
#=============================================================================== |
|
4454
|
|
|
|
|
|
|
# MIDI::XML::SongSelect::Number |
|
4455
|
|
|
|
|
|
|
|
|
4456
|
|
|
|
|
|
|
=head2 $value = $Object->Number([$new_value]); |
|
4457
|
|
|
|
|
|
|
|
|
4458
|
|
|
|
|
|
|
Set or get value of the Number attribute. |
|
4459
|
|
|
|
|
|
|
|
|
4460
|
|
|
|
|
|
|
|
|
4461
|
|
|
|
|
|
|
Type: byte |
|
4462
|
|
|
|
|
|
|
Lower: 1 |
|
4463
|
|
|
|
|
|
|
Upper: 1 |
|
4464
|
|
|
|
|
|
|
|
|
4465
|
|
|
|
|
|
|
=cut |
|
4466
|
|
|
|
|
|
|
|
|
4467
|
|
|
|
|
|
|
sub Number() { |
|
4468
|
|
|
|
|
|
|
my $self = shift; |
|
4469
|
|
|
|
|
|
|
if (@_) { |
|
4470
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
4471
|
|
|
|
|
|
|
$self->setAttribute('Number', shift); |
|
4472
|
|
|
|
|
|
|
} else { |
|
4473
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Number\''; |
|
4474
|
|
|
|
|
|
|
} |
|
4475
|
|
|
|
|
|
|
} |
|
4476
|
|
|
|
|
|
|
return $self->getAttribute('Number'); |
|
4477
|
|
|
|
|
|
|
} |
|
4478
|
|
|
|
|
|
|
|
|
4479
|
|
|
|
|
|
|
#=============================================================================== |
|
4480
|
|
|
|
|
|
|
|
|
4481
|
|
|
|
|
|
|
sub _bytes { |
|
4482
|
|
|
|
|
|
|
my $self = shift; |
|
4483
|
|
|
|
|
|
|
|
|
4484
|
|
|
|
|
|
|
my $status = 0xF3; |
|
4485
|
|
|
|
|
|
|
my $d1 = $self->Number(); |
|
4486
|
|
|
|
|
|
|
my @bytes = ($status, $d1); |
|
4487
|
|
|
|
|
|
|
|
|
4488
|
|
|
|
|
|
|
if(wantarray()) { |
|
4489
|
|
|
|
|
|
|
return @bytes; |
|
4490
|
|
|
|
|
|
|
} |
|
4491
|
|
|
|
|
|
|
|
|
4492
|
|
|
|
|
|
|
return \@bytes; |
|
4493
|
|
|
|
|
|
|
} |
|
4494
|
|
|
|
|
|
|
|
|
4495
|
|
|
|
|
|
|
##END_PACKAGE SongSelect |
|
4496
|
|
|
|
|
|
|
|
|
4497
|
|
|
|
|
|
|
#=============================================================================== |
|
4498
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4499
|
|
|
|
|
|
|
# UML Model UUID: dfdcccd0-468f-11dd-8bf4-00502c05c241 |
|
4500
|
|
|
|
|
|
|
|
|
4501
|
|
|
|
|
|
|
package MIDI::XML::TuneRequest; |
|
4502
|
|
|
|
|
|
|
|
|
4503
|
|
|
|
|
|
|
use Carp; |
|
4504
|
|
|
|
|
|
|
|
|
4505
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4506
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4507
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4508
|
|
|
|
|
|
|
|
|
4509
|
|
|
|
|
|
|
=head1 DESCRIPTION of TuneRequest |
|
4510
|
|
|
|
|
|
|
|
|
4511
|
|
|
|
|
|
|
MIDI::XML::TuneRequest is a class encapsulating MIDI Tune Request messages. |
|
4512
|
|
|
|
|
|
|
A Tune Request message includes either a delta time or absolute time as |
|
4513
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Tune Request event encoded |
|
4514
|
|
|
|
|
|
|
in 1 byte as follows: |
|
4515
|
|
|
|
|
|
|
|
|
4516
|
|
|
|
|
|
|
11110110 |
|
4517
|
|
|
|
|
|
|
|
|
4518
|
|
|
|
|
|
|
The class for MIDI Tune Request messages is derived from MIDI::XML::MIDISystemMessage. |
|
4519
|
|
|
|
|
|
|
|
|
4520
|
|
|
|
|
|
|
=cut |
|
4521
|
|
|
|
|
|
|
|
|
4522
|
|
|
|
|
|
|
#=============================================================================== |
|
4523
|
|
|
|
|
|
|
|
|
4524
|
|
|
|
|
|
|
{ |
|
4525
|
|
|
|
|
|
|
no strict "refs"; |
|
4526
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TuneRequest'; }; |
|
4527
|
|
|
|
|
|
|
} |
|
4528
|
|
|
|
|
|
|
|
|
4529
|
|
|
|
|
|
|
#=============================================================================== |
|
4530
|
|
|
|
|
|
|
|
|
4531
|
|
|
|
|
|
|
sub _bytes { |
|
4532
|
|
|
|
|
|
|
my $self = shift; |
|
4533
|
|
|
|
|
|
|
|
|
4534
|
|
|
|
|
|
|
my @bytes = (0xF6); |
|
4535
|
|
|
|
|
|
|
|
|
4536
|
|
|
|
|
|
|
if(wantarray()) { |
|
4537
|
|
|
|
|
|
|
return @bytes; |
|
4538
|
|
|
|
|
|
|
} |
|
4539
|
|
|
|
|
|
|
|
|
4540
|
|
|
|
|
|
|
return \@bytes; |
|
4541
|
|
|
|
|
|
|
} |
|
4542
|
|
|
|
|
|
|
|
|
4543
|
|
|
|
|
|
|
##END_PACKAGE TuneRequest |
|
4544
|
|
|
|
|
|
|
|
|
4545
|
|
|
|
|
|
|
#=============================================================================== |
|
4546
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4547
|
|
|
|
|
|
|
# UML Model UUID: e8c11b32-468f-11dd-8bf4-00502c05c241 |
|
4548
|
|
|
|
|
|
|
|
|
4549
|
|
|
|
|
|
|
package MIDI::XML::TimingClock; |
|
4550
|
|
|
|
|
|
|
|
|
4551
|
|
|
|
|
|
|
use Carp; |
|
4552
|
|
|
|
|
|
|
|
|
4553
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4554
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4555
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4556
|
|
|
|
|
|
|
|
|
4557
|
|
|
|
|
|
|
=head1 DESCRIPTION of TimingClock |
|
4558
|
|
|
|
|
|
|
|
|
4559
|
|
|
|
|
|
|
MIDI::XML::TimingClock is a class encapsulating MIDI Timing Clock messages. |
|
4560
|
|
|
|
|
|
|
A Timing Clock message includes either a delta time or absolute time as |
|
4561
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Timing Clock event encoded |
|
4562
|
|
|
|
|
|
|
in 1 byte as follows: |
|
4563
|
|
|
|
|
|
|
|
|
4564
|
|
|
|
|
|
|
11111000 |
|
4565
|
|
|
|
|
|
|
|
|
4566
|
|
|
|
|
|
|
The class for MIDI Timing Clock messages is derived from MIDI::XML::MIDISystemMessage. |
|
4567
|
|
|
|
|
|
|
|
|
4568
|
|
|
|
|
|
|
=cut |
|
4569
|
|
|
|
|
|
|
|
|
4570
|
|
|
|
|
|
|
#=============================================================================== |
|
4571
|
|
|
|
|
|
|
|
|
4572
|
|
|
|
|
|
|
{ |
|
4573
|
|
|
|
|
|
|
no strict "refs"; |
|
4574
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TimingClock'; }; |
|
4575
|
|
|
|
|
|
|
} |
|
4576
|
|
|
|
|
|
|
|
|
4577
|
|
|
|
|
|
|
#=============================================================================== |
|
4578
|
|
|
|
|
|
|
|
|
4579
|
|
|
|
|
|
|
sub _bytes { |
|
4580
|
|
|
|
|
|
|
my $self = shift; |
|
4581
|
|
|
|
|
|
|
|
|
4582
|
|
|
|
|
|
|
my @bytes = (0xF8); |
|
4583
|
|
|
|
|
|
|
|
|
4584
|
|
|
|
|
|
|
if(wantarray()) { |
|
4585
|
|
|
|
|
|
|
return @bytes; |
|
4586
|
|
|
|
|
|
|
} |
|
4587
|
|
|
|
|
|
|
|
|
4588
|
|
|
|
|
|
|
return \@bytes; |
|
4589
|
|
|
|
|
|
|
} |
|
4590
|
|
|
|
|
|
|
|
|
4591
|
|
|
|
|
|
|
##END_PACKAGE TimingClock |
|
4592
|
|
|
|
|
|
|
|
|
4593
|
|
|
|
|
|
|
#=============================================================================== |
|
4594
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4595
|
|
|
|
|
|
|
# UML Model UUID: f1964e64-468f-11dd-8bf4-00502c05c241 |
|
4596
|
|
|
|
|
|
|
|
|
4597
|
|
|
|
|
|
|
package MIDI::XML::Start; |
|
4598
|
|
|
|
|
|
|
|
|
4599
|
|
|
|
|
|
|
use Carp; |
|
4600
|
|
|
|
|
|
|
|
|
4601
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4602
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4603
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4604
|
|
|
|
|
|
|
|
|
4605
|
|
|
|
|
|
|
=head1 DESCRIPTION of Start |
|
4606
|
|
|
|
|
|
|
|
|
4607
|
|
|
|
|
|
|
MIDI::XML::Start is a class encapsulating MIDI Start messages. |
|
4608
|
|
|
|
|
|
|
A Start message includes either a delta time or absolute time as |
|
4609
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Start event encoded |
|
4610
|
|
|
|
|
|
|
in 1 byte as follows: |
|
4611
|
|
|
|
|
|
|
|
|
4612
|
|
|
|
|
|
|
11111010 |
|
4613
|
|
|
|
|
|
|
|
|
4614
|
|
|
|
|
|
|
The class for MIDI Start messages is derived from MIDI::XML::MIDISystemMessage. |
|
4615
|
|
|
|
|
|
|
|
|
4616
|
|
|
|
|
|
|
=cut |
|
4617
|
|
|
|
|
|
|
|
|
4618
|
|
|
|
|
|
|
#=============================================================================== |
|
4619
|
|
|
|
|
|
|
|
|
4620
|
|
|
|
|
|
|
{ |
|
4621
|
|
|
|
|
|
|
no strict "refs"; |
|
4622
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Start'; }; |
|
4623
|
|
|
|
|
|
|
} |
|
4624
|
|
|
|
|
|
|
|
|
4625
|
|
|
|
|
|
|
#=============================================================================== |
|
4626
|
|
|
|
|
|
|
|
|
4627
|
|
|
|
|
|
|
sub _bytes { |
|
4628
|
|
|
|
|
|
|
my $self = shift; |
|
4629
|
|
|
|
|
|
|
|
|
4630
|
|
|
|
|
|
|
my @bytes = (0xFA); |
|
4631
|
|
|
|
|
|
|
|
|
4632
|
|
|
|
|
|
|
if(wantarray()) { |
|
4633
|
|
|
|
|
|
|
return @bytes; |
|
4634
|
|
|
|
|
|
|
} |
|
4635
|
|
|
|
|
|
|
|
|
4636
|
|
|
|
|
|
|
return \@bytes; |
|
4637
|
|
|
|
|
|
|
} |
|
4638
|
|
|
|
|
|
|
|
|
4639
|
|
|
|
|
|
|
##END_PACKAGE Start |
|
4640
|
|
|
|
|
|
|
|
|
4641
|
|
|
|
|
|
|
#=============================================================================== |
|
4642
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4643
|
|
|
|
|
|
|
# UML Model UUID: f9945b76-468f-11dd-8bf4-00502c05c241 |
|
4644
|
|
|
|
|
|
|
|
|
4645
|
|
|
|
|
|
|
package MIDI::XML::Continue; |
|
4646
|
|
|
|
|
|
|
|
|
4647
|
|
|
|
|
|
|
use Carp; |
|
4648
|
|
|
|
|
|
|
|
|
4649
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4650
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4651
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4652
|
|
|
|
|
|
|
|
|
4653
|
|
|
|
|
|
|
=head1 DESCRIPTION of Continue |
|
4654
|
|
|
|
|
|
|
|
|
4655
|
|
|
|
|
|
|
MIDI::XML::Continue is a class encapsulating MIDI Continue messages. |
|
4656
|
|
|
|
|
|
|
A Continue message includes either a delta time or absolute time as |
|
4657
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Continue event encoded |
|
4658
|
|
|
|
|
|
|
in 1 byte as follows: |
|
4659
|
|
|
|
|
|
|
|
|
4660
|
|
|
|
|
|
|
11111011 |
|
4661
|
|
|
|
|
|
|
|
|
4662
|
|
|
|
|
|
|
The class for MIDI Continue messages is derived from MIDI::XML::MIDISystemMessage. |
|
4663
|
|
|
|
|
|
|
|
|
4664
|
|
|
|
|
|
|
=cut |
|
4665
|
|
|
|
|
|
|
|
|
4666
|
|
|
|
|
|
|
#=============================================================================== |
|
4667
|
|
|
|
|
|
|
|
|
4668
|
|
|
|
|
|
|
{ |
|
4669
|
|
|
|
|
|
|
no strict "refs"; |
|
4670
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Continue'; }; |
|
4671
|
|
|
|
|
|
|
} |
|
4672
|
|
|
|
|
|
|
|
|
4673
|
|
|
|
|
|
|
#=============================================================================== |
|
4674
|
|
|
|
|
|
|
|
|
4675
|
|
|
|
|
|
|
sub _bytes { |
|
4676
|
|
|
|
|
|
|
my $self = shift; |
|
4677
|
|
|
|
|
|
|
|
|
4678
|
|
|
|
|
|
|
my @bytes = (0xFB); |
|
4679
|
|
|
|
|
|
|
|
|
4680
|
|
|
|
|
|
|
if(wantarray()) { |
|
4681
|
|
|
|
|
|
|
return @bytes; |
|
4682
|
|
|
|
|
|
|
} |
|
4683
|
|
|
|
|
|
|
|
|
4684
|
|
|
|
|
|
|
return \@bytes; |
|
4685
|
|
|
|
|
|
|
} |
|
4686
|
|
|
|
|
|
|
|
|
4687
|
|
|
|
|
|
|
##END_PACKAGE Continue |
|
4688
|
|
|
|
|
|
|
|
|
4689
|
|
|
|
|
|
|
#=============================================================================== |
|
4690
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4691
|
|
|
|
|
|
|
# UML Model UUID: 01a24708-4690-11dd-8bf4-00502c05c241 |
|
4692
|
|
|
|
|
|
|
|
|
4693
|
|
|
|
|
|
|
package MIDI::XML::Stop; |
|
4694
|
|
|
|
|
|
|
|
|
4695
|
|
|
|
|
|
|
use Carp; |
|
4696
|
|
|
|
|
|
|
|
|
4697
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4698
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4699
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4700
|
|
|
|
|
|
|
|
|
4701
|
|
|
|
|
|
|
=head1 DESCRIPTION of Stop |
|
4702
|
|
|
|
|
|
|
|
|
4703
|
|
|
|
|
|
|
MIDI::XML::Stop is a class encapsulating MIDI Stop messages. |
|
4704
|
|
|
|
|
|
|
A Stop message includes either a delta time or absolute time as |
|
4705
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Stop event encoded |
|
4706
|
|
|
|
|
|
|
in 1 byte as follows: |
|
4707
|
|
|
|
|
|
|
|
|
4708
|
|
|
|
|
|
|
11111100 |
|
4709
|
|
|
|
|
|
|
|
|
4710
|
|
|
|
|
|
|
The class for MIDI Stop messages is derived from MIDI::XML::MIDISystemMessage. |
|
4711
|
|
|
|
|
|
|
|
|
4712
|
|
|
|
|
|
|
=cut |
|
4713
|
|
|
|
|
|
|
|
|
4714
|
|
|
|
|
|
|
#=============================================================================== |
|
4715
|
|
|
|
|
|
|
|
|
4716
|
|
|
|
|
|
|
{ |
|
4717
|
|
|
|
|
|
|
no strict "refs"; |
|
4718
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Stop'; }; |
|
4719
|
|
|
|
|
|
|
} |
|
4720
|
|
|
|
|
|
|
|
|
4721
|
|
|
|
|
|
|
#=============================================================================== |
|
4722
|
|
|
|
|
|
|
|
|
4723
|
|
|
|
|
|
|
sub _bytes { |
|
4724
|
|
|
|
|
|
|
my $self = shift; |
|
4725
|
|
|
|
|
|
|
|
|
4726
|
|
|
|
|
|
|
my @bytes = (0xFC); |
|
4727
|
|
|
|
|
|
|
|
|
4728
|
|
|
|
|
|
|
if(wantarray()) { |
|
4729
|
|
|
|
|
|
|
return @bytes; |
|
4730
|
|
|
|
|
|
|
} |
|
4731
|
|
|
|
|
|
|
|
|
4732
|
|
|
|
|
|
|
return \@bytes; |
|
4733
|
|
|
|
|
|
|
} |
|
4734
|
|
|
|
|
|
|
|
|
4735
|
|
|
|
|
|
|
##END_PACKAGE Stop |
|
4736
|
|
|
|
|
|
|
|
|
4737
|
|
|
|
|
|
|
#=============================================================================== |
|
4738
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4739
|
|
|
|
|
|
|
# UML Model UUID: 092d46fa-4690-11dd-8bf4-00502c05c241 |
|
4740
|
|
|
|
|
|
|
|
|
4741
|
|
|
|
|
|
|
package MIDI::XML::ActiveSensing; |
|
4742
|
|
|
|
|
|
|
|
|
4743
|
|
|
|
|
|
|
use Carp; |
|
4744
|
|
|
|
|
|
|
|
|
4745
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4746
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4747
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4748
|
|
|
|
|
|
|
|
|
4749
|
|
|
|
|
|
|
=head1 DESCRIPTION of ActiveSensing |
|
4750
|
|
|
|
|
|
|
|
|
4751
|
|
|
|
|
|
|
MIDI::XML::ActiveSensing is a class encapsulating MIDI Active Sensing messages. |
|
4752
|
|
|
|
|
|
|
An Active Sensing message includes either a delta time or absolute time as |
|
4753
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI Active Sensing event encoded |
|
4754
|
|
|
|
|
|
|
in 1 byte as follows: |
|
4755
|
|
|
|
|
|
|
|
|
4756
|
|
|
|
|
|
|
11111110 |
|
4757
|
|
|
|
|
|
|
|
|
4758
|
|
|
|
|
|
|
The class for MIDI Active Sensing messages is derived from MIDI::XML::MIDISystemMessage. |
|
4759
|
|
|
|
|
|
|
|
|
4760
|
|
|
|
|
|
|
=cut |
|
4761
|
|
|
|
|
|
|
|
|
4762
|
|
|
|
|
|
|
#=============================================================================== |
|
4763
|
|
|
|
|
|
|
|
|
4764
|
|
|
|
|
|
|
{ |
|
4765
|
|
|
|
|
|
|
no strict "refs"; |
|
4766
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'ActiveSensing'; }; |
|
4767
|
|
|
|
|
|
|
} |
|
4768
|
|
|
|
|
|
|
|
|
4769
|
|
|
|
|
|
|
#=============================================================================== |
|
4770
|
|
|
|
|
|
|
|
|
4771
|
|
|
|
|
|
|
sub _bytes { |
|
4772
|
|
|
|
|
|
|
my $self = shift; |
|
4773
|
|
|
|
|
|
|
|
|
4774
|
|
|
|
|
|
|
my @bytes = (0xFE); |
|
4775
|
|
|
|
|
|
|
|
|
4776
|
|
|
|
|
|
|
if(wantarray()) { |
|
4777
|
|
|
|
|
|
|
return @bytes; |
|
4778
|
|
|
|
|
|
|
} |
|
4779
|
|
|
|
|
|
|
|
|
4780
|
|
|
|
|
|
|
return \@bytes; |
|
4781
|
|
|
|
|
|
|
} |
|
4782
|
|
|
|
|
|
|
|
|
4783
|
|
|
|
|
|
|
##END_PACKAGE ActiveSensing |
|
4784
|
|
|
|
|
|
|
|
|
4785
|
|
|
|
|
|
|
#=============================================================================== |
|
4786
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4787
|
|
|
|
|
|
|
# UML Model UUID: 222751fc-4690-11dd-8bf4-00502c05c241 |
|
4788
|
|
|
|
|
|
|
|
|
4789
|
|
|
|
|
|
|
package MIDI::XML::SystemReset; |
|
4790
|
|
|
|
|
|
|
|
|
4791
|
|
|
|
|
|
|
use Carp; |
|
4792
|
|
|
|
|
|
|
|
|
4793
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDISystemMessage); |
|
4794
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4795
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4796
|
|
|
|
|
|
|
|
|
4797
|
|
|
|
|
|
|
=head1 DESCRIPTION of SystemReset |
|
4798
|
|
|
|
|
|
|
|
|
4799
|
|
|
|
|
|
|
MIDI::XML::SystemReset is a class encapsulating MIDI System Reset messages. |
|
4800
|
|
|
|
|
|
|
A System Reset message includes either a delta time or absolute time as |
|
4801
|
|
|
|
|
|
|
implemented by MIDI::XML::Message and the MIDI System Reset event encoded |
|
4802
|
|
|
|
|
|
|
in 1 byte as follows: |
|
4803
|
|
|
|
|
|
|
|
|
4804
|
|
|
|
|
|
|
11111111 |
|
4805
|
|
|
|
|
|
|
|
|
4806
|
|
|
|
|
|
|
The class for MIDI System Reset messages is derived from MIDI::XML::MIDISystemMessage. |
|
4807
|
|
|
|
|
|
|
|
|
4808
|
|
|
|
|
|
|
=cut |
|
4809
|
|
|
|
|
|
|
|
|
4810
|
|
|
|
|
|
|
#=============================================================================== |
|
4811
|
|
|
|
|
|
|
|
|
4812
|
|
|
|
|
|
|
{ |
|
4813
|
|
|
|
|
|
|
no strict "refs"; |
|
4814
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SystemReset'; }; |
|
4815
|
|
|
|
|
|
|
} |
|
4816
|
|
|
|
|
|
|
|
|
4817
|
|
|
|
|
|
|
#=============================================================================== |
|
4818
|
|
|
|
|
|
|
|
|
4819
|
|
|
|
|
|
|
sub _bytes { |
|
4820
|
|
|
|
|
|
|
my $self = shift; |
|
4821
|
|
|
|
|
|
|
|
|
4822
|
|
|
|
|
|
|
my @bytes = (0xFF); |
|
4823
|
|
|
|
|
|
|
|
|
4824
|
|
|
|
|
|
|
if(wantarray()) { |
|
4825
|
|
|
|
|
|
|
return @bytes; |
|
4826
|
|
|
|
|
|
|
} |
|
4827
|
|
|
|
|
|
|
|
|
4828
|
|
|
|
|
|
|
return \@bytes; |
|
4829
|
|
|
|
|
|
|
} |
|
4830
|
|
|
|
|
|
|
|
|
4831
|
|
|
|
|
|
|
##END_PACKAGE SystemReset |
|
4832
|
|
|
|
|
|
|
|
|
4833
|
|
|
|
|
|
|
#=============================================================================== |
|
4834
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4835
|
|
|
|
|
|
|
# UML Model UUID: fb0a8b4e-4690-11dd-8bf4-00502c05c241 |
|
4836
|
|
|
|
|
|
|
|
|
4837
|
|
|
|
|
|
|
package MIDI::XML::MIDISystemMessage; |
|
4838
|
|
|
|
|
|
|
|
|
4839
|
|
|
|
|
|
|
use Carp; |
|
4840
|
|
|
|
|
|
|
|
|
4841
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::SmfEvent); |
|
4842
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4843
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4844
|
|
|
|
|
|
|
|
|
4845
|
|
|
|
|
|
|
=head1 DESCRIPTION of MIDISystemMessage |
|
4846
|
|
|
|
|
|
|
|
|
4847
|
|
|
|
|
|
|
MIDI::XML::MIDISystemMessage is used for representing MIDISystemMessage objects |
|
4848
|
|
|
|
|
|
|
|
|
4849
|
|
|
|
|
|
|
=cut |
|
4850
|
|
|
|
|
|
|
|
|
4851
|
|
|
|
|
|
|
##=============================================================================== |
|
4852
|
|
|
|
|
|
|
|
|
4853
|
|
|
|
|
|
|
#{ |
|
4854
|
|
|
|
|
|
|
# no strict "refs"; |
|
4855
|
|
|
|
|
|
|
# *TAG_NAME = sub { return 'midi-system-message'; }; |
|
4856
|
|
|
|
|
|
|
#} |
|
4857
|
|
|
|
|
|
|
|
|
4858
|
|
|
|
|
|
|
##END_PACKAGE MIDISystemMessage |
|
4859
|
|
|
|
|
|
|
|
|
4860
|
|
|
|
|
|
|
#=============================================================================== |
|
4861
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
4862
|
|
|
|
|
|
|
# UML Model UUID: 31f31103-45a0-11dd-8bf4-00502c05c241 |
|
4863
|
|
|
|
|
|
|
|
|
4864
|
|
|
|
|
|
|
package MIDI::XML::MIDIfile; |
|
4865
|
|
|
|
|
|
|
|
|
4866
|
|
|
|
|
|
|
use Carp; |
|
4867
|
|
|
|
|
|
|
|
|
4868
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element); |
|
4869
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
4870
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
4871
|
|
|
|
|
|
|
|
|
4872
|
|
|
|
|
|
|
=head1 DESCRIPTION of MIDIfile |
|
4873
|
|
|
|
|
|
|
|
|
4874
|
|
|
|
|
|
|
MIDI::XML::MIDIfile is used for representing MIDIfile objects |
|
4875
|
|
|
|
|
|
|
|
|
4876
|
|
|
|
|
|
|
=cut |
|
4877
|
|
|
|
|
|
|
|
|
4878
|
|
|
|
|
|
|
#=============================================================================== |
|
4879
|
|
|
|
|
|
|
|
|
4880
|
|
|
|
|
|
|
{ |
|
4881
|
|
|
|
|
|
|
no strict "refs"; |
|
4882
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'MIDIFile'; }; |
|
4883
|
|
|
|
|
|
|
} |
|
4884
|
|
|
|
|
|
|
|
|
4885
|
|
|
|
|
|
|
#=============================================================================== |
|
4886
|
|
|
|
|
|
|
# MIDI::XML::MIDIfile::Format |
|
4887
|
|
|
|
|
|
|
|
|
4888
|
|
|
|
|
|
|
=head2 $value = $Object->Format([$new_value]); |
|
4889
|
|
|
|
|
|
|
|
|
4890
|
|
|
|
|
|
|
Set or get value of the Format attribute. |
|
4891
|
|
|
|
|
|
|
|
|
4892
|
|
|
|
|
|
|
Format indicates MIDI format 0, 1, or 2. So far only types 0 and 1 are explicitly supported by the MIDI XML format. |
|
4893
|
|
|
|
|
|
|
Type: int |
|
4894
|
|
|
|
|
|
|
Lower: 1 |
|
4895
|
|
|
|
|
|
|
Upper: 1 |
|
4896
|
|
|
|
|
|
|
|
|
4897
|
|
|
|
|
|
|
=cut |
|
4898
|
|
|
|
|
|
|
|
|
4899
|
|
|
|
|
|
|
sub Format() { |
|
4900
|
|
|
|
|
|
|
my $self = shift; |
|
4901
|
|
|
|
|
|
|
if (@_) { |
|
4902
|
|
|
|
|
|
|
my $newval = shift; |
|
4903
|
|
|
|
|
|
|
if (ref($newval)) { |
|
4904
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
4905
|
|
|
|
|
|
|
if ('MIDI::XML::int' =~ /$regexp/ ) { |
|
4906
|
|
|
|
|
|
|
$self->attribute_as_element('Format', $newval); |
|
4907
|
|
|
|
|
|
|
} else { |
|
4908
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::int\' for attribute \'Format\''; |
|
4909
|
|
|
|
|
|
|
} |
|
4910
|
|
|
|
|
|
|
} else { |
|
4911
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('Format'); |
|
4912
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
4913
|
|
|
|
|
|
|
$self->attribute_as_element('Format',$newelem); |
|
4914
|
|
|
|
|
|
|
} |
|
4915
|
|
|
|
|
|
|
} |
|
4916
|
|
|
|
|
|
|
return $self->attribute_as_element('Format')->[0][0]->getNodeValue(); |
|
4917
|
|
|
|
|
|
|
} |
|
4918
|
|
|
|
|
|
|
|
|
4919
|
|
|
|
|
|
|
#=============================================================================== |
|
4920
|
|
|
|
|
|
|
# MIDI::XML::MIDIfile::TrackCount |
|
4921
|
|
|
|
|
|
|
|
|
4922
|
|
|
|
|
|
|
=head2 $value = $Object->TrackCount([$new_value]); |
|
4923
|
|
|
|
|
|
|
|
|
4924
|
|
|
|
|
|
|
Set or get value of the TrackCount attribute. |
|
4925
|
|
|
|
|
|
|
|
|
4926
|
|
|
|
|
|
|
TrackCount indicate the number of tracks in a file: 1 for type 0, usually more for types 1 and 2. The TrackCount matches the number of Track elements in the MIDI XML file. |
|
4927
|
|
|
|
|
|
|
Type: int |
|
4928
|
|
|
|
|
|
|
Lower: 1 |
|
4929
|
|
|
|
|
|
|
Upper: 1 |
|
4930
|
|
|
|
|
|
|
|
|
4931
|
|
|
|
|
|
|
=cut |
|
4932
|
|
|
|
|
|
|
|
|
4933
|
|
|
|
|
|
|
sub TrackCount() { |
|
4934
|
|
|
|
|
|
|
my $self = shift; |
|
4935
|
|
|
|
|
|
|
if (@_) { |
|
4936
|
|
|
|
|
|
|
my $newval = shift; |
|
4937
|
|
|
|
|
|
|
if (ref($newval)) { |
|
4938
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
4939
|
|
|
|
|
|
|
if ('MIDI::XML::int' =~ /$regexp/ ) { |
|
4940
|
|
|
|
|
|
|
$self->attribute_as_element('TrackCount', $newval); |
|
4941
|
|
|
|
|
|
|
} else { |
|
4942
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::int\' for attribute \'TrackCount\''; |
|
4943
|
|
|
|
|
|
|
} |
|
4944
|
|
|
|
|
|
|
} else { |
|
4945
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('TrackCount'); |
|
4946
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
4947
|
|
|
|
|
|
|
$self->attribute_as_element('TrackCount',$newelem); |
|
4948
|
|
|
|
|
|
|
} |
|
4949
|
|
|
|
|
|
|
} |
|
4950
|
|
|
|
|
|
|
return $self->attribute_as_element('TrackCount')->[0][0]->getNodeValue(); |
|
4951
|
|
|
|
|
|
|
} |
|
4952
|
|
|
|
|
|
|
|
|
4953
|
|
|
|
|
|
|
#=============================================================================== |
|
4954
|
|
|
|
|
|
|
# MIDI::XML::MIDIfile::TicksPerBeat |
|
4955
|
|
|
|
|
|
|
|
|
4956
|
|
|
|
|
|
|
=head2 $value = $Object->TicksPerBeat([$new_value]); |
|
4957
|
|
|
|
|
|
|
|
|
4958
|
|
|
|
|
|
|
Set or get value of the TicksPerBeat attribute. |
|
4959
|
|
|
|
|
|
|
|
|
4960
|
|
|
|
|
|
|
How many ticks in a beat (MIDI quarter note). |
|
4961
|
|
|
|
|
|
|
Type: int |
|
4962
|
|
|
|
|
|
|
Lower: 1 |
|
4963
|
|
|
|
|
|
|
Upper: 1 |
|
4964
|
|
|
|
|
|
|
|
|
4965
|
|
|
|
|
|
|
=cut |
|
4966
|
|
|
|
|
|
|
|
|
4967
|
|
|
|
|
|
|
sub TicksPerBeat() { |
|
4968
|
|
|
|
|
|
|
my $self = shift; |
|
4969
|
|
|
|
|
|
|
if (@_) { |
|
4970
|
|
|
|
|
|
|
my $newval = shift; |
|
4971
|
|
|
|
|
|
|
if (ref($newval)) { |
|
4972
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
4973
|
|
|
|
|
|
|
if ('MIDI::XML::int' =~ /$regexp/ ) { |
|
4974
|
|
|
|
|
|
|
$self->attribute_as_element('TicksPerBeat', $newval); |
|
4975
|
|
|
|
|
|
|
} else { |
|
4976
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::int\' for attribute \'TicksPerBeat\''; |
|
4977
|
|
|
|
|
|
|
} |
|
4978
|
|
|
|
|
|
|
} else { |
|
4979
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('TicksPerBeat'); |
|
4980
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
4981
|
|
|
|
|
|
|
$self->attribute_as_element('TicksPerBeat',$newelem); |
|
4982
|
|
|
|
|
|
|
} |
|
4983
|
|
|
|
|
|
|
} |
|
4984
|
|
|
|
|
|
|
return $self->attribute_as_element('TicksPerBeat')->[0][0]->getNodeValue(); |
|
4985
|
|
|
|
|
|
|
} |
|
4986
|
|
|
|
|
|
|
|
|
4987
|
|
|
|
|
|
|
#=============================================================================== |
|
4988
|
|
|
|
|
|
|
# MIDI::XML::MIDIfile::FrameRate |
|
4989
|
|
|
|
|
|
|
|
|
4990
|
|
|
|
|
|
|
=head2 $value = $Object->FrameRate([$new_value]); |
|
4991
|
|
|
|
|
|
|
|
|
4992
|
|
|
|
|
|
|
Set or get value of the FrameRate attribute. |
|
4993
|
|
|
|
|
|
|
|
|
4994
|
|
|
|
|
|
|
Frame rate and ticks per frame are used with SMPTE time codes. |
|
4995
|
|
|
|
|
|
|
Type: int |
|
4996
|
|
|
|
|
|
|
Lower: 1 |
|
4997
|
|
|
|
|
|
|
Upper: 1 |
|
4998
|
|
|
|
|
|
|
|
|
4999
|
|
|
|
|
|
|
=cut |
|
5000
|
|
|
|
|
|
|
|
|
5001
|
|
|
|
|
|
|
sub FrameRate() { |
|
5002
|
|
|
|
|
|
|
my $self = shift; |
|
5003
|
|
|
|
|
|
|
if (@_) { |
|
5004
|
|
|
|
|
|
|
my $newval = shift; |
|
5005
|
|
|
|
|
|
|
if (ref($newval)) { |
|
5006
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5007
|
|
|
|
|
|
|
if ('MIDI::XML::int' =~ /$regexp/ ) { |
|
5008
|
|
|
|
|
|
|
$self->attribute_as_element('FrameRate', $newval); |
|
5009
|
|
|
|
|
|
|
} else { |
|
5010
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::int\' for attribute \'FrameRate\''; |
|
5011
|
|
|
|
|
|
|
} |
|
5012
|
|
|
|
|
|
|
} else { |
|
5013
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('FrameRate'); |
|
5014
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
5015
|
|
|
|
|
|
|
$self->attribute_as_element('FrameRate',$newelem); |
|
5016
|
|
|
|
|
|
|
} |
|
5017
|
|
|
|
|
|
|
} |
|
5018
|
|
|
|
|
|
|
my $fr = $self->attribute_as_element('FrameRate'); |
|
5019
|
|
|
|
|
|
|
if(defined($fr)) { |
|
5020
|
|
|
|
|
|
|
return $self->attribute_as_element('FrameRate')->[0][0]->getNodeValue(); |
|
5021
|
|
|
|
|
|
|
} |
|
5022
|
|
|
|
|
|
|
return undef; |
|
5023
|
|
|
|
|
|
|
} |
|
5024
|
|
|
|
|
|
|
|
|
5025
|
|
|
|
|
|
|
#=============================================================================== |
|
5026
|
|
|
|
|
|
|
# MIDI::XML::MIDIfile::TicksPerFrame |
|
5027
|
|
|
|
|
|
|
|
|
5028
|
|
|
|
|
|
|
=head2 $value = $Object->TicksPerFrame([$new_value]); |
|
5029
|
|
|
|
|
|
|
|
|
5030
|
|
|
|
|
|
|
Set or get value of the TicksPerFrame attribute. |
|
5031
|
|
|
|
|
|
|
|
|
5032
|
|
|
|
|
|
|
Frame rate and ticks per frame are used with SMPTE time codes. |
|
5033
|
|
|
|
|
|
|
Type: int |
|
5034
|
|
|
|
|
|
|
Lower: 1 |
|
5035
|
|
|
|
|
|
|
Upper: 1 |
|
5036
|
|
|
|
|
|
|
|
|
5037
|
|
|
|
|
|
|
=cut |
|
5038
|
|
|
|
|
|
|
|
|
5039
|
|
|
|
|
|
|
sub TicksPerFrame() { |
|
5040
|
|
|
|
|
|
|
my $self = shift; |
|
5041
|
|
|
|
|
|
|
if (@_) { |
|
5042
|
|
|
|
|
|
|
my $newval = shift; |
|
5043
|
|
|
|
|
|
|
if (ref($newval)) { |
|
5044
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5045
|
|
|
|
|
|
|
if ('MIDI::XML::int' =~ /$regexp/ ) { |
|
5046
|
|
|
|
|
|
|
$self->attribute_as_element('TicksPerFrame', $newval); |
|
5047
|
|
|
|
|
|
|
} else { |
|
5048
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::int\' for attribute \'TicksPerFrame\''; |
|
5049
|
|
|
|
|
|
|
} |
|
5050
|
|
|
|
|
|
|
} else { |
|
5051
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('TicksPerFrame'); |
|
5052
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
5053
|
|
|
|
|
|
|
$self->attribute_as_element('TicksPerFrame',$newelem); |
|
5054
|
|
|
|
|
|
|
} |
|
5055
|
|
|
|
|
|
|
} |
|
5056
|
|
|
|
|
|
|
return $self->attribute_as_element('TicksPerFrame')->[0][0]->getNodeValue(); |
|
5057
|
|
|
|
|
|
|
} |
|
5058
|
|
|
|
|
|
|
|
|
5059
|
|
|
|
|
|
|
#=============================================================================== |
|
5060
|
|
|
|
|
|
|
# MIDI::XML::MIDIfile::TimestampType |
|
5061
|
|
|
|
|
|
|
|
|
5062
|
|
|
|
|
|
|
=head2 $value = $Object->TimestampType([$new_value]); |
|
5063
|
|
|
|
|
|
|
|
|
5064
|
|
|
|
|
|
|
Set or get value of the TimestampType attribute. |
|
5065
|
|
|
|
|
|
|
|
|
5066
|
|
|
|
|
|
|
TimestampType should be Delta or Absolute. Indicates the element name to look |
|
5067
|
|
|
|
|
|
|
for in the initial timestamp in each MIDI event. |
|
5068
|
|
|
|
|
|
|
|
|
5069
|
|
|
|
|
|
|
Type: timestamp_type |
|
5070
|
|
|
|
|
|
|
Lower: 1 |
|
5071
|
|
|
|
|
|
|
Upper: 1 |
|
5072
|
|
|
|
|
|
|
|
|
5073
|
|
|
|
|
|
|
=cut |
|
5074
|
|
|
|
|
|
|
|
|
5075
|
|
|
|
|
|
|
sub TimestampType() { |
|
5076
|
|
|
|
|
|
|
my $self = shift; |
|
5077
|
|
|
|
|
|
|
if (@_) { |
|
5078
|
|
|
|
|
|
|
my $newval = shift; |
|
5079
|
|
|
|
|
|
|
if (ref($newval)) { |
|
5080
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5081
|
|
|
|
|
|
|
if ('MIDI::XML::timestamp_type' =~ /$regexp/ ) { |
|
5082
|
|
|
|
|
|
|
$self->attribute_as_element('TimestampType', $newval); |
|
5083
|
|
|
|
|
|
|
} else { |
|
5084
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::timestamp_type\' for attribute \'TimestampType\''; |
|
5085
|
|
|
|
|
|
|
} |
|
5086
|
|
|
|
|
|
|
} else { |
|
5087
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('TimestampType'); |
|
5088
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
5089
|
|
|
|
|
|
|
$self->attribute_as_element('TimestampType',$newelem); |
|
5090
|
|
|
|
|
|
|
} |
|
5091
|
|
|
|
|
|
|
} |
|
5092
|
|
|
|
|
|
|
return $self->attribute_as_element('TimestampType')->[0][0]->getNodeValue(); |
|
5093
|
|
|
|
|
|
|
} |
|
5094
|
|
|
|
|
|
|
|
|
5095
|
|
|
|
|
|
|
#=============================================================================== |
|
5096
|
|
|
|
|
|
|
# MIDI::XML::Track::track |
|
5097
|
|
|
|
|
|
|
|
|
5098
|
|
|
|
|
|
|
=item $arrayref = $Object->track(); |
|
5099
|
|
|
|
|
|
|
|
|
5100
|
|
|
|
|
|
|
Returns a reference to an array of the contained Track objects. |
|
5101
|
|
|
|
|
|
|
Get values of the track property. |
|
5102
|
|
|
|
|
|
|
|
|
5103
|
|
|
|
|
|
|
|
|
5104
|
|
|
|
|
|
|
Type: |
|
5105
|
|
|
|
|
|
|
|
|
5106
|
|
|
|
|
|
|
=cut |
|
5107
|
|
|
|
|
|
|
|
|
5108
|
|
|
|
|
|
|
sub track() { |
|
5109
|
|
|
|
|
|
|
my $self = shift; |
|
5110
|
|
|
|
|
|
|
return $self->{'_track'}; |
|
5111
|
|
|
|
|
|
|
} |
|
5112
|
|
|
|
|
|
|
|
|
5113
|
|
|
|
|
|
|
#=============================================================================== |
|
5114
|
|
|
|
|
|
|
# MIDI::XML::Track::track |
|
5115
|
|
|
|
|
|
|
|
|
5116
|
|
|
|
|
|
|
=item $value = $Object->push_track([$new_value]); |
|
5117
|
|
|
|
|
|
|
|
|
5118
|
|
|
|
|
|
|
Set or get value of the track attribute. |
|
5119
|
|
|
|
|
|
|
|
|
5120
|
|
|
|
|
|
|
|
|
5121
|
|
|
|
|
|
|
Type: |
|
5122
|
|
|
|
|
|
|
|
|
5123
|
|
|
|
|
|
|
=cut |
|
5124
|
|
|
|
|
|
|
|
|
5125
|
|
|
|
|
|
|
sub push_track() { |
|
5126
|
|
|
|
|
|
|
my $self = shift; |
|
5127
|
|
|
|
|
|
|
if (@_) { |
|
5128
|
|
|
|
|
|
|
$self->{'_track'} = [] unless(exists($self->{'_track'})); |
|
5129
|
|
|
|
|
|
|
push @{$self->{'_track'}}, shift; |
|
5130
|
|
|
|
|
|
|
} |
|
5131
|
|
|
|
|
|
|
return $self->{'_track'}; |
|
5132
|
|
|
|
|
|
|
} |
|
5133
|
|
|
|
|
|
|
|
|
5134
|
|
|
|
|
|
|
##END_PACKAGE MIDIfile |
|
5135
|
|
|
|
|
|
|
|
|
5136
|
|
|
|
|
|
|
#=============================================================================== |
|
5137
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5138
|
|
|
|
|
|
|
# UML Model UUID: 37ad642f-45aa-11dd-8bf4-00502c05c241 |
|
5139
|
|
|
|
|
|
|
|
|
5140
|
|
|
|
|
|
|
package MIDI::XML::Format; |
|
5141
|
|
|
|
|
|
|
|
|
5142
|
|
|
|
|
|
|
use Carp; |
|
5143
|
|
|
|
|
|
|
|
|
5144
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDIfile); |
|
5145
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5146
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5147
|
|
|
|
|
|
|
|
|
5148
|
|
|
|
|
|
|
=head1 DESCRIPTION of Format |
|
5149
|
|
|
|
|
|
|
|
|
5150
|
|
|
|
|
|
|
MIDI::XML::Format is used for representing Format objects Format indicates MIDI format 0, 1, or 2. So far only types 0 and 1 are explicitly supported by the MIDI XML format. |
|
5151
|
|
|
|
|
|
|
|
|
5152
|
|
|
|
|
|
|
=cut |
|
5153
|
|
|
|
|
|
|
|
|
5154
|
|
|
|
|
|
|
#=============================================================================== |
|
5155
|
|
|
|
|
|
|
|
|
5156
|
|
|
|
|
|
|
{ |
|
5157
|
|
|
|
|
|
|
no strict "refs"; |
|
5158
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Format'; }; |
|
5159
|
|
|
|
|
|
|
} |
|
5160
|
|
|
|
|
|
|
|
|
5161
|
|
|
|
|
|
|
##END_PACKAGE Format |
|
5162
|
|
|
|
|
|
|
|
|
5163
|
|
|
|
|
|
|
#=============================================================================== |
|
5164
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5165
|
|
|
|
|
|
|
# UML Model UUID: 5dcb14f0-45aa-11dd-8bf4-00502c05c241 |
|
5166
|
|
|
|
|
|
|
|
|
5167
|
|
|
|
|
|
|
package MIDI::XML::TrackCount; |
|
5168
|
|
|
|
|
|
|
|
|
5169
|
|
|
|
|
|
|
use Carp; |
|
5170
|
|
|
|
|
|
|
|
|
5171
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDIfile); |
|
5172
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5173
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5174
|
|
|
|
|
|
|
|
|
5175
|
|
|
|
|
|
|
=head1 DESCRIPTION of TrackCount |
|
5176
|
|
|
|
|
|
|
|
|
5177
|
|
|
|
|
|
|
MIDI::XML::TrackCount is used for representing TrackCount objects TrackCount indicate the number of tracks in a file: 1 for type 0, usually more for types 1 and 2. The TrackCount matches the number of Track elements in the MIDI XML file. |
|
5178
|
|
|
|
|
|
|
|
|
5179
|
|
|
|
|
|
|
=cut |
|
5180
|
|
|
|
|
|
|
|
|
5181
|
|
|
|
|
|
|
#=============================================================================== |
|
5182
|
|
|
|
|
|
|
|
|
5183
|
|
|
|
|
|
|
{ |
|
5184
|
|
|
|
|
|
|
no strict "refs"; |
|
5185
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TrackCount'; }; |
|
5186
|
|
|
|
|
|
|
} |
|
5187
|
|
|
|
|
|
|
|
|
5188
|
|
|
|
|
|
|
##END_PACKAGE TrackCount |
|
5189
|
|
|
|
|
|
|
|
|
5190
|
|
|
|
|
|
|
#=============================================================================== |
|
5191
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5192
|
|
|
|
|
|
|
# UML Model UUID: b146b1c1-45aa-11dd-8bf4-00502c05c241 |
|
5193
|
|
|
|
|
|
|
|
|
5194
|
|
|
|
|
|
|
package MIDI::XML::TicksPerBeat; |
|
5195
|
|
|
|
|
|
|
|
|
5196
|
|
|
|
|
|
|
use Carp; |
|
5197
|
|
|
|
|
|
|
|
|
5198
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDIfile); |
|
5199
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5200
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5201
|
|
|
|
|
|
|
|
|
5202
|
|
|
|
|
|
|
=head1 DESCRIPTION of TicksPerBeat |
|
5203
|
|
|
|
|
|
|
|
|
5204
|
|
|
|
|
|
|
MIDI::XML::TicksPerBeat is used for representing TicksPerBeat objects How many ticks in a beat (MIDI quarter note). |
|
5205
|
|
|
|
|
|
|
|
|
5206
|
|
|
|
|
|
|
=cut |
|
5207
|
|
|
|
|
|
|
|
|
5208
|
|
|
|
|
|
|
#=============================================================================== |
|
5209
|
|
|
|
|
|
|
|
|
5210
|
|
|
|
|
|
|
{ |
|
5211
|
|
|
|
|
|
|
no strict "refs"; |
|
5212
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TicksPerBeat'; }; |
|
5213
|
|
|
|
|
|
|
} |
|
5214
|
|
|
|
|
|
|
|
|
5215
|
|
|
|
|
|
|
##END_PACKAGE TicksPerBeat |
|
5216
|
|
|
|
|
|
|
|
|
5217
|
|
|
|
|
|
|
#=============================================================================== |
|
5218
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5219
|
|
|
|
|
|
|
# UML Model UUID: be3a94f2-45aa-11dd-8bf4-00502c05c241 |
|
5220
|
|
|
|
|
|
|
|
|
5221
|
|
|
|
|
|
|
package MIDI::XML::FrameRate; |
|
5222
|
|
|
|
|
|
|
|
|
5223
|
|
|
|
|
|
|
use Carp; |
|
5224
|
|
|
|
|
|
|
|
|
5225
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDIfile); |
|
5226
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5227
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5228
|
|
|
|
|
|
|
|
|
5229
|
|
|
|
|
|
|
=head1 DESCRIPTION of FrameRate |
|
5230
|
|
|
|
|
|
|
|
|
5231
|
|
|
|
|
|
|
MIDI::XML::FrameRate is used for representing FrameRate objects Frame rate and ticks per frame are used with SMPTE time codes. |
|
5232
|
|
|
|
|
|
|
|
|
5233
|
|
|
|
|
|
|
=cut |
|
5234
|
|
|
|
|
|
|
|
|
5235
|
|
|
|
|
|
|
#=============================================================================== |
|
5236
|
|
|
|
|
|
|
|
|
5237
|
|
|
|
|
|
|
{ |
|
5238
|
|
|
|
|
|
|
no strict "refs"; |
|
5239
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'FrameRate'; }; |
|
5240
|
|
|
|
|
|
|
} |
|
5241
|
|
|
|
|
|
|
|
|
5242
|
|
|
|
|
|
|
##END_PACKAGE FrameRate |
|
5243
|
|
|
|
|
|
|
|
|
5244
|
|
|
|
|
|
|
#=============================================================================== |
|
5245
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5246
|
|
|
|
|
|
|
# UML Model UUID: 06ad55b3-45ab-11dd-8bf4-00502c05c241 |
|
5247
|
|
|
|
|
|
|
|
|
5248
|
|
|
|
|
|
|
package MIDI::XML::TicksPerFrame; |
|
5249
|
|
|
|
|
|
|
|
|
5250
|
|
|
|
|
|
|
use Carp; |
|
5251
|
|
|
|
|
|
|
|
|
5252
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDIfile); |
|
5253
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5254
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5255
|
|
|
|
|
|
|
|
|
5256
|
|
|
|
|
|
|
=head1 DESCRIPTION of TicksPerFrame |
|
5257
|
|
|
|
|
|
|
|
|
5258
|
|
|
|
|
|
|
MIDI::XML::TicksPerFrame is used for representing TicksPerFrame objects Frame rate and ticks per frame are used with SMPTE time codes. |
|
5259
|
|
|
|
|
|
|
|
|
5260
|
|
|
|
|
|
|
=cut |
|
5261
|
|
|
|
|
|
|
|
|
5262
|
|
|
|
|
|
|
#=============================================================================== |
|
5263
|
|
|
|
|
|
|
|
|
5264
|
|
|
|
|
|
|
{ |
|
5265
|
|
|
|
|
|
|
no strict "refs"; |
|
5266
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TicksPerFrame'; }; |
|
5267
|
|
|
|
|
|
|
} |
|
5268
|
|
|
|
|
|
|
|
|
5269
|
|
|
|
|
|
|
##END_PACKAGE TicksPerFrame |
|
5270
|
|
|
|
|
|
|
|
|
5271
|
|
|
|
|
|
|
#=============================================================================== |
|
5272
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5273
|
|
|
|
|
|
|
# UML Model UUID: 2609e634-45ab-11dd-8bf4-00502c05c241 |
|
5274
|
|
|
|
|
|
|
|
|
5275
|
|
|
|
|
|
|
package MIDI::XML::TimestampType; |
|
5276
|
|
|
|
|
|
|
|
|
5277
|
|
|
|
|
|
|
use Carp; |
|
5278
|
|
|
|
|
|
|
|
|
5279
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::MIDIfile); |
|
5280
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5281
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5282
|
|
|
|
|
|
|
|
|
5283
|
|
|
|
|
|
|
=head1 DESCRIPTION of TimestampType |
|
5284
|
|
|
|
|
|
|
|
|
5285
|
|
|
|
|
|
|
MIDI::XML::TimestampType is used for representing TimestampType objects TimestampType should be Delta or Absolute. Indicates the element name to look for in the initial timestamp in each MIDI event. |
|
5286
|
|
|
|
|
|
|
|
|
5287
|
|
|
|
|
|
|
=cut |
|
5288
|
|
|
|
|
|
|
|
|
5289
|
|
|
|
|
|
|
#=============================================================================== |
|
5290
|
|
|
|
|
|
|
|
|
5291
|
|
|
|
|
|
|
{ |
|
5292
|
|
|
|
|
|
|
no strict "refs"; |
|
5293
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'TimestampType'; }; |
|
5294
|
|
|
|
|
|
|
} |
|
5295
|
|
|
|
|
|
|
|
|
5296
|
|
|
|
|
|
|
##END_PACKAGE TimestampType |
|
5297
|
|
|
|
|
|
|
|
|
5298
|
|
|
|
|
|
|
#=============================================================================== |
|
5299
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5300
|
|
|
|
|
|
|
# UML Model UUID: 4c621699-45a5-11dd-8bf4-00502c05c241 |
|
5301
|
|
|
|
|
|
|
|
|
5302
|
|
|
|
|
|
|
package MIDI::XML::Track; |
|
5303
|
|
|
|
|
|
|
|
|
5304
|
|
|
|
|
|
|
use Carp; |
|
5305
|
|
|
|
|
|
|
|
|
5306
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element); |
|
5307
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5308
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5309
|
|
|
|
|
|
|
|
|
5310
|
|
|
|
|
|
|
BEGIN |
|
5311
|
|
|
|
|
|
|
{ |
|
5312
|
|
|
|
|
|
|
import XML::DOM::Node qw( :Fields ); |
|
5313
|
|
|
|
|
|
|
} |
|
5314
|
|
|
|
|
|
|
|
|
5315
|
|
|
|
|
|
|
=head1 DESCRIPTION of Track |
|
5316
|
|
|
|
|
|
|
|
|
5317
|
|
|
|
|
|
|
MIDI::XML::Track is used for representing Track objects |
|
5318
|
|
|
|
|
|
|
|
|
5319
|
|
|
|
|
|
|
=cut |
|
5320
|
|
|
|
|
|
|
|
|
5321
|
|
|
|
|
|
|
#=============================================================================== |
|
5322
|
|
|
|
|
|
|
|
|
5323
|
|
|
|
|
|
|
{ |
|
5324
|
|
|
|
|
|
|
no strict "refs"; |
|
5325
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Track'; }; |
|
5326
|
|
|
|
|
|
|
} |
|
5327
|
|
|
|
|
|
|
|
|
5328
|
|
|
|
|
|
|
#=============================================================================== |
|
5329
|
|
|
|
|
|
|
# MIDI::XML::Track::Number |
|
5330
|
|
|
|
|
|
|
|
|
5331
|
|
|
|
|
|
|
=head2 $value = $Object->Number([$new_value]); |
|
5332
|
|
|
|
|
|
|
|
|
5333
|
|
|
|
|
|
|
Set or get value of the Number attribute. |
|
5334
|
|
|
|
|
|
|
|
|
5335
|
|
|
|
|
|
|
|
|
5336
|
|
|
|
|
|
|
Type: int |
|
5337
|
|
|
|
|
|
|
Lower: 1 |
|
5338
|
|
|
|
|
|
|
Upper: 1 |
|
5339
|
|
|
|
|
|
|
|
|
5340
|
|
|
|
|
|
|
=cut |
|
5341
|
|
|
|
|
|
|
|
|
5342
|
|
|
|
|
|
|
sub Number() { |
|
5343
|
|
|
|
|
|
|
my $self = shift; |
|
5344
|
|
|
|
|
|
|
if (@_) { |
|
5345
|
|
|
|
|
|
|
if ($_[0] =~ /^[-+]?[0-9]+$/ ) { |
|
5346
|
|
|
|
|
|
|
$self->setAttribute('Number', shift); |
|
5347
|
|
|
|
|
|
|
} else { |
|
5348
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'Integer\' for attribute \'Number\''; |
|
5349
|
|
|
|
|
|
|
} |
|
5350
|
|
|
|
|
|
|
} |
|
5351
|
|
|
|
|
|
|
return $self->getAttribute('Number'); |
|
5352
|
|
|
|
|
|
|
} |
|
5353
|
|
|
|
|
|
|
|
|
5354
|
|
|
|
|
|
|
#=============================================================================== |
|
5355
|
|
|
|
|
|
|
# MIDI::XML::Event::event |
|
5356
|
|
|
|
|
|
|
|
|
5357
|
|
|
|
|
|
|
=item $arrayref = $Object->event(); |
|
5358
|
|
|
|
|
|
|
|
|
5359
|
|
|
|
|
|
|
Returns a reference to an array of the contained Event objects. |
|
5360
|
|
|
|
|
|
|
Get values of the event property. |
|
5361
|
|
|
|
|
|
|
|
|
5362
|
|
|
|
|
|
|
|
|
5363
|
|
|
|
|
|
|
Type: ArrayRef |
|
5364
|
|
|
|
|
|
|
|
|
5365
|
|
|
|
|
|
|
=cut |
|
5366
|
|
|
|
|
|
|
|
|
5367
|
|
|
|
|
|
|
sub event() { |
|
5368
|
|
|
|
|
|
|
my $self = shift; |
|
5369
|
|
|
|
|
|
|
return $self->{'_event'}; |
|
5370
|
|
|
|
|
|
|
} |
|
5371
|
|
|
|
|
|
|
|
|
5372
|
|
|
|
|
|
|
#=============================================================================== |
|
5373
|
|
|
|
|
|
|
# MIDI::XML::Event::event |
|
5374
|
|
|
|
|
|
|
|
|
5375
|
|
|
|
|
|
|
=item $value = $Object->push_event([$new_value]); |
|
5376
|
|
|
|
|
|
|
|
|
5377
|
|
|
|
|
|
|
Set or get value of the event attribute. |
|
5378
|
|
|
|
|
|
|
|
|
5379
|
|
|
|
|
|
|
|
|
5380
|
|
|
|
|
|
|
Return Type: ArrayRef |
|
5381
|
|
|
|
|
|
|
|
|
5382
|
|
|
|
|
|
|
=cut |
|
5383
|
|
|
|
|
|
|
|
|
5384
|
|
|
|
|
|
|
sub push_event() { |
|
5385
|
|
|
|
|
|
|
my $self = shift; |
|
5386
|
|
|
|
|
|
|
if (@_) { |
|
5387
|
|
|
|
|
|
|
$self->{'_event'} = [] unless(exists($self->{'_event'})); |
|
5388
|
|
|
|
|
|
|
push @{$self->{'_event'}}, shift; |
|
5389
|
|
|
|
|
|
|
} |
|
5390
|
|
|
|
|
|
|
return $self->{'_event'}; |
|
5391
|
|
|
|
|
|
|
} |
|
5392
|
|
|
|
|
|
|
|
|
5393
|
|
|
|
|
|
|
#=============================================================================== |
|
5394
|
|
|
|
|
|
|
# MIDI::XML::Event::name() |
|
5395
|
|
|
|
|
|
|
|
|
5396
|
|
|
|
|
|
|
=item $trackName = $Track->name(); |
|
5397
|
|
|
|
|
|
|
|
|
5398
|
|
|
|
|
|
|
Returns a the value of the first TrackName object in the Track. |
|
5399
|
|
|
|
|
|
|
|
|
5400
|
|
|
|
|
|
|
Type: String |
|
5401
|
|
|
|
|
|
|
|
|
5402
|
|
|
|
|
|
|
=cut |
|
5403
|
|
|
|
|
|
|
|
|
5404
|
|
|
|
|
|
|
sub name() { |
|
5405
|
|
|
|
|
|
|
my $self = shift; |
|
5406
|
|
|
|
|
|
|
|
|
5407
|
|
|
|
|
|
|
my @tns = $self->getElementsByTagName('TrackName'); |
|
5408
|
|
|
|
|
|
|
if (@tns) { |
|
5409
|
|
|
|
|
|
|
# return $tns[0]->[0]->getNodeValue(); |
|
5410
|
|
|
|
|
|
|
my $ch = $tns[0]->getChildNodes(); |
|
5411
|
|
|
|
|
|
|
if ($ch->getLength()>1) { |
|
5412
|
|
|
|
|
|
|
$tns[0]->normalize(); |
|
5413
|
|
|
|
|
|
|
} |
|
5414
|
|
|
|
|
|
|
return $ch->item(0)->getNodeValue(); |
|
5415
|
|
|
|
|
|
|
# return "$tns[0]->[0]"; |
|
5416
|
|
|
|
|
|
|
} |
|
5417
|
|
|
|
|
|
|
|
|
5418
|
|
|
|
|
|
|
return undef; |
|
5419
|
|
|
|
|
|
|
} |
|
5420
|
|
|
|
|
|
|
|
|
5421
|
|
|
|
|
|
|
#========================================================================== |
|
5422
|
|
|
|
|
|
|
|
|
5423
|
|
|
|
|
|
|
=item $end = $Track->end() or $Track->end('refresh'); |
|
5424
|
|
|
|
|
|
|
|
|
5425
|
|
|
|
|
|
|
Returns the absolute time for the end of the track. If called with |
|
5426
|
|
|
|
|
|
|
any parameter the value is refreshed before it is returned. |
|
5427
|
|
|
|
|
|
|
|
|
5428
|
|
|
|
|
|
|
=cut |
|
5429
|
|
|
|
|
|
|
|
|
5430
|
|
|
|
|
|
|
sub end { |
|
5431
|
|
|
|
|
|
|
my $self = shift; |
|
5432
|
|
|
|
|
|
|
my $abs = 0; |
|
5433
|
|
|
|
|
|
|
my $del = 0; |
|
5434
|
|
|
|
|
|
|
|
|
5435
|
|
|
|
|
|
|
if (@_) { |
|
5436
|
|
|
|
|
|
|
$self->[_UserData]{'_end'} = undef; |
|
5437
|
|
|
|
|
|
|
} |
|
5438
|
|
|
|
|
|
|
if (defined($self->[_UserData]{'_end'})) { |
|
5439
|
|
|
|
|
|
|
return $self->[_UserData]{'_end'}; |
|
5440
|
|
|
|
|
|
|
} |
|
5441
|
|
|
|
|
|
|
|
|
5442
|
|
|
|
|
|
|
my @events = $self->getElementsByTagName('Event'); |
|
5443
|
|
|
|
|
|
|
foreach my $event (@events) { |
|
5444
|
|
|
|
|
|
|
my $timestamp = $event->Timestamp; |
|
5445
|
|
|
|
|
|
|
my $value = $timestamp->value(); |
|
5446
|
|
|
|
|
|
|
my $tsclass = ref($timestamp); |
|
5447
|
|
|
|
|
|
|
if ($tsclass eq 'MIDI::XML::Delta') { |
|
5448
|
|
|
|
|
|
|
$abs += $value; |
|
5449
|
|
|
|
|
|
|
# $event->absolute($abs); |
|
5450
|
|
|
|
|
|
|
} elsif ($tsclass eq 'MIDI::XML::Absolute') { |
|
5451
|
|
|
|
|
|
|
$abs = $value; |
|
5452
|
|
|
|
|
|
|
} |
|
5453
|
|
|
|
|
|
|
} |
|
5454
|
|
|
|
|
|
|
$self->[_UserData]{'_end'} = $abs; |
|
5455
|
|
|
|
|
|
|
# print "end: $abs\n"; |
|
5456
|
|
|
|
|
|
|
return $self->[_UserData]{'_end'}; |
|
5457
|
|
|
|
|
|
|
} |
|
5458
|
|
|
|
|
|
|
|
|
5459
|
|
|
|
|
|
|
##END_PACKAGE Track |
|
5460
|
|
|
|
|
|
|
|
|
5461
|
|
|
|
|
|
|
#=============================================================================== |
|
5462
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5463
|
|
|
|
|
|
|
# UML Model UUID: 73a6e8b2-45ad-11dd-8bf4-00502c05c241 |
|
5464
|
|
|
|
|
|
|
|
|
5465
|
|
|
|
|
|
|
package MIDI::XML::Event; |
|
5466
|
|
|
|
|
|
|
|
|
5467
|
|
|
|
|
|
|
use Carp; |
|
5468
|
|
|
|
|
|
|
|
|
5469
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element); |
|
5470
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5471
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5472
|
|
|
|
|
|
|
|
|
5473
|
|
|
|
|
|
|
=head1 DESCRIPTION of Event |
|
5474
|
|
|
|
|
|
|
|
|
5475
|
|
|
|
|
|
|
MIDI::XML::Event is used for representing Event objects |
|
5476
|
|
|
|
|
|
|
|
|
5477
|
|
|
|
|
|
|
=cut |
|
5478
|
|
|
|
|
|
|
|
|
5479
|
|
|
|
|
|
|
#=============================================================================== |
|
5480
|
|
|
|
|
|
|
|
|
5481
|
|
|
|
|
|
|
{ |
|
5482
|
|
|
|
|
|
|
no strict "refs"; |
|
5483
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Event'; }; |
|
5484
|
|
|
|
|
|
|
} |
|
5485
|
|
|
|
|
|
|
|
|
5486
|
|
|
|
|
|
|
#=============================================================================== |
|
5487
|
|
|
|
|
|
|
# MIDI::XML::Event::Timestamp |
|
5488
|
|
|
|
|
|
|
|
|
5489
|
|
|
|
|
|
|
=head2 $value = $Object->Timestamp([$new_value]); |
|
5490
|
|
|
|
|
|
|
|
|
5491
|
|
|
|
|
|
|
Set or get value of the Timestamp attribute. |
|
5492
|
|
|
|
|
|
|
|
|
5493
|
|
|
|
|
|
|
|
|
5494
|
|
|
|
|
|
|
Type: Timestamp |
|
5495
|
|
|
|
|
|
|
Lower: 1 |
|
5496
|
|
|
|
|
|
|
Upper: 1 |
|
5497
|
|
|
|
|
|
|
|
|
5498
|
|
|
|
|
|
|
=cut |
|
5499
|
|
|
|
|
|
|
|
|
5500
|
|
|
|
|
|
|
sub Timestamp() { |
|
5501
|
|
|
|
|
|
|
my $self = shift; |
|
5502
|
|
|
|
|
|
|
if (@_) { |
|
5503
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5504
|
|
|
|
|
|
|
if ('MIDI::XML::Timestamp' =~ /$regexp/ ) { |
|
5505
|
|
|
|
|
|
|
$self->attribute_as_element('Timestamp', shift); |
|
5506
|
|
|
|
|
|
|
} else { |
|
5507
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::Timestamp\' for attribute \'Timestamp\''; |
|
5508
|
|
|
|
|
|
|
} |
|
5509
|
|
|
|
|
|
|
} |
|
5510
|
|
|
|
|
|
|
my @children = $self->getChildNodes(); |
|
5511
|
|
|
|
|
|
|
foreach my $child (@children) { |
|
5512
|
|
|
|
|
|
|
my $class = ref($child); |
|
5513
|
|
|
|
|
|
|
if($class eq 'MIDI::XML::Absolute' or $class eq 'MIDI::XML::Delta') { |
|
5514
|
|
|
|
|
|
|
return $child; |
|
5515
|
|
|
|
|
|
|
} |
|
5516
|
|
|
|
|
|
|
} |
|
5517
|
|
|
|
|
|
|
|
|
5518
|
|
|
|
|
|
|
return undef; # this should never happen |
|
5519
|
|
|
|
|
|
|
} |
|
5520
|
|
|
|
|
|
|
|
|
5521
|
|
|
|
|
|
|
#=============================================================================== |
|
5522
|
|
|
|
|
|
|
# MIDI::XML::Event::SmfEvent |
|
5523
|
|
|
|
|
|
|
|
|
5524
|
|
|
|
|
|
|
=head2 $value = $Object->SmfEvent([$new_value]); |
|
5525
|
|
|
|
|
|
|
|
|
5526
|
|
|
|
|
|
|
Set or get value of the SmfEvent attribute. |
|
5527
|
|
|
|
|
|
|
|
|
5528
|
|
|
|
|
|
|
|
|
5529
|
|
|
|
|
|
|
Type: SmfEvent |
|
5530
|
|
|
|
|
|
|
Lower: 1 |
|
5531
|
|
|
|
|
|
|
Upper: 1 |
|
5532
|
|
|
|
|
|
|
|
|
5533
|
|
|
|
|
|
|
=cut |
|
5534
|
|
|
|
|
|
|
|
|
5535
|
|
|
|
|
|
|
sub SmfEvent() { |
|
5536
|
|
|
|
|
|
|
my $self = shift; |
|
5537
|
|
|
|
|
|
|
if (@_) { |
|
5538
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5539
|
|
|
|
|
|
|
if ('MIDI::XML::SmfEvent' =~ /$regexp/ ) { |
|
5540
|
|
|
|
|
|
|
$self->attribute_as_element('SmfEvent', shift); |
|
5541
|
|
|
|
|
|
|
} else { |
|
5542
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::SmfEvent\' for attribute \'SmfEvent\''; |
|
5543
|
|
|
|
|
|
|
} |
|
5544
|
|
|
|
|
|
|
} |
|
5545
|
|
|
|
|
|
|
my $smfEvent = $self->attribute_as_element('SmfEvent'); |
|
5546
|
|
|
|
|
|
|
|
|
5547
|
|
|
|
|
|
|
unless (defined($smfEvent)) { |
|
5548
|
|
|
|
|
|
|
my @nodes = $self->getChildNodes(); |
|
5549
|
|
|
|
|
|
|
foreach my $node (@nodes) { |
|
5550
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($node))); |
|
5551
|
|
|
|
|
|
|
if ('MIDI::XML::SmfEvent' =~ /$regexp/ ) { |
|
5552
|
|
|
|
|
|
|
$self->attribute_as_element('SmfEvent', $node); |
|
5553
|
|
|
|
|
|
|
return $node; |
|
5554
|
|
|
|
|
|
|
} |
|
5555
|
|
|
|
|
|
|
} |
|
5556
|
|
|
|
|
|
|
} |
|
5557
|
|
|
|
|
|
|
|
|
5558
|
|
|
|
|
|
|
return $smfEvent; |
|
5559
|
|
|
|
|
|
|
} |
|
5560
|
|
|
|
|
|
|
|
|
5561
|
|
|
|
|
|
|
##END_PACKAGE Event |
|
5562
|
|
|
|
|
|
|
|
|
5563
|
|
|
|
|
|
|
#=============================================================================== |
|
5564
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5565
|
|
|
|
|
|
|
# UML Model UUID: 13e629d7-45ae-11dd-8bf4-00502c05c241 |
|
5566
|
|
|
|
|
|
|
|
|
5567
|
|
|
|
|
|
|
package MIDI::XML::Timestamp; |
|
5568
|
|
|
|
|
|
|
|
|
5569
|
|
|
|
|
|
|
use Carp; |
|
5570
|
|
|
|
|
|
|
|
|
5571
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element); |
|
5572
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5573
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5574
|
|
|
|
|
|
|
|
|
5575
|
|
|
|
|
|
|
=head1 DESCRIPTION of Timestamp |
|
5576
|
|
|
|
|
|
|
|
|
5577
|
|
|
|
|
|
|
MIDI::XML::Timestamp is used for representing Timestamp objects |
|
5578
|
|
|
|
|
|
|
|
|
5579
|
|
|
|
|
|
|
=cut |
|
5580
|
|
|
|
|
|
|
|
|
5581
|
|
|
|
|
|
|
#=============================================================================== |
|
5582
|
|
|
|
|
|
|
|
|
5583
|
|
|
|
|
|
|
{ |
|
5584
|
|
|
|
|
|
|
no strict "refs"; |
|
5585
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Timestamp'; }; |
|
5586
|
|
|
|
|
|
|
} |
|
5587
|
|
|
|
|
|
|
|
|
5588
|
|
|
|
|
|
|
#=============================================================================== |
|
5589
|
|
|
|
|
|
|
# MIDI::XML::Timestamp::Absolute |
|
5590
|
|
|
|
|
|
|
|
|
5591
|
|
|
|
|
|
|
=head2 $value = $Object->Absolute([$new_value]); |
|
5592
|
|
|
|
|
|
|
|
|
5593
|
|
|
|
|
|
|
Set or get value of the Absolute attribute. |
|
5594
|
|
|
|
|
|
|
|
|
5595
|
|
|
|
|
|
|
|
|
5596
|
|
|
|
|
|
|
Type: int |
|
5597
|
|
|
|
|
|
|
Lower: 1 |
|
5598
|
|
|
|
|
|
|
Upper: 1 |
|
5599
|
|
|
|
|
|
|
|
|
5600
|
|
|
|
|
|
|
=cut |
|
5601
|
|
|
|
|
|
|
|
|
5602
|
|
|
|
|
|
|
sub Absolute() { |
|
5603
|
|
|
|
|
|
|
my $self = shift; |
|
5604
|
|
|
|
|
|
|
|
|
5605
|
|
|
|
|
|
|
# my $sref = ref($self); |
|
5606
|
|
|
|
|
|
|
if (@_) { |
|
5607
|
|
|
|
|
|
|
my $newval = shift; |
|
5608
|
|
|
|
|
|
|
if (ref($newval)) { |
|
5609
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5610
|
|
|
|
|
|
|
if ('MIDI::XML::int' =~ /$regexp/ ) { |
|
5611
|
|
|
|
|
|
|
$self->attribute_as_element('Absolute', $newval); |
|
5612
|
|
|
|
|
|
|
} else { |
|
5613
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::int\' for attribute \'Absolute\''; |
|
5614
|
|
|
|
|
|
|
} |
|
5615
|
|
|
|
|
|
|
} else { |
|
5616
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('Absolute'); |
|
5617
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
5618
|
|
|
|
|
|
|
$self->attribute_as_element('Absolute',$newelem); |
|
5619
|
|
|
|
|
|
|
} |
|
5620
|
|
|
|
|
|
|
} |
|
5621
|
|
|
|
|
|
|
# if ($sref eq 'MIDI::XML::Absolute') { |
|
5622
|
|
|
|
|
|
|
# ) |
|
5623
|
|
|
|
|
|
|
# print 'ref 1',ref($self),',',ref($self->attribute_as_element('Absolute')),"\n"; |
|
5624
|
|
|
|
|
|
|
# print 'ref 2',ref($self->attribute_as_element('Absolute')->[0]),"\n"; |
|
5625
|
|
|
|
|
|
|
# print 'ref 3',ref($self->attribute_as_element('Absolute')->[0][0]),"\n"; |
|
5626
|
|
|
|
|
|
|
return $self->attribute_as_element('Absolute')->[0][0]->getNodeValue(); |
|
5627
|
|
|
|
|
|
|
} |
|
5628
|
|
|
|
|
|
|
|
|
5629
|
|
|
|
|
|
|
#=============================================================================== |
|
5630
|
|
|
|
|
|
|
# MIDI::XML::Timestamp::Delta |
|
5631
|
|
|
|
|
|
|
|
|
5632
|
|
|
|
|
|
|
=head2 $value = $Object->Delta([$new_value]); |
|
5633
|
|
|
|
|
|
|
|
|
5634
|
|
|
|
|
|
|
Set or get value of the Delta attribute. |
|
5635
|
|
|
|
|
|
|
|
|
5636
|
|
|
|
|
|
|
|
|
5637
|
|
|
|
|
|
|
Type: int |
|
5638
|
|
|
|
|
|
|
Lower: 1 |
|
5639
|
|
|
|
|
|
|
Upper: 1 |
|
5640
|
|
|
|
|
|
|
|
|
5641
|
|
|
|
|
|
|
=cut |
|
5642
|
|
|
|
|
|
|
|
|
5643
|
|
|
|
|
|
|
sub Delta() { |
|
5644
|
|
|
|
|
|
|
my $self = shift; |
|
5645
|
|
|
|
|
|
|
if (@_) { |
|
5646
|
|
|
|
|
|
|
my $newval = shift; |
|
5647
|
|
|
|
|
|
|
if (ref($newval)) { |
|
5648
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5649
|
|
|
|
|
|
|
if ('MIDI::XML::int' =~ /$regexp/ ) { |
|
5650
|
|
|
|
|
|
|
$self->attribute_as_element('Delta', $newval); |
|
5651
|
|
|
|
|
|
|
} else { |
|
5652
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::int\' for attribute \'Delta\''; |
|
5653
|
|
|
|
|
|
|
} |
|
5654
|
|
|
|
|
|
|
} else { |
|
5655
|
|
|
|
|
|
|
my $newelem = $self->getOwnerDocument->createElement('Delta'); |
|
5656
|
|
|
|
|
|
|
$newelem->appendChild($Document->createTextNode($newval)); |
|
5657
|
|
|
|
|
|
|
$self->attribute_as_element('Delta',$newelem); |
|
5658
|
|
|
|
|
|
|
} |
|
5659
|
|
|
|
|
|
|
} |
|
5660
|
|
|
|
|
|
|
return $self->attribute_as_element('Delta')->[0][0]->getNodeValue(); |
|
5661
|
|
|
|
|
|
|
} |
|
5662
|
|
|
|
|
|
|
|
|
5663
|
|
|
|
|
|
|
##END_PACKAGE Timestamp |
|
5664
|
|
|
|
|
|
|
|
|
5665
|
|
|
|
|
|
|
#=============================================================================== |
|
5666
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5667
|
|
|
|
|
|
|
# UML Model UUID: c7c8941d-45ae-11dd-8bf4-00502c05c241 |
|
5668
|
|
|
|
|
|
|
|
|
5669
|
|
|
|
|
|
|
package MIDI::XML::Absolute; |
|
5670
|
|
|
|
|
|
|
|
|
5671
|
|
|
|
|
|
|
use Carp; |
|
5672
|
|
|
|
|
|
|
|
|
5673
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::Timestamp); |
|
5674
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5675
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5676
|
|
|
|
|
|
|
|
|
5677
|
|
|
|
|
|
|
=head1 DESCRIPTION of Absolute |
|
5678
|
|
|
|
|
|
|
|
|
5679
|
|
|
|
|
|
|
MIDI::XML::Absolute is used for representing Absolute objects |
|
5680
|
|
|
|
|
|
|
|
|
5681
|
|
|
|
|
|
|
=cut |
|
5682
|
|
|
|
|
|
|
|
|
5683
|
|
|
|
|
|
|
#=============================================================================== |
|
5684
|
|
|
|
|
|
|
|
|
5685
|
|
|
|
|
|
|
{ |
|
5686
|
|
|
|
|
|
|
no strict "refs"; |
|
5687
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Absolute'; }; |
|
5688
|
|
|
|
|
|
|
} |
|
5689
|
|
|
|
|
|
|
|
|
5690
|
|
|
|
|
|
|
#=============================================================================== |
|
5691
|
|
|
|
|
|
|
# MIDI::XML::Absolute::value |
|
5692
|
|
|
|
|
|
|
|
|
5693
|
|
|
|
|
|
|
=head2 $value = $Object->Delta([$new_value]); |
|
5694
|
|
|
|
|
|
|
|
|
5695
|
|
|
|
|
|
|
Set or get value of the Absolute element. |
|
5696
|
|
|
|
|
|
|
|
|
5697
|
|
|
|
|
|
|
Type: int |
|
5698
|
|
|
|
|
|
|
Lower: 1 |
|
5699
|
|
|
|
|
|
|
Upper: 1 |
|
5700
|
|
|
|
|
|
|
|
|
5701
|
|
|
|
|
|
|
=cut |
|
5702
|
|
|
|
|
|
|
|
|
5703
|
|
|
|
|
|
|
sub value() { |
|
5704
|
|
|
|
|
|
|
my $self = shift; |
|
5705
|
|
|
|
|
|
|
return $self->[0][0]->getNodeValue(); |
|
5706
|
|
|
|
|
|
|
# return &MIDI::XML::Timestamp::Absolute(@_); |
|
5707
|
|
|
|
|
|
|
} |
|
5708
|
|
|
|
|
|
|
|
|
5709
|
|
|
|
|
|
|
##END_PACKAGE Absolute |
|
5710
|
|
|
|
|
|
|
|
|
5711
|
|
|
|
|
|
|
#=============================================================================== |
|
5712
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5713
|
|
|
|
|
|
|
# UML Model UUID: c7e56aee-45ae-11dd-8bf4-00502c05c241 |
|
5714
|
|
|
|
|
|
|
|
|
5715
|
|
|
|
|
|
|
package MIDI::XML::Delta; |
|
5716
|
|
|
|
|
|
|
|
|
5717
|
|
|
|
|
|
|
use Carp; |
|
5718
|
|
|
|
|
|
|
|
|
5719
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::Timestamp); |
|
5720
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5721
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5722
|
|
|
|
|
|
|
|
|
5723
|
|
|
|
|
|
|
=head1 DESCRIPTION of Delta |
|
5724
|
|
|
|
|
|
|
|
|
5725
|
|
|
|
|
|
|
MIDI::XML::Delta is used for representing Delta objects |
|
5726
|
|
|
|
|
|
|
|
|
5727
|
|
|
|
|
|
|
=cut |
|
5728
|
|
|
|
|
|
|
|
|
5729
|
|
|
|
|
|
|
#=============================================================================== |
|
5730
|
|
|
|
|
|
|
|
|
5731
|
|
|
|
|
|
|
{ |
|
5732
|
|
|
|
|
|
|
no strict "refs"; |
|
5733
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'Delta'; }; |
|
5734
|
|
|
|
|
|
|
} |
|
5735
|
|
|
|
|
|
|
|
|
5736
|
|
|
|
|
|
|
#=============================================================================== |
|
5737
|
|
|
|
|
|
|
# MIDI::XML::Delta::value |
|
5738
|
|
|
|
|
|
|
|
|
5739
|
|
|
|
|
|
|
=head2 $value = $Object->Delta([$new_value]); |
|
5740
|
|
|
|
|
|
|
|
|
5741
|
|
|
|
|
|
|
Set or get value of the Delta element. |
|
5742
|
|
|
|
|
|
|
|
|
5743
|
|
|
|
|
|
|
Type: int |
|
5744
|
|
|
|
|
|
|
Lower: 1 |
|
5745
|
|
|
|
|
|
|
Upper: 1 |
|
5746
|
|
|
|
|
|
|
|
|
5747
|
|
|
|
|
|
|
=cut |
|
5748
|
|
|
|
|
|
|
|
|
5749
|
|
|
|
|
|
|
sub value() { |
|
5750
|
|
|
|
|
|
|
my $self = shift; |
|
5751
|
|
|
|
|
|
|
return $self->[0][0]->getNodeValue(); |
|
5752
|
|
|
|
|
|
|
# return &MIDI::XML::Timestamp::Delta(@_); |
|
5753
|
|
|
|
|
|
|
} |
|
5754
|
|
|
|
|
|
|
|
|
5755
|
|
|
|
|
|
|
##END_PACKAGE Delta |
|
5756
|
|
|
|
|
|
|
|
|
5757
|
|
|
|
|
|
|
#=============================================================================== |
|
5758
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5759
|
|
|
|
|
|
|
# UML Model UUID: 5743577a-45ae-11dd-8bf4-00502c05c241 |
|
5760
|
|
|
|
|
|
|
|
|
5761
|
|
|
|
|
|
|
package MIDI::XML::SmfEvent; |
|
5762
|
|
|
|
|
|
|
|
|
5763
|
|
|
|
|
|
|
use Carp; |
|
5764
|
|
|
|
|
|
|
|
|
5765
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element); |
|
5766
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5767
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5768
|
|
|
|
|
|
|
|
|
5769
|
|
|
|
|
|
|
=head1 DESCRIPTION of SmfEvent |
|
5770
|
|
|
|
|
|
|
|
|
5771
|
|
|
|
|
|
|
MIDI::XML::SmfEvent is used for representing SmfEvent objects |
|
5772
|
|
|
|
|
|
|
|
|
5773
|
|
|
|
|
|
|
=cut |
|
5774
|
|
|
|
|
|
|
|
|
5775
|
|
|
|
|
|
|
#=============================================================================== |
|
5776
|
|
|
|
|
|
|
|
|
5777
|
|
|
|
|
|
|
{ |
|
5778
|
|
|
|
|
|
|
no strict "refs"; |
|
5779
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'smf-event'; }; |
|
5780
|
|
|
|
|
|
|
} |
|
5781
|
|
|
|
|
|
|
|
|
5782
|
|
|
|
|
|
|
#=============================================================================== |
|
5783
|
|
|
|
|
|
|
# MIDI::XML::SmfEvent::ChannelMessage |
|
5784
|
|
|
|
|
|
|
|
|
5785
|
|
|
|
|
|
|
=head2 $value = $Object->ChannelMessage([$new_value]); |
|
5786
|
|
|
|
|
|
|
|
|
5787
|
|
|
|
|
|
|
Set or get value of the ChannelMessage attribute. |
|
5788
|
|
|
|
|
|
|
|
|
5789
|
|
|
|
|
|
|
|
|
5790
|
|
|
|
|
|
|
Type: ChannelMessage |
|
5791
|
|
|
|
|
|
|
Lower: 1 |
|
5792
|
|
|
|
|
|
|
Upper: 1 |
|
5793
|
|
|
|
|
|
|
|
|
5794
|
|
|
|
|
|
|
=cut |
|
5795
|
|
|
|
|
|
|
|
|
5796
|
|
|
|
|
|
|
sub ChannelMessage() { |
|
5797
|
|
|
|
|
|
|
my $self = shift; |
|
5798
|
|
|
|
|
|
|
if (@_) { |
|
5799
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5800
|
|
|
|
|
|
|
if ('MIDI::XML::ChannelMessage' =~ /$regexp/ ) { |
|
5801
|
|
|
|
|
|
|
$self->attribute_as_element('ChannelMessage', shift); |
|
5802
|
|
|
|
|
|
|
} else { |
|
5803
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::ChannelMessage\' for attribute \'ChannelMessage\''; |
|
5804
|
|
|
|
|
|
|
} |
|
5805
|
|
|
|
|
|
|
} |
|
5806
|
|
|
|
|
|
|
return $self->attribute_as_element('ChannelMessage'); |
|
5807
|
|
|
|
|
|
|
} |
|
5808
|
|
|
|
|
|
|
|
|
5809
|
|
|
|
|
|
|
#=============================================================================== |
|
5810
|
|
|
|
|
|
|
# MIDI::XML::SmfEvent::MetaEvent |
|
5811
|
|
|
|
|
|
|
|
|
5812
|
|
|
|
|
|
|
=head2 $value = $Object->MetaEvent([$new_value]); |
|
5813
|
|
|
|
|
|
|
|
|
5814
|
|
|
|
|
|
|
Set or get value of the MetaEvent attribute. |
|
5815
|
|
|
|
|
|
|
|
|
5816
|
|
|
|
|
|
|
|
|
5817
|
|
|
|
|
|
|
Type: MetaEvent |
|
5818
|
|
|
|
|
|
|
Lower: 1 |
|
5819
|
|
|
|
|
|
|
Upper: 1 |
|
5820
|
|
|
|
|
|
|
|
|
5821
|
|
|
|
|
|
|
=cut |
|
5822
|
|
|
|
|
|
|
|
|
5823
|
|
|
|
|
|
|
sub MetaEvent() { |
|
5824
|
|
|
|
|
|
|
my $self = shift; |
|
5825
|
|
|
|
|
|
|
if (@_) { |
|
5826
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5827
|
|
|
|
|
|
|
if ('MIDI::XML::MetaEvent' =~ /$regexp/ ) { |
|
5828
|
|
|
|
|
|
|
$self->attribute_as_element('MetaEvent', shift); |
|
5829
|
|
|
|
|
|
|
} else { |
|
5830
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::MetaEvent\' for attribute \'MetaEvent\''; |
|
5831
|
|
|
|
|
|
|
} |
|
5832
|
|
|
|
|
|
|
} |
|
5833
|
|
|
|
|
|
|
return $self->attribute_as_element('MetaEvent'); |
|
5834
|
|
|
|
|
|
|
} |
|
5835
|
|
|
|
|
|
|
|
|
5836
|
|
|
|
|
|
|
#=============================================================================== |
|
5837
|
|
|
|
|
|
|
# MIDI::XML::SmfEvent::SysExEvent |
|
5838
|
|
|
|
|
|
|
|
|
5839
|
|
|
|
|
|
|
=head2 $value = $Object->SysExEvent([$new_value]); |
|
5840
|
|
|
|
|
|
|
|
|
5841
|
|
|
|
|
|
|
Set or get value of the SysExEvent attribute. |
|
5842
|
|
|
|
|
|
|
|
|
5843
|
|
|
|
|
|
|
|
|
5844
|
|
|
|
|
|
|
Type: SysExEvent |
|
5845
|
|
|
|
|
|
|
Lower: 1 |
|
5846
|
|
|
|
|
|
|
Upper: 1 |
|
5847
|
|
|
|
|
|
|
|
|
5848
|
|
|
|
|
|
|
=cut |
|
5849
|
|
|
|
|
|
|
|
|
5850
|
|
|
|
|
|
|
sub SysExEvent() { |
|
5851
|
|
|
|
|
|
|
my $self = shift; |
|
5852
|
|
|
|
|
|
|
if (@_) { |
|
5853
|
|
|
|
|
|
|
my $regexp = join('|',Class::ISA::self_and_super_path(ref($_[0]))); |
|
5854
|
|
|
|
|
|
|
if ('MIDI::XML::SysExEvent' =~ /$regexp/ ) { |
|
5855
|
|
|
|
|
|
|
$self->attribute_as_element('SysExEvent', shift); |
|
5856
|
|
|
|
|
|
|
} else { |
|
5857
|
|
|
|
|
|
|
carp 'Found type \'' . ref($_[0]) . '\', expecting type \'MIDI::XML::SysExEvent\' for attribute \'SysExEvent\''; |
|
5858
|
|
|
|
|
|
|
} |
|
5859
|
|
|
|
|
|
|
} |
|
5860
|
|
|
|
|
|
|
return $self->attribute_as_element('SysExEvent'); |
|
5861
|
|
|
|
|
|
|
} |
|
5862
|
|
|
|
|
|
|
|
|
5863
|
|
|
|
|
|
|
##END_PACKAGE SmfEvent |
|
5864
|
|
|
|
|
|
|
|
|
5865
|
|
|
|
|
|
|
#=============================================================================== |
|
5866
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5867
|
|
|
|
|
|
|
# UML Model UUID: f380a2f7-45af-11dd-8bf4-00502c05c241 |
|
5868
|
|
|
|
|
|
|
|
|
5869
|
|
|
|
|
|
|
package MIDI::XML::SysExEvent; |
|
5870
|
|
|
|
|
|
|
|
|
5871
|
|
|
|
|
|
|
use Carp; |
|
5872
|
|
|
|
|
|
|
|
|
5873
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::SmfEvent); |
|
5874
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5875
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5876
|
|
|
|
|
|
|
|
|
5877
|
|
|
|
|
|
|
=head1 DESCRIPTION of SysExEvent |
|
5878
|
|
|
|
|
|
|
|
|
5879
|
|
|
|
|
|
|
MIDI::XML::SysExEvent is used for representing SysExEvent objects |
|
5880
|
|
|
|
|
|
|
|
|
5881
|
|
|
|
|
|
|
=cut |
|
5882
|
|
|
|
|
|
|
|
|
5883
|
|
|
|
|
|
|
#=============================================================================== |
|
5884
|
|
|
|
|
|
|
|
|
5885
|
|
|
|
|
|
|
{ |
|
5886
|
|
|
|
|
|
|
no strict "refs"; |
|
5887
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'sys-ex-event'; }; |
|
5888
|
|
|
|
|
|
|
} |
|
5889
|
|
|
|
|
|
|
|
|
5890
|
|
|
|
|
|
|
##END_PACKAGE SysExEvent |
|
5891
|
|
|
|
|
|
|
|
|
5892
|
|
|
|
|
|
|
#=============================================================================== |
|
5893
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5894
|
|
|
|
|
|
|
# UML Model UUID: 5e9693b9-45b0-11dd-8bf4-00502c05c241 |
|
5895
|
|
|
|
|
|
|
|
|
5896
|
|
|
|
|
|
|
package MIDI::XML::SystemExclusive; |
|
5897
|
|
|
|
|
|
|
|
|
5898
|
|
|
|
|
|
|
use Carp; |
|
5899
|
|
|
|
|
|
|
|
|
5900
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::SysExEvent); |
|
5901
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5902
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5903
|
|
|
|
|
|
|
|
|
5904
|
|
|
|
|
|
|
=head1 DESCRIPTION of SystemExclusive |
|
5905
|
|
|
|
|
|
|
|
|
5906
|
|
|
|
|
|
|
MIDI::XML::SystemExclusive is used for representing SystemExclusive objects |
|
5907
|
|
|
|
|
|
|
|
|
5908
|
|
|
|
|
|
|
=cut |
|
5909
|
|
|
|
|
|
|
|
|
5910
|
|
|
|
|
|
|
#=============================================================================== |
|
5911
|
|
|
|
|
|
|
|
|
5912
|
|
|
|
|
|
|
{ |
|
5913
|
|
|
|
|
|
|
no strict "refs"; |
|
5914
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'SystemExclusive'; }; |
|
5915
|
|
|
|
|
|
|
} |
|
5916
|
|
|
|
|
|
|
|
|
5917
|
|
|
|
|
|
|
##END_PACKAGE SystemExclusive |
|
5918
|
|
|
|
|
|
|
|
|
5919
|
|
|
|
|
|
|
#=============================================================================== |
|
5920
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5921
|
|
|
|
|
|
|
# UML Model UUID: 86b3e50c-45b0-11dd-8bf4-00502c05c241 |
|
5922
|
|
|
|
|
|
|
|
|
5923
|
|
|
|
|
|
|
package MIDI::XML::EndOfExclusive; |
|
5924
|
|
|
|
|
|
|
|
|
5925
|
|
|
|
|
|
|
use Carp; |
|
5926
|
|
|
|
|
|
|
|
|
5927
|
|
|
|
|
|
|
our @ISA = qw(MIDI::XML::Element MIDI::XML::SysExEvent); |
|
5928
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5929
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5930
|
|
|
|
|
|
|
|
|
5931
|
|
|
|
|
|
|
=head1 DESCRIPTION of EndOfExclusive |
|
5932
|
|
|
|
|
|
|
|
|
5933
|
|
|
|
|
|
|
MIDI::XML::EndOfExclusive is used for representing EndOfExclusive objects |
|
5934
|
|
|
|
|
|
|
|
|
5935
|
|
|
|
|
|
|
=cut |
|
5936
|
|
|
|
|
|
|
|
|
5937
|
|
|
|
|
|
|
#=============================================================================== |
|
5938
|
|
|
|
|
|
|
|
|
5939
|
|
|
|
|
|
|
{ |
|
5940
|
|
|
|
|
|
|
no strict "refs"; |
|
5941
|
|
|
|
|
|
|
*TAG_NAME = sub { return 'EndOfExclusive'; }; |
|
5942
|
|
|
|
|
|
|
} |
|
5943
|
|
|
|
|
|
|
|
|
5944
|
|
|
|
|
|
|
##END_PACKAGE EndOfExclusive |
|
5945
|
|
|
|
|
|
|
|
|
5946
|
|
|
|
|
|
|
#=============================================================================== |
|
5947
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5948
|
|
|
|
|
|
|
# UML Model UUID: 4f1e4c48-45ac-11dd-8bf4-00502c05c241 |
|
5949
|
|
|
|
|
|
|
|
|
5950
|
|
|
|
|
|
|
package MIDI::XML::timestamp_type; |
|
5951
|
|
|
|
|
|
|
|
|
5952
|
|
|
|
|
|
|
our @ISA = qw(); |
|
5953
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
5954
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
5955
|
|
|
|
|
|
|
|
|
5956
|
|
|
|
|
|
|
=head1 DESCRIPTION of timestamp_type enumeration |
|
5957
|
|
|
|
|
|
|
|
|
5958
|
|
|
|
|
|
|
MIDI::XML::timestamp_type - Module representing the timestamp_type enumeration. |
|
5959
|
|
|
|
|
|
|
|
|
5960
|
|
|
|
|
|
|
=head1 CONSTANTS for the timestamp_type enumeration |
|
5961
|
|
|
|
|
|
|
|
|
5962
|
|
|
|
|
|
|
Absolute => 'Absolute' |
|
5963
|
|
|
|
|
|
|
Delta => 'Delta' |
|
5964
|
|
|
|
|
|
|
|
|
5965
|
|
|
|
|
|
|
=cut |
|
5966
|
|
|
|
|
|
|
|
|
5967
|
|
|
|
|
|
|
#=============================================================================== |
|
5968
|
|
|
|
|
|
|
*Absolute = sub { return 'Absolute'; }; |
|
5969
|
|
|
|
|
|
|
*Delta = sub { return 'Delta'; }; |
|
5970
|
|
|
|
|
|
|
|
|
5971
|
|
|
|
|
|
|
my @_literal_list_timestamp_type = ( |
|
5972
|
|
|
|
|
|
|
'Absolute' => 'Absolute', |
|
5973
|
|
|
|
|
|
|
'Delta' => 'Delta', |
|
5974
|
|
|
|
|
|
|
); |
|
5975
|
|
|
|
|
|
|
|
|
5976
|
|
|
|
|
|
|
#=============================================================================== |
|
5977
|
|
|
|
|
|
|
# MIDI::XML::timestamp_type::Literals |
|
5978
|
|
|
|
|
|
|
|
|
5979
|
|
|
|
|
|
|
=head1 METHODS for the timestamp_type enumeration |
|
5980
|
|
|
|
|
|
|
|
|
5981
|
|
|
|
|
|
|
=head2 @Literals = MIDI::XML::timestamp_type::Literals |
|
5982
|
|
|
|
|
|
|
|
|
5983
|
|
|
|
|
|
|
Returns an array of literal name-value pairs. |
|
5984
|
|
|
|
|
|
|
|
|
5985
|
|
|
|
|
|
|
=head2 %Literals = MIDI::XML::timestamp_type::Literals |
|
5986
|
|
|
|
|
|
|
|
|
5987
|
|
|
|
|
|
|
Returns a hash of literal name-value pairs. |
|
5988
|
|
|
|
|
|
|
|
|
5989
|
|
|
|
|
|
|
=cut |
|
5990
|
|
|
|
|
|
|
|
|
5991
|
|
|
|
|
|
|
sub Literals() { |
|
5992
|
|
|
|
|
|
|
my $self = shift; |
|
5993
|
|
|
|
|
|
|
return @_literal_list_timestamp_type; |
|
5994
|
|
|
|
|
|
|
} |
|
5995
|
|
|
|
|
|
|
|
|
5996
|
|
|
|
|
|
|
#=============================================================================== |
|
5997
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
5998
|
|
|
|
|
|
|
# UML Model UUID: 828bc502-4657-11dd-8bf4-00502c05c241 |
|
5999
|
|
|
|
|
|
|
|
|
6000
|
|
|
|
|
|
|
package MIDI::XML::control_change_enum; |
|
6001
|
|
|
|
|
|
|
|
|
6002
|
|
|
|
|
|
|
our @ISA = qw(); |
|
6003
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
6004
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
6005
|
|
|
|
|
|
|
|
|
6006
|
|
|
|
|
|
|
=head1 DESCRIPTION of control_change_enum enumeration |
|
6007
|
|
|
|
|
|
|
|
|
6008
|
|
|
|
|
|
|
MIDI::XML::control_change_enum - Module representing the control_change_enum enumeration. |
|
6009
|
|
|
|
|
|
|
|
|
6010
|
|
|
|
|
|
|
=head1 CONSTANTS for the control_change_enum enumeration |
|
6011
|
|
|
|
|
|
|
|
|
6012
|
|
|
|
|
|
|
BankSelectMSB => 0 |
|
6013
|
|
|
|
|
|
|
ModulationWheelMSB => 1 |
|
6014
|
|
|
|
|
|
|
BreathControllerMSB => 2 |
|
6015
|
|
|
|
|
|
|
FootControllerMSB => 4 |
|
6016
|
|
|
|
|
|
|
PortamentoTimeMSB => 5 |
|
6017
|
|
|
|
|
|
|
DataEntryMSB => 6 |
|
6018
|
|
|
|
|
|
|
ChannelVolumeMSB => 7 |
|
6019
|
|
|
|
|
|
|
BalanceMSB => 8 |
|
6020
|
|
|
|
|
|
|
PanMSB => 10 |
|
6021
|
|
|
|
|
|
|
ExpressionControllerMSB => 11 |
|
6022
|
|
|
|
|
|
|
EffectControl1MSB => 12 |
|
6023
|
|
|
|
|
|
|
EffectControl2MSB => 13 |
|
6024
|
|
|
|
|
|
|
GeneralPurposeController1MSB => 16 |
|
6025
|
|
|
|
|
|
|
GeneralPurposeController2MSB => 17 |
|
6026
|
|
|
|
|
|
|
GeneralPurposeController3MSB => 18 |
|
6027
|
|
|
|
|
|
|
GeneralPurposeController4MSB => 19 |
|
6028
|
|
|
|
|
|
|
BankSelectLSB => 32 |
|
6029
|
|
|
|
|
|
|
ModulationWheelLSB => 33 |
|
6030
|
|
|
|
|
|
|
BreathControllerLSB => 34 |
|
6031
|
|
|
|
|
|
|
FootControllerLSB => 36 |
|
6032
|
|
|
|
|
|
|
PortamentoTimeLSB => 37 |
|
6033
|
|
|
|
|
|
|
DataEntryLSB => 38 |
|
6034
|
|
|
|
|
|
|
ChannelVolumeLSB => 39 |
|
6035
|
|
|
|
|
|
|
BalanceLSB => 40 |
|
6036
|
|
|
|
|
|
|
PanLSB => 42 |
|
6037
|
|
|
|
|
|
|
ExpressionControllerLSB => 43 |
|
6038
|
|
|
|
|
|
|
EffectControl1LSB => 44 |
|
6039
|
|
|
|
|
|
|
EffectControl2LSB => 45 |
|
6040
|
|
|
|
|
|
|
GeneralPurposeController1LSB => 48 |
|
6041
|
|
|
|
|
|
|
GeneralPurposeController2LSB => 49 |
|
6042
|
|
|
|
|
|
|
GeneralPurposeController3LSB => 50 |
|
6043
|
|
|
|
|
|
|
GeneralPurposeController4LSB => 51 |
|
6044
|
|
|
|
|
|
|
DamperPedal => 64 |
|
6045
|
|
|
|
|
|
|
Portamento => 65 |
|
6046
|
|
|
|
|
|
|
Sostenuto => 66 |
|
6047
|
|
|
|
|
|
|
SoftPedal => 67 |
|
6048
|
|
|
|
|
|
|
LegatoFootswitch => 68 |
|
6049
|
|
|
|
|
|
|
Hold2 => 69 |
|
6050
|
|
|
|
|
|
|
SoundVariation => 70 |
|
6051
|
|
|
|
|
|
|
Timbre => 71 |
|
6052
|
|
|
|
|
|
|
ReleaseTime => 72 |
|
6053
|
|
|
|
|
|
|
AttackTime => 73 |
|
6054
|
|
|
|
|
|
|
Brightness => 74 |
|
6055
|
|
|
|
|
|
|
DecayTime => 75 |
|
6056
|
|
|
|
|
|
|
VibratoRate => 76 |
|
6057
|
|
|
|
|
|
|
VibratoDepth => 77 |
|
6058
|
|
|
|
|
|
|
VibratoDelay => 78 |
|
6059
|
|
|
|
|
|
|
SoundController10 => 79 |
|
6060
|
|
|
|
|
|
|
GeneralPurposeController5 => 80 |
|
6061
|
|
|
|
|
|
|
GeneralPurposeController6 => 81 |
|
6062
|
|
|
|
|
|
|
GeneralPurposeController7 => 87 |
|
6063
|
|
|
|
|
|
|
GeneralPurposeController8 => 83 |
|
6064
|
|
|
|
|
|
|
PortamentoControl => 84 |
|
6065
|
|
|
|
|
|
|
ReverbSendLevel => 91 |
|
6066
|
|
|
|
|
|
|
TremoloDepth => 92 |
|
6067
|
|
|
|
|
|
|
ChorusSendLevel => 93 |
|
6068
|
|
|
|
|
|
|
Effects4Depth => 94 |
|
6069
|
|
|
|
|
|
|
Effects5Depth => 95 |
|
6070
|
|
|
|
|
|
|
DataIncrement => 96 |
|
6071
|
|
|
|
|
|
|
DataDecrement => 97 |
|
6072
|
|
|
|
|
|
|
NonRegisteredParameterNumberLSB => 98 |
|
6073
|
|
|
|
|
|
|
NonRegisteredParameterNumberMSB => 99 |
|
6074
|
|
|
|
|
|
|
RegisteredParameterNumberLSB => 100 |
|
6075
|
|
|
|
|
|
|
RegisteredParameterNumberMSB => 101 |
|
6076
|
|
|
|
|
|
|
|
|
6077
|
|
|
|
|
|
|
=cut |
|
6078
|
|
|
|
|
|
|
|
|
6079
|
|
|
|
|
|
|
#=============================================================================== |
|
6080
|
|
|
|
|
|
|
*BankSelectMSB = sub { return 0; }; |
|
6081
|
|
|
|
|
|
|
*ModulationWheelMSB = sub { return 1; }; |
|
6082
|
|
|
|
|
|
|
*BreathControllerMSB = sub { return 2; }; |
|
6083
|
|
|
|
|
|
|
*FootControllerMSB = sub { return 4; }; |
|
6084
|
|
|
|
|
|
|
*PortamentoTimeMSB = sub { return 5; }; |
|
6085
|
|
|
|
|
|
|
*DataEntryMSB = sub { return 6; }; |
|
6086
|
|
|
|
|
|
|
*ChannelVolumeMSB = sub { return 7; }; |
|
6087
|
|
|
|
|
|
|
*BalanceMSB = sub { return 8; }; |
|
6088
|
|
|
|
|
|
|
*PanMSB = sub { return 10; }; |
|
6089
|
|
|
|
|
|
|
*ExpressionControllerMSB = sub { return 11; }; |
|
6090
|
|
|
|
|
|
|
*EffectControl1MSB = sub { return 12; }; |
|
6091
|
|
|
|
|
|
|
*EffectControl2MSB = sub { return 13; }; |
|
6092
|
|
|
|
|
|
|
*GeneralPurposeController1MSB = sub { return 16; }; |
|
6093
|
|
|
|
|
|
|
*GeneralPurposeController2MSB = sub { return 17; }; |
|
6094
|
|
|
|
|
|
|
*GeneralPurposeController3MSB = sub { return 18; }; |
|
6095
|
|
|
|
|
|
|
*GeneralPurposeController4MSB = sub { return 19; }; |
|
6096
|
|
|
|
|
|
|
*BankSelectLSB = sub { return 32; }; |
|
6097
|
|
|
|
|
|
|
*ModulationWheelLSB = sub { return 33; }; |
|
6098
|
|
|
|
|
|
|
*BreathControllerLSB = sub { return 34; }; |
|
6099
|
|
|
|
|
|
|
*FootControllerLSB = sub { return 36; }; |
|
6100
|
|
|
|
|
|
|
*PortamentoTimeLSB = sub { return 37; }; |
|
6101
|
|
|
|
|
|
|
*DataEntryLSB = sub { return 38; }; |
|
6102
|
|
|
|
|
|
|
*ChannelVolumeLSB = sub { return 39; }; |
|
6103
|
|
|
|
|
|
|
*BalanceLSB = sub { return 40; }; |
|
6104
|
|
|
|
|
|
|
*PanLSB = sub { return 42; }; |
|
6105
|
|
|
|
|
|
|
*ExpressionControllerLSB = sub { return 43; }; |
|
6106
|
|
|
|
|
|
|
*EffectControl1LSB = sub { return 44; }; |
|
6107
|
|
|
|
|
|
|
*EffectControl2LSB = sub { return 45; }; |
|
6108
|
|
|
|
|
|
|
*GeneralPurposeController1LSB = sub { return 48; }; |
|
6109
|
|
|
|
|
|
|
*GeneralPurposeController2LSB = sub { return 49; }; |
|
6110
|
|
|
|
|
|
|
*GeneralPurposeController3LSB = sub { return 50; }; |
|
6111
|
|
|
|
|
|
|
*GeneralPurposeController4LSB = sub { return 51; }; |
|
6112
|
|
|
|
|
|
|
*DamperPedal = sub { return 64; }; |
|
6113
|
|
|
|
|
|
|
*Portamento = sub { return 65; }; |
|
6114
|
|
|
|
|
|
|
*Sostenuto = sub { return 66; }; |
|
6115
|
|
|
|
|
|
|
*SoftPedal = sub { return 67; }; |
|
6116
|
|
|
|
|
|
|
*LegatoFootswitch = sub { return 68; }; |
|
6117
|
|
|
|
|
|
|
*Hold2 = sub { return 69; }; |
|
6118
|
|
|
|
|
|
|
*SoundVariation = sub { return 70; }; |
|
6119
|
|
|
|
|
|
|
*Timbre = sub { return 71; }; |
|
6120
|
|
|
|
|
|
|
*ReleaseTime = sub { return 72; }; |
|
6121
|
|
|
|
|
|
|
*AttackTime = sub { return 73; }; |
|
6122
|
|
|
|
|
|
|
*Brightness = sub { return 74; }; |
|
6123
|
|
|
|
|
|
|
*DecayTime = sub { return 75; }; |
|
6124
|
|
|
|
|
|
|
*VibratoRate = sub { return 76; }; |
|
6125
|
|
|
|
|
|
|
*VibratoDepth = sub { return 77; }; |
|
6126
|
|
|
|
|
|
|
*VibratoDelay = sub { return 78; }; |
|
6127
|
|
|
|
|
|
|
*SoundController10 = sub { return 79; }; |
|
6128
|
|
|
|
|
|
|
*GeneralPurposeController5 = sub { return 80; }; |
|
6129
|
|
|
|
|
|
|
*GeneralPurposeController6 = sub { return 81; }; |
|
6130
|
|
|
|
|
|
|
*GeneralPurposeController7 = sub { return 87; }; |
|
6131
|
|
|
|
|
|
|
*GeneralPurposeController8 = sub { return 83; }; |
|
6132
|
|
|
|
|
|
|
*PortamentoControl = sub { return 84; }; |
|
6133
|
|
|
|
|
|
|
*ReverbSendLevel = sub { return 91; }; |
|
6134
|
|
|
|
|
|
|
*TremoloDepth = sub { return 92; }; |
|
6135
|
|
|
|
|
|
|
*ChorusSendLevel = sub { return 93; }; |
|
6136
|
|
|
|
|
|
|
*Effects4Depth = sub { return 94; }; |
|
6137
|
|
|
|
|
|
|
*Effects5Depth = sub { return 95; }; |
|
6138
|
|
|
|
|
|
|
*DataIncrement = sub { return 96; }; |
|
6139
|
|
|
|
|
|
|
*DataDecrement = sub { return 97; }; |
|
6140
|
|
|
|
|
|
|
*NonRegisteredParameterNumberLSB = sub { return 98; }; |
|
6141
|
|
|
|
|
|
|
*NonRegisteredParameterNumberMSB = sub { return 99; }; |
|
6142
|
|
|
|
|
|
|
*RegisteredParameterNumberLSB = sub { return 100; }; |
|
6143
|
|
|
|
|
|
|
*RegisteredParameterNumberMSB = sub { return 101; }; |
|
6144
|
|
|
|
|
|
|
|
|
6145
|
|
|
|
|
|
|
my @_literal_list_control_change_enum = ( |
|
6146
|
|
|
|
|
|
|
'BankSelectMSB' => 0, |
|
6147
|
|
|
|
|
|
|
'ModulationWheelMSB' => 1, |
|
6148
|
|
|
|
|
|
|
'BreathControllerMSB' => 2, |
|
6149
|
|
|
|
|
|
|
'FootControllerMSB' => 4, |
|
6150
|
|
|
|
|
|
|
'PortamentoTimeMSB' => 5, |
|
6151
|
|
|
|
|
|
|
'DataEntryMSB' => 6, |
|
6152
|
|
|
|
|
|
|
'ChannelVolumeMSB' => 7, |
|
6153
|
|
|
|
|
|
|
'BalanceMSB' => 8, |
|
6154
|
|
|
|
|
|
|
'PanMSB' => 10, |
|
6155
|
|
|
|
|
|
|
'ExpressionControllerMSB' => 11, |
|
6156
|
|
|
|
|
|
|
'EffectControl1MSB' => 12, |
|
6157
|
|
|
|
|
|
|
'EffectControl2MSB' => 13, |
|
6158
|
|
|
|
|
|
|
'GeneralPurposeController1MSB' => 16, |
|
6159
|
|
|
|
|
|
|
'GeneralPurposeController2MSB' => 17, |
|
6160
|
|
|
|
|
|
|
'GeneralPurposeController3MSB' => 18, |
|
6161
|
|
|
|
|
|
|
'GeneralPurposeController4MSB' => 19, |
|
6162
|
|
|
|
|
|
|
'BankSelectLSB' => 32, |
|
6163
|
|
|
|
|
|
|
'ModulationWheelLSB' => 33, |
|
6164
|
|
|
|
|
|
|
'BreathControllerLSB' => 34, |
|
6165
|
|
|
|
|
|
|
'FootControllerLSB' => 36, |
|
6166
|
|
|
|
|
|
|
'PortamentoTimeLSB' => 37, |
|
6167
|
|
|
|
|
|
|
'DataEntryLSB' => 38, |
|
6168
|
|
|
|
|
|
|
'ChannelVolumeLSB' => 39, |
|
6169
|
|
|
|
|
|
|
'BalanceLSB' => 40, |
|
6170
|
|
|
|
|
|
|
'PanLSB' => 42, |
|
6171
|
|
|
|
|
|
|
'ExpressionControllerLSB' => 43, |
|
6172
|
|
|
|
|
|
|
'EffectControl1LSB' => 44, |
|
6173
|
|
|
|
|
|
|
'EffectControl2LSB' => 45, |
|
6174
|
|
|
|
|
|
|
'GeneralPurposeController1LSB' => 48, |
|
6175
|
|
|
|
|
|
|
'GeneralPurposeController2LSB' => 49, |
|
6176
|
|
|
|
|
|
|
'GeneralPurposeController3LSB' => 50, |
|
6177
|
|
|
|
|
|
|
'GeneralPurposeController4LSB' => 51, |
|
6178
|
|
|
|
|
|
|
'DamperPedal' => 64, |
|
6179
|
|
|
|
|
|
|
'Portamento' => 65, |
|
6180
|
|
|
|
|
|
|
'Sostenuto' => 66, |
|
6181
|
|
|
|
|
|
|
'SoftPedal' => 67, |
|
6182
|
|
|
|
|
|
|
'LegatoFootswitch' => 68, |
|
6183
|
|
|
|
|
|
|
'Hold2' => 69, |
|
6184
|
|
|
|
|
|
|
'SoundVariation' => 70, |
|
6185
|
|
|
|
|
|
|
'Timbre' => 71, |
|
6186
|
|
|
|
|
|
|
'ReleaseTime' => 72, |
|
6187
|
|
|
|
|
|
|
'AttackTime' => 73, |
|
6188
|
|
|
|
|
|
|
'Brightness' => 74, |
|
6189
|
|
|
|
|
|
|
'DecayTime' => 75, |
|
6190
|
|
|
|
|
|
|
'VibratoRate' => 76, |
|
6191
|
|
|
|
|
|
|
'VibratoDepth' => 77, |
|
6192
|
|
|
|
|
|
|
'VibratoDelay' => 78, |
|
6193
|
|
|
|
|
|
|
'SoundController10' => 79, |
|
6194
|
|
|
|
|
|
|
'GeneralPurposeController5' => 80, |
|
6195
|
|
|
|
|
|
|
'GeneralPurposeController6' => 81, |
|
6196
|
|
|
|
|
|
|
'GeneralPurposeController7' => 87, |
|
6197
|
|
|
|
|
|
|
'GeneralPurposeController8' => 83, |
|
6198
|
|
|
|
|
|
|
'PortamentoControl' => 84, |
|
6199
|
|
|
|
|
|
|
'ReverbSendLevel' => 91, |
|
6200
|
|
|
|
|
|
|
'TremoloDepth' => 92, |
|
6201
|
|
|
|
|
|
|
'ChorusSendLevel' => 93, |
|
6202
|
|
|
|
|
|
|
'Effects4Depth' => 94, |
|
6203
|
|
|
|
|
|
|
'Effects5Depth' => 95, |
|
6204
|
|
|
|
|
|
|
'DataIncrement' => 96, |
|
6205
|
|
|
|
|
|
|
'DataDecrement' => 97, |
|
6206
|
|
|
|
|
|
|
'NonRegisteredParameterNumberLSB' => 98, |
|
6207
|
|
|
|
|
|
|
'NonRegisteredParameterNumberMSB' => 99, |
|
6208
|
|
|
|
|
|
|
'RegisteredParameterNumberLSB' => 100, |
|
6209
|
|
|
|
|
|
|
'RegisteredParameterNumberMSB' => 101, |
|
6210
|
|
|
|
|
|
|
); |
|
6211
|
|
|
|
|
|
|
|
|
6212
|
|
|
|
|
|
|
#=============================================================================== |
|
6213
|
|
|
|
|
|
|
# MIDI::XML::control_change_enum::Literals |
|
6214
|
|
|
|
|
|
|
|
|
6215
|
|
|
|
|
|
|
=head1 METHODS for the control_change_enum enumeration |
|
6216
|
|
|
|
|
|
|
|
|
6217
|
|
|
|
|
|
|
=head2 @Literals = MIDI::XML::control_change_enum::Literals |
|
6218
|
|
|
|
|
|
|
|
|
6219
|
|
|
|
|
|
|
Returns an array of literal name-value pairs. |
|
6220
|
|
|
|
|
|
|
|
|
6221
|
|
|
|
|
|
|
=head2 %Literals = MIDI::XML::control_change_enum::Literals |
|
6222
|
|
|
|
|
|
|
|
|
6223
|
|
|
|
|
|
|
Returns a hash of literal name-value pairs. |
|
6224
|
|
|
|
|
|
|
|
|
6225
|
|
|
|
|
|
|
=cut |
|
6226
|
|
|
|
|
|
|
|
|
6227
|
|
|
|
|
|
|
sub Literals() { |
|
6228
|
|
|
|
|
|
|
my $self = shift; |
|
6229
|
|
|
|
|
|
|
return @_literal_list_control_change_enum; |
|
6230
|
|
|
|
|
|
|
} |
|
6231
|
|
|
|
|
|
|
|
|
6232
|
|
|
|
|
|
|
#=============================================================================== |
|
6233
|
|
|
|
|
|
|
# Generated by Hymnos Perl Code Generator |
|
6234
|
|
|
|
|
|
|
# UML Model UUID: c396dec6-46f1-11dd-8bf4-00502c05c241 |
|
6235
|
|
|
|
|
|
|
|
|
6236
|
|
|
|
|
|
|
package MIDI::XML::mtc_category; |
|
6237
|
|
|
|
|
|
|
|
|
6238
|
|
|
|
|
|
|
our @ISA = qw(); |
|
6239
|
|
|
|
|
|
|
our @EXPORT = qw(); |
|
6240
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
6241
|
|
|
|
|
|
|
|
|
6242
|
|
|
|
|
|
|
=head1 DESCRIPTION of mtc_category enumeration |
|
6243
|
|
|
|
|
|
|
|
|
6244
|
|
|
|
|
|
|
MIDI::XML::mtc_category - Module representing the mtc_category enumeration. |
|
6245
|
|
|
|
|
|
|
|
|
6246
|
|
|
|
|
|
|
=head1 CONSTANTS for the mtc_category enumeration |
|
6247
|
|
|
|
|
|
|
|
|
6248
|
|
|
|
|
|
|
FrameLSNibble => 0 |
|
6249
|
|
|
|
|
|
|
FrameMSNibble => 1 |
|
6250
|
|
|
|
|
|
|
SecsLSNibble => 2 |
|
6251
|
|
|
|
|
|
|
SecsMSNibble => 3 |
|
6252
|
|
|
|
|
|
|
MinsLSNibble => 4 |
|
6253
|
|
|
|
|
|
|
MinsMSNibble => 5 |
|
6254
|
|
|
|
|
|
|
HrsLSNibble => 6 |
|
6255
|
|
|
|
|
|
|
HrsMSNibbleSMPTEType => 7 |
|
6256
|
|
|
|
|
|
|
|
|
6257
|
|
|
|
|
|
|
=cut |
|
6258
|
|
|
|
|
|
|
|
|
6259
|
|
|
|
|
|
|
#=============================================================================== |
|
6260
|
|
|
|
|
|
|
*FrameLSNibble = sub { return 0; }; |
|
6261
|
|
|
|
|
|
|
*FrameMSNibble = sub { return 1; }; |
|
6262
|
|
|
|
|
|
|
*SecsLSNibble = sub { return 2; }; |
|
6263
|
|
|
|
|
|
|
*SecsMSNibble = sub { return 3; }; |
|
6264
|
|
|
|
|
|
|
*MinsLSNibble = sub { return 4; }; |
|
6265
|
|
|
|
|
|
|
*MinsMSNibble = sub { return 5; }; |
|
6266
|
|
|
|
|
|
|
*HrsLSNibble = sub { return 6; }; |
|
6267
|
|
|
|
|
|
|
*HrsMSNibbleSMPTEType = sub { return 7; }; |
|
6268
|
|
|
|
|
|
|
|
|
6269
|
|
|
|
|
|
|
my @_literal_list_mtc_category = ( |
|
6270
|
|
|
|
|
|
|
'FrameLSNibble' => 0, |
|
6271
|
|
|
|
|
|
|
'FrameMSNibble' => 1, |
|
6272
|
|
|
|
|
|
|
'SecsLSNibble' => 2, |
|
6273
|
|
|
|
|
|
|
'SecsMSNibble' => 3, |
|
6274
|
|
|
|
|
|
|
'MinsLSNibble' => 4, |
|
6275
|
|
|
|
|
|
|
'MinsMSNibble' => 5, |
|
6276
|
|
|
|
|
|
|
'HrsLSNibble' => 6, |
|
6277
|
|
|
|
|
|
|
'HrsMSNibbleSMPTEType' => 7, |
|
6278
|
|
|
|
|
|
|
); |
|
6279
|
|
|
|
|
|
|
|
|
6280
|
|
|
|
|
|
|
#=============================================================================== |
|
6281
|
|
|
|
|
|
|
# MIDI::XML::mtc_category::Literals |
|
6282
|
|
|
|
|
|
|
|
|
6283
|
|
|
|
|
|
|
=head1 METHODS for the mtc_category enumeration |
|
6284
|
|
|
|
|
|
|
|
|
6285
|
|
|
|
|
|
|
=head2 @Literals = MIDI::XML::mtc_category::Literals |
|
6286
|
|
|
|
|
|
|
|
|
6287
|
|
|
|
|
|
|
Returns an array of literal name-value pairs. |
|
6288
|
|
|
|
|
|
|
|
|
6289
|
|
|
|
|
|
|
=head2 %Literals = MIDI::XML::mtc_category::Literals |
|
6290
|
|
|
|
|
|
|
|
|
6291
|
|
|
|
|
|
|
Returns a hash of literal name-value pairs. |
|
6292
|
|
|
|
|
|
|
|
|
6293
|
|
|
|
|
|
|
=cut |
|
6294
|
|
|
|
|
|
|
|
|
6295
|
|
|
|
|
|
|
sub Literals() { |
|
6296
|
|
|
|
|
|
|
my $self = shift; |
|
6297
|
|
|
|
|
|
|
return @_literal_list_mtc_category; |
|
6298
|
|
|
|
|
|
|
} |
|
6299
|
|
|
|
|
|
|
|
|
6300
|
|
|
|
|
|
|
1 |
|
6301
|
|
|
|
|
|
|
|
|
6302
|
|
|
|
|
|
|
__END__ |