I can not figure how to convert an arpeggio into a chord...

[email protected] ((Nikolai Onken)) Thu, 27 Dec 2001 15:36:13 +0100
Newsgroups perl.midi
Message-ID <000001c18ee3$d7321ab0$c172fea9@development>
Hey,
 
first of all thanks Sean for your help! It solved my problem - I didn't
know that it would be that easy :)
Anyway - now I am trying to make a Perl script either generate an
arpeggio or a chord out of an array like that
@notes(52, 62, 68, 71) <- this would be E7.
I figured this code right now:
 
my @notes =( 52, 62, 68, 71);
my $arr_length = $#notes+1;
my $str_arpeggio = 1; ## 0=Arpeggio, 1=Chord
my $str_preset = 26;
new_score;
# Some MIDI meta-information:
copyright_text_event "2002 Chordinversion.com (c) by Nikolai Onken";
text_event "Title: Chordinversion";
 
for($i=0; $i<$arr_length; $i++) {
            patch_change $i, $str_preset;
}
 
if ($str_arpeggio == 1) {
            foreach (@notes) {
                        n qn, $_;           
            }
}
else {
...
And now I don't have any idea how to do that. On Sean's webpage I found
some examples with several voices but there the number was predefined as
far as I know.
I also could have a 5 note array or just two notes (then it wouldn't be
a chord ;))
Maybe someone can give me some ideas how I could solve this problem. I
also want to change the playing speed but I have to go deeper into Perl
- I really forgot a lot since I also use PHP :)
Take Care,
 
Nikolai