From 698fa0ae1e4c993041730e6d5d763764b0261d45 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:41:39 +0000 Subject: [PATCH] lilypond-0.0.55 --- Documentation/convert-mudela.pod | 7 +++ bin/convert-mudela | 86 +++++++++++++++++++++----------- input/cadenza.ly | 1 + input/collisions.ly | 1 + input/coriolan-alto.ly | 1 + input/error.ly | 2 +- input/kortjakje.ly | 2 +- input/maartje.ly | 2 +- input/scsii-menuetto.ly | 2 +- input/standchen.ly | 2 +- input/wohltemperirt.ly | 2 +- 11 files changed, 74 insertions(+), 34 deletions(-) diff --git a/Documentation/convert-mudela.pod b/Documentation/convert-mudela.pod index 34e5bc8fa9..956c16bc9e 100644 --- a/Documentation/convert-mudela.pod +++ b/Documentation/convert-mudela.pod @@ -40,3 +40,10 @@ available version. =back +=head1 BUGS + +Not all language changes are handled. Multiple output options won't work + +=head1 AUTHOR + +Han-Wen Nienhuys diff --git a/bin/convert-mudela b/bin/convert-mudela index 2ead27d9b9..e4a8af3013 100644 --- a/bin/convert-mudela +++ b/bin/convert-mudela @@ -2,6 +2,9 @@ use Getopt::Long; + + + sub version_string_conv { @@ -16,12 +19,17 @@ sub { } + sub conv_pl52_pl53 { s/include \"/$1\\include \"/g; } +sub conv_pl53_pl54 +{ + print STDERR "Not smart enough to convert \\transpose\n" if (/\\transpose/) ; +} ############################################################### @@ -29,8 +37,7 @@ sub conv_pl52_pl53 -sub - usage +sub usage { print STDERR "Usage: convert-mudela\n"; print STDERR "other options: --edit --output=FILE --show-rules\n"; @@ -39,7 +46,8 @@ sub my %minor_conversions = (50 => \&no_conv, 52 => \&conv_pl0_0_50_pl0_0_52, - 53 => \&conv_pl52_pl53 + 53 => \&conv_pl52_pl53, + 54 => \&conv_pl53_pl54 ); sub versions { @@ -47,15 +55,13 @@ sub versions } -sub - show_rules +sub show_rules { print "Rules: ", join(", ", sort keys %minor_conversions), "\n"; } -sub - do_conversion +sub do_conversion { my ($from,$to) = @_; @@ -83,7 +89,8 @@ sub print OUTLY; } } -sub set_auto_from + +sub get_auto_from { my ($fn)=@_; my ($ver); @@ -97,7 +104,11 @@ sub set_auto_from last; } } - die "can't determine mudela version." unless (defined($ver)); + if (!defined($ver)){ + print STDERR "can't determine mudela version in $fn.\n"; + my $u; + return $u; + } $ver =~ s/0\.0\.// ; close INLY; return $ver; @@ -114,7 +125,7 @@ sub set_files } if (( ! -f $infile) && (! $infile =~ /\\.ly$/s ) ){ $infile .= ".ly"; - print STDERR "trying $infile"; + } if ($opt_edit && $infile ne "-") { @@ -122,6 +133,36 @@ sub set_files $outfile = "$infile.NEW"; $infile = "$infile"; } + print STDERR "Input $infile.. "; + +} + +sub do_one_arg +{ + set_files; + + local ($from_version, $to_version); + $from_version = $opt_from; + $to_version = $opt_to; + + ($from_version = get_auto_from $infile) unless defined($opt_from); + return if (!defined($from_version)); + + my @v = versions; + ($to_version = pop @v) unless (defined($opt_to)); + + + die "can't open \`$infile\'" unless open INLY,$infile ; + die "can't open \`$outfile\'" unless open OUTLY, ">$outfile"; + + do_conversion $from_version, $to_version; + close INLY; + close OUTLY; + + if ($opt_edit) { + rename $infile, "$infile~"; + rename $outfile, "$infile"; + } } GetOptions ("output=s", "from=i", "to=i", "minor=i", "edit", "show-rules"); @@ -133,24 +174,13 @@ if ($opt_show_rules) { } local ( $infile,$outfile); -set_files; - - -($opt_from = set_auto_from $infile) unless defined($opt_from); - -my @v = versions; -($opt_to = pop @v) unless (defined($opt_to)); +my $processed_one=0; - -die "can't open \`$infile\'" unless open INLY,$infile ; -die "can't open \`$outfile\'" unless open OUTLY, ">$outfile"; - -do_conversion $opt_from, $opt_to; -close INLY; -close OUTLY; - -if ($opt_edit) { - rename $infile, "$infile~"; - rename $outfile, "$infile"; +while (defined($ARGV[0])) { + do_one_arg; + shift @ARGV; + $processed_one = 1; } +do_one_arg unless ($processed_one); + diff --git a/input/cadenza.ly b/input/cadenza.ly index c50d815ced..b8a31404d8 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -3,6 +3,7 @@ % % author: unknown. Copyright: none % +\version "0.0.54"; cad = \melodic { \cadenza 1; diff --git a/input/collisions.ly b/input/collisions.ly index 6cc9992383..333fd67e40 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -1,4 +1,5 @@ % test the Collision resolution +\version "0.0.54"; two_voice_steminvert = \melodic { < \multivoice diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index c2b8ed5da3..8e5d3b568e 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -10,6 +10,7 @@ % when lily can handle this, i-ll type the other 304 bars % (maybe even sooner :-) % +\version "0.0.54"; alto = \melodic{ diff --git a/input/error.ly b/input/error.ly index f5690f0c8a..9eeada0ea9 100644 --- a/input/error.ly +++ b/input/error.ly @@ -1,4 +1,4 @@ -\version "0.0.53"; +\version "0.0.54"; \include "this-is-hopefully-a-nonexisting-file" diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 167236c1e9..31af298810 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -8,7 +8,7 @@ % copyright: None % % declare melody (which will be in *one* staff ) for the lead voice -\version "0.0.53"; +\version "0.0.54"; melodie = \melodic { % switch Lilypond in note-mode diff --git a/input/maartje.ly b/input/maartje.ly index bebe65d14f..5bcf7c303c 100644 --- a/input/maartje.ly +++ b/input/maartje.ly @@ -3,7 +3,7 @@ % COPYRIGHT: GPL % % -\version "0.0.53"; +\version "0.0.54"; globals=\melodic{ \meter 4/ 4; diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index b42f912ff9..cc3f3636fb 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -11,7 +11,7 @@ % The purpose of this file is to demonstrate features of LilyPond. % (there is an accompanying LaTeX file, scsii-menuetto.tex) % -\version "0.0.53"; +\version "0.0.54"; %% Stuff from MPP version % \lefttitle{Menuetto} % \tempo{Moderato} diff --git a/input/standchen.ly b/input/standchen.ly index 49b0cf6059..e545dd011c 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -9,7 +9,7 @@ % The purpose of this file is to demonstrate features of LilyPond. % (there is an accompanying LaTeX file, standchen.tex) % -\version "0.0.53"; +\version "0.0.54"; melodie = \melodic{ \meter 3/4 ; diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 82659d3800..66c3ae015e 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -2,7 +2,7 @@ % % Public Domain -- typed by by HWN % -\version "0.0.53"; +\version "0.0.54"; global = \melodic{ \meter 4/4 ; -- 2.39.5