MIDI::Score

[email protected] (Dave Turner) Mon, 19 May 2003 22:01:48 +0000
Newsgroups perl.midi
Message-ID <a05100302baef02e42eed@[81.174.193.37]>
The event structure to score structure given in the MIDI::Score 
synopsis is exactly what I want to do. I don't have the perl 
expertise to actually do it!

this is what I have so far:-
#!perl
# mp-score this attempts to list the midi track as a score
# using MacPerl 5.6.1r2 for Mac OS 9.2.2
  use warnings;
  use MIDI;

  my $DRIVE = "Stuff:";
  my $PATH = "temptemp:";
  my $MIDI = 'westminster_chimes4.mid';
  my $IN_FILE;

  $IN_FILE = $DRIVE.$PATH.$MIDI;

  my $opus = MIDI::Opus->new({ 'from_file' => $IN_FILE });
print "$IN_FILE has ", scalar( $opus->tracks ), " tracks\n";

  my $event_r = \@opus;
print "my event_r = ", $event_r, "\n";

  my $score_r = MIDI::Score::events_r_to_score_r($event_r);
print "my score_r = ", $score_r, "\n";

  MIDI::Score::dump_score( $score_r);

  exit;

and the output I get is:-
# Name "main::opus" used only once: possible typo.
File 'User:Dave's Data:MacPerl Scripts:mp-score'; Line 16
Stuff:temptemp:westminster_chimes4.mid has 1 tracks
my event_r = ARRAY(0x89e6688)
my score_r = ARRAY(0x89d7014)
@notes = (   # 0 notes...
);

Obviously I managed to get MIDI::Simple and MIDI::Opus working!

Where am I going wrong?

I need midi::score so I can do a conversion of my midi guitar playing 
to csound. The midi2text and midi2cs.exe files I have tried don't do 
a good enough job, and the source code isn't available.

DaveT