Posted on 2008-04-10 04:07:42-07 by clone45
score parameters not working - not arrays?!
Hello, I'm trying to use MIDI::Morph for the first time and I'm running in to some issues. The documentation suggests to do something like:
$m = MIDI::Morph->new(from => $score1, to => $score2);
However, when I use score objects as $score1 and $score2, I get an error. This is probably because the new() method of Morph expects the parameters to be arrays. I'm not sure what type of arrays to give it. Any advice? Here's my code:
#!/perl/bin use MIDI::Tab; use MIDI::Simple; use MIDI::Morph; $score1 = MIDI::Simple->new_score(); $score2 = MIDI::Simple->new_score(); my $drums = <<"EOF"; CYM: 8------------------------------- OHH: --6-------6-------6-------6----- HH: 66--6-6-66--6-6-66--6-6-66--6-6- SD: ----8-------8-------8-------8--- BD: 8-4---8-2-8-----8-4---8-2-8----- EOF my $drums2 = <<"EOF"; CYM: 8------------------------------- OHH: --66------66------6-6-----6----- HH: 66666-6-66666-6-66--6-6-66--6-6- SD: ----8---------------8-------888- BD: 88--------------8-4---8-2-8----- EOF from_drum_tab($score1, $drums, 'sn'); from_drum_tab($score2, $drums2, 'sn'); $m = MIDI::Morph->new(from => $score1, to => $score2); $new_score = $m->Morph(0.4);
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.