Re: Exceed file_size_limit .....?

[email protected] (Markus Kollmar) Tue, 01 Apr 2003 02:22:30 +0200
Newsgroups perl.midi
Message-ID <[email protected]>
"Sean M. Burke" wrote:
> 
> At 11:09 PM 2003-03-28 +0100, Markus Kollmar wrote:
> >0060 b0 20 00 00 c0 63 00 ff  2f 00 f8 f8 f8 f8 f8 f8
> >0070 f8 f8 f8 f8 f8 f8 f8 f8  f8 f8 f8 f8 f8 f8 f8 f8
> >[...]reading track #3 (of length 4177066232) would exceed file_size_limit at
> 
> That's not a legal file ending according to the MIDI filespec -- so when
> the code in MIDI::Opus sees that, it thinks "oh, this is a new chuck,
> and apparently it's of type "\xf8\xf8\xf8\xf8", and is of length
> 0xf8f8f8f8 (4,177,066,232), etc. And since that's an insane length, it
> aborts reading, with the error message you saw.
> 
> I've never seen a file like this before, but you can make MIDI/Opus.pm
> silently accept that kind of file-ending by finding this line:
> 
>   my($id, $length, $format, $tracks_expected, $ticks) = unpack('A4Nnnn', $in);
> 
> and adding this line after it:
> 
>   last if $id eq "\xf8\xf8\xf8\xf8";
> 
> I think that'd do it.
> 
> By the way, what kind of things do you use MIDI-Perl for?  Composing new files; or archiving lots of existing MIDIs; or mixing MIDI data?
> 
> --
> Sean M. Burke    http://search.cpan.org/~sburke/

Hi,

I deleted those "\xf8"'s (with an editor) and feeded midiparse.pl again with
such a critical
file. And it goes! Maybe this will be the cleaner way for us to solve this
problem, since the "\xf8"'s aren't
a valid midifile-ending (it saves disk-space, too), would'nt you agree?
(Perhaps you will not agree - but that would lead us in another problem, since i
was not able to fix
the problem with your given code-line. And as you know - i currently are not
skilled
with a adequate knowledge to check why it doesn't work (... or maybe i did
something wrong?).)

However, I recognized that those "\xf8"'s were generated from my
hardwaresequencer (Yamaha QY700). Maybe it
tries to fill the file size to an value of n*512-bytes (because of DOS/FAT?!).

----------------

To answer your attached question:

I'm playing keyboard - often in accompaniment to a midi-file. Until now I had to
change my keyboard-settings
(more than 100 - which sometimes are changing) by hand - depending of current
song.
So I decided to create a midi-file for each setting.
To do this with a regular sequencer (like my QY700) it probably would end in a
drably work... With midi-perl it will
end in a drably editor-session ;-)
(...but it isn't so bad, because I use emacs, which I think is a more
comfortable user-interface for THIS
work, than a sequencer!)

But i think there will appear other uses for me in future, too.

-----------------

Thank's for your great "crazy f8-file-ending" hint!!


Markus Kollmar