lilypond-user
[Top][All Lists]
Advanced

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

Re: lyrics entry help!!!-was hebrew lily


From: Aaron
Subject: Re: lyrics entry help!!!-was hebrew lily
Date: 02 Jul 2003 21:25:50 +0300

On Wed, 2003-07-02 at 20:22, Amelie Zapf wrote:
> Hi Aaron, all,
> The following script should do the job:
> 
> Cheers, Amy
Thanks
and wow but I am not sure if the lyrics files should just be the hebrew
text or should it be the complete lyrics section???

A question about the lyrics should I put measure lines in them or just a
string of syllables?? how does it know where to split syllables??
I entered them with spaces and --.
Thanks
Aaron
> 
> #!/usr/bin/perl
> ####################################################
> # revertlyrics.pl v0.1
> # Script to print right-to-left languages backwards
> # in Lilypond
> # (c) Amelie Zapf 2003
> # Licensed under the GNU GPL v2
> ####################################################
> 
> # Usage: revertlyrics.pl <lilypondfile>
> #  1. Name each lyric file <lilypondfile>.lyr.<number>
        ok-    mahyedid.lyr.29
> #  2. Insert "\include "<lilypondfile>.out.<number>";
mahyedid.lyr.29?? what is .out. ???
> #     at the appropriate positions in your lilypond file
> #  3. Run script
> 
> use warnings;
> use strict;
> 
> # which files to process
> my $file=$ARGV[0];
> $file=~s/\.ly//;
> my @files=glob("$file.lyr.*");
> 
> foreach (@files) {
>         # read
>         open FILE, $_;
>         my @content=<FILE>;
>         close FILE;
> 
>         # process
>         for (my $i=0; $i<scalar(@content); $i++) {
>                 # get rid of spurious blank space
>                 chomp $content[$i];
>                 $content[$i]=~s/\s+/ /g;
>                 #split into syllables
>                 my @line=split / /, $content[$i];
>                 for (my $j=0; $j<scalar(@line); $j++) {
>                         # get rid of lyric value
>                         my $time=$line[$j];
>                         $time=~s/^[^\d]+//;
>                         $line[$j]=~s/[\d]+\.+$//;
>                         # take care that trailing hyphens appear at the end
>                         if ($line[$j]=~/\-$/) {
>                                 $line[$j]=~s/\-$//;
>                                 $line[$j]="-$line[$j]";
>                         }
>                         # special treatment of centered hyphens and
>                         # syllable extenders, actual substitution
>                         if ($line[$j] ne "--" && $line[$j] ne "__") {
>                                 $line[$j]="\"\\\\R{$line[$j]}\"";
>                         }
>                         # get value back in
>                         $line[$j]="$line[$j]$time";
>                 }
>                 # fuse line from syllables
>                 $content[$i]=join " ", @line;
>         }
> 
>         # output
>         my $newfile=$_;
>         $newfile=~s/\.lyr\./.out./;
>         open FILE, ">$newfile";
>         for (my $i=0; $i<scalar(@content); $i++) {
>                 print FILE "$content[$i]\n";
>         }
>         close FILE;
> }
> 
> 
> 
> _______________________________________________
> Lilypond-user mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/lilypond-user





reply via email to

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