MIDI-Perl - Re: MIDI::Simple and multiple channels

Posted on Sat May 12 14:58:29 2007 by cnoocy in response to 5114 (See the whole thread of 2)
Re: MIDI::Simple and multiple channels
To answer my own question, I used the steps I described above, but they were not as tedious as I feared they might be. Here is my code:
my $opus = MIDI::Opus->new(); my @tracks; foreach my $simple (@simples){ my $track = MIDI::Track->new(); my $events_r = MIDI::Score::score_r_to_events_r($simple->Score_r); $track->events_r($events_r); push (@tracks, $track); } $opus->tracks(@tracks); $opus->write_to_file($filename);
which is pretty straightforward.
Write a response