If you want to extract just the text events from MIDI files (say, for archival purposes), get my simpler and quicker MIDI text dumper.
sub read_variable_length
could really use rewriting
to use new unpack
options for improved efficiency.
drmidi
, and chmod a+rx
'd it, and where you
are analyzing a file named chimes.mid
, for example:
drmidi chimes.mid
On a Mac (hence no command line), open the .pl file in MacPerl and save
it as a droplet. From then on you can drop MIDI files onto it. Note that
the output might be so long as to overflow the MacPerl's output window's
scrollback buffer.
My guess is that if you add this:
die "Can't divert STDOUT" unless open(STDOUT, ">stdout.txt");
as the second line of the perl script, it'll magically divert the output to
stdout.txt. Good luck.
dr_midi.pl
--
about 18 K.
This program is released under the GNU Public License:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
To see a copy of the GNU General Public License, see http://www.ling.nwu.edu/~sburke/gnu_release.html or write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.