lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

combining SATB rests


From: James Moore
Subject: combining SATB rests
Date: Wed, 10 Nov 2004 14:54:48 -0800

I threw together this perl script to help with creating a part that has only
rests.  It's not pretty, but it does most of the work of turning notes into
skips and leaving rests.

It's meant to be an aid for a human cutting and pasting; it makes no attempt
to figure out which parts of the file are notes and which are not.  

I have it saved as rests.pl in the same directory as the lyrics, and I run
it like so:

perl rests.pl < ASong.ly

and then just cut and paste the bits I need.  Runs fine under cygwin,
assuming you've got perl installed.

Even better would be some Scheme code that does the same thing, but Scheme
isn't high on my list of things to learn.  (Best of all would be hearing
that there's a way to just tell Lilypond to combine rests in a staff.)

 - James

while (<>) {
    if (/%/) {
        print $_ . "\n";
    }
    else {
        $l = $_;
        my @notes = split ' ', $l;
        for my $n (@notes) {
            if ($n =~ /^\\/) {
            } else {
                $n =~ s/^(.)[ie]s/$1/;
                $n =~ s/^[a-g]/s/i;
                $n =~ s/[(),\']//;
                $n =~ s/\^.*//;
            }
            print $n . " ";
        }
        print "\n";
    }
        
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]