use MIDI; use Data::Dumper; use strict; my $file = 'chimes.mid'; my $opus = MIDI::Opus->new({from_file=>$file}); # dump the contents of the events $opus->dump({flat=>1}); # example output (minus the header added by me) EVENT dtime channel note velocity ----------------------------------------------------------- text_event 0 (coded at Thu May 31 13:44:10 2001 ) patch_change 0 1 8 note_on 0 1 25 96 note_off 96 1 25 0 note_on 0 1 29 96 note_off 96 1 29 0 note_on 0 1 27 96 note_off 96 1 27 0 # print the notes as png file: 'experimental' according to docs # draw() returns a reference to a GD object my $im = $opus->draw; open(OUT, ">mid.png"); binmode(OUT); print OUT $im->png; close(OUT); # this produces an image like this +------------------------------------+ | | | ------------ | | ------------| |------------ | | | +------------------------------------+