From 71a321bad8249c5f26592f85dbcbd5c78ff31e83 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:29:55 +0000 Subject: [PATCH] lilypond-0.0.25 --- Variables.make | 2 +- configure | 2 +- hdr/keyitem.hh | 3 +++ init/table_sixteen.ini | 8 +++++--- init/table_twenty.ini | 8 +++++--- input/kortjakje.ly | 4 ++-- input/twinkle.ly | 8 ++++---- lilyponddefs.tex | 2 ++ src/clef.cc | 4 ++++ src/clefitem.cc | 4 ++++ src/keyitem.cc | 14 ++++++++++++++ src/lexer.l | 13 +++++++++++++ src/mylexer.cc | 2 -- src/simplewalker.cc | 2 +- 14 files changed, 59 insertions(+), 17 deletions(-) diff --git a/Variables.make b/Variables.make index 8d7ce55b66..5026391222 100644 --- a/Variables.make +++ b/Variables.make @@ -37,7 +37,7 @@ endif # version info MAJVER=0 MINVER=0 -PATCHLEVEL=24 +PATCHLEVEL=25 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL) CXXVER=`$(CXX) --version` diff --git a/configure b/configure index 603a202fe6..1f7f7b5238 100755 --- a/configure +++ b/configure @@ -11,7 +11,7 @@ else cd ../ if [ ! -f $flowertar ] then - echo can't find $flowertar + echo "can't find $flowertar" exit 1; fi rm flower diff --git a/hdr/keyitem.hh b/hdr/keyitem.hh index 05a6cf79c2..dca7d72135 100644 --- a/hdr/keyitem.hh +++ b/hdr/keyitem.hh @@ -10,6 +10,8 @@ #include "item.hh" #include "varray.hh" +struct Clef; + /// struct Keyitem : Item { Array pitch; @@ -22,6 +24,7 @@ struct Keyitem : Item { Keyitem(int cposition); void add(int pitch, int acc); void read(Array k); + void read(const Clef& c); void preprocess(); diff --git a/init/table_sixteen.ini b/init/table_sixteen.ini index 77297efbfa..e87778753c 100644 --- a/init/table_sixteen.ini +++ b/init/table_sixteen.ini @@ -40,10 +40,12 @@ symboltables { "clefs" = table { "violin" "\violinclef" 0pt 12.8pt -10pt 18pt "bass" "\bassclef" 0pt 11.2pt 0pt 16pt - "viola" "\violaclef" 0pt 12.8pt 0pt 16pt + "alto" "\altoclef" 0pt 12.8pt 0pt 16pt + "tenor" "\altoclef" 0pt 12.8pt 0pt 16pt "violin_change" "\cviolinclef" 0pt 11.2pt -12pt 12pt "bass_change" "\cbassclef" 0pt 12.8pt 0pt 16pt - "viola_change" "\cviolaclef" 0pt 11.2pt 0pt 16pt + "alto_change" "\caltoclef" 0pt 11.2pt 0pt 16pt + "tenor_change" "\caltoclef" 0pt 11.2pt 0pt 16pt } "balls" = table { @@ -122,4 +124,4 @@ symboltables { } } -default_table = symboltables { table_sixteen } \ No newline at end of file +default_table = symboltables { table_sixteen } diff --git a/init/table_twenty.ini b/init/table_twenty.ini index 780e0b2e86..6e2b8836a3 100644 --- a/init/table_twenty.ini +++ b/init/table_twenty.ini @@ -25,10 +25,12 @@ table_twenty = symboltables { "clefs" = table { "violin" "\violinclef" 0pt 16pt -12.5pt 22.5pt "bass" "\bassclef" 0pt 16pt 0pt 20pt - "viola" "\violaclef" 0pt 16pt 0pt 20pt + "alto" "\altoclef" 0pt 16pt 0pt 20pt + "tenor" "\altoclef" 0pt 16pt 0pt 20pt "violin_change" "\cviolinclef" 0pt 16pt -12.5pt 22.5pt "bass_change" "\cbassclef" 0pt 16pt 0pt 20pt - "viola_change" "\cviolaclef" 0pt 16pt 0pt 20pt + "alto_change" "\caltoclef" 0pt 16pt 0pt 20pt + "tenor_change" "\caltoclef" 0pt 16pt 0pt 20pt } "balls" = table { @@ -103,4 +105,4 @@ table_twenty = symboltables { } } -default_table = symboltables { table_twenty } \ No newline at end of file +default_table = symboltables { table_twenty } diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 9b2054f83d..bfcfebaeb0 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -52,7 +52,7 @@ bstaf = staff { melodic music { begeleiding } % use the declared music commands { % commands with Staff-wide impact. - clef bass % bass-clef + clef "bass" % bass-clef } } @@ -60,7 +60,7 @@ bstaf = staff { vstaf = staff { melodic music { melodie } - commands { clef violin } + commands { clef "violin" } % default clef is violin clef } diff --git a/input/twinkle.ly b/input/twinkle.ly index 2cd786c3d6..f866678bc8 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -83,7 +83,7 @@ text2 = music { @ \textstyle "roman" When the bla- zing sun is gone,2 - When he no- thing shine- s upon,2 + When he no- thing shines up- on,2 Then you show your lit- tle light,2 Twin- kle, twin- kle, all the night.2 Twin- kle, twin- kle, lit- tle star,2 @@ -96,7 +96,7 @@ text3 = music { \textstyle "roman" Then the tra- veler in the dark2 Thanks you for your ti- ny spark;2 - He could not see which way to_go,2 + He_could not see which way to go,2 If you did not twin- kle so.2 Twin- kle, twin- kle, lit- tle star,2 How I won- der what you are!2 @@ -106,13 +106,13 @@ text3 = music { mstaf = staff { melodic music { melodie } - commands { clef violin } + commands { clef "violin" } } bass_staf = staff { melodic music { begeleiding } - commands { clef bass } + commands { clef "bass" } } diff --git a/lilyponddefs.tex b/lilyponddefs.tex index 0a1fdeef8a..1ad6d5e58c 100644 --- a/lilyponddefs.tex +++ b/lilyponddefs.tex @@ -110,8 +110,10 @@ \mdef\violinclef{71} \mdef\bassclef{73} +\mdef\altoclef{75} \mdef\cviolinclef{72} \mdef\cbassclef{74} +\mdef\caltoclef{76} \mdef\deigthflag{45} \mdef\dsixteenthflag{46} diff --git a/src/clef.cc b/src/clef.cc index 0abd26f44a..d0fcbe09d9 100644 --- a/src/clef.cc +++ b/src/clef.cc @@ -12,6 +12,10 @@ Clef::read(Arrayargs) clef_type = args[0]; if (clef_type == "violin") { c0_pos=-2; + } else if (clef_type == "alto") { + c0_pos = 4; + } else if (clef_type == "tenor") { + c0_pos = 6; } else if (clef_type == "bass") { c0_pos = 10; } else diff --git a/src/clefitem.cc b/src/clefitem.cc index d5237513a2..8b10b60107 100644 --- a/src/clefitem.cc +++ b/src/clefitem.cc @@ -16,6 +16,10 @@ Clef_item::read(String t) type = t; if (type == "violin") y_off = 2; + if (type == "alto") + y_off = 4; + if (type == "tenor") + y_off = 6; if (type == "bass") y_off = 6; } diff --git a/src/keyitem.cc b/src/keyitem.cc index 3a80c28e1f..9ae9c22289 100644 --- a/src/keyitem.cc +++ b/src/keyitem.cc @@ -4,7 +4,10 @@ #include "molecule.hh" #include "paper.hh" #include "lookup.hh" +#include "clef.hh" +const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */ +const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */ Keyitem::Keyitem(int c) { @@ -22,9 +25,20 @@ Keyitem::read(Array s) } } +void +Keyitem::read(const Clef& c) +{ + c_position=(c.c0_pos+70)%7; +} + + void Keyitem::add(int p, int a) { + if ((a<0 && p>FLAT_TOP_PITCH) || + (a>0 && p>SHARP_TOP_PITCH)) { + p=p-7; /* Typeset below c_position */ + } pitch.add(p); acc.add(a); } diff --git a/src/lexer.l b/src/lexer.l index 1d758796b2..dbe7755601 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -153,6 +153,12 @@ COMMENT [%#].*\n int l = lookup_keyword(c); if (l != -1) return l; + +/* let's try passing tex's typesetting macros like \ss \alpha \c */ + String* str_p = new String(YYText()); + return STRING; + +/* and skip identifiers... Identifier * id = lookup_identifier(c); if (id) { yylval.id = id; @@ -162,6 +168,7 @@ COMMENT [%#].*\n yylval.string=sp; return NEWIDENTIFIER; +*/ } \"[^\"]*\" { String s (YYText()+1); @@ -187,6 +194,12 @@ COMMENT [%#].*\n } {COMMENT} { +} +[{}] { + return YYText()[0]; +} +[()\[\]|/.^>_-] { + return yylval.c = YYText()[0]; } [ \t\n]+ { } diff --git a/src/mylexer.cc b/src/mylexer.cc index 42da95740b..d2e4b18ff8 100644 --- a/src/mylexer.cc +++ b/src/mylexer.cc @@ -12,7 +12,6 @@ static Keyword_ent the_key_tab[]={ "bar", BAR, - "bass", BASS, "cadenza", CADENZA, "clef", CLEF, "cm", CM, @@ -48,7 +47,6 @@ static Keyword_ent the_key_tab[]={ "chord", CHORD, "multi", MULTI, "unitspace", UNITSPACE, - "violin", VIOLIN, "voice", VOICE, "voices", VOICES, "width", WIDTH, diff --git a/src/simplewalker.cc b/src/simplewalker.cc index 78ec2b00da..8ac89bd2d0 100644 --- a/src/simplewalker.cc +++ b/src/simplewalker.cc @@ -17,7 +17,6 @@ #include "debug.hh" #include "keyitem.hh" #include "clefitem.hh" -#include "keyitem.hh" #include "slur.hh" #include "localkeyitem.hh" #include "textitem.hh" @@ -98,6 +97,7 @@ Simple_walker::do_TYPESET_command(Command*com) return; if (com->args[0] == "KEY") { + ((Keyitem*) i)->read(clef_); if (oldkey_undo) { ((Keyitem*) i)->read(*oldkey_undo); delete oldkey_undo; -- 2.39.5