From 2ea2d782c903b3de94702387415263c23af97394 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 24 Jan 1997 18:18:51 +0100 Subject: [PATCH] release: 0.0.25 --- .dstreamrc | 5 +- COPYING | 5 ++ Documentation/README.pod | 5 +- NEWS | 5 +- TODO | 7 -- Variables.make | 2 +- configure | 2 +- hdr/keyitem.hh | 3 + init/table_sixteen.ini | 8 ++- init/table_twenty.ini | 8 ++- input/cadenza.ly | 2 + input/kortjakje.ly | 4 +- input/maartje.ly | 10 ++- input/pavane.ly | 13 ++-- input/standchen.lily | 150 +++++++++++++++++++++++++++++++++++++-- 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/parser.y | 10 +-- src/simplewalker.cc | 2 +- 24 files changed, 242 insertions(+), 46 deletions(-) diff --git a/.dstreamrc b/.dstreamrc index 85ab21bde2..da11eb77db 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -13,7 +13,7 @@ Idealspacing 1 # yydebug InitParser 1 -Parser 1 +Parser 0 # FlexLexer debug @@ -37,4 +37,5 @@ Voice_element 0 Input_cursor 1 Commands_at 0 Input_command 0 -Time_description 0 \ No newline at end of file +Time_description 0 +Melodic_req 1 diff --git a/COPYING b/COPYING index a43ea2126f..6bf77451b9 100644 --- a/COPYING +++ b/COPYING @@ -1,3 +1,8 @@ + +This license applies to all files except the included input files +which explicitly state a different copyright + + GNU GENERAL PUBLIC LICENSE Version 2, June 1991 diff --git a/Documentation/README.pod b/Documentation/README.pod index cc82b196bb..17c75baa81 100644 --- a/Documentation/README.pod +++ b/Documentation/README.pod @@ -30,7 +30,7 @@ multiple stafftypes (melodic, rhythmic) =item * beams, slurs, chords, super/subscripts (accents and text), triplets, general n-plet (triplet, -quadruplets, etc.) +quadruplets, etc.), lyrics =item * multiple scores within one input file. Each score is output to @@ -49,7 +49,8 @@ LilyPond was written with some considerations in mind: =over 5 -=item * Describing a well-defined language for defining music. We call +=item * +Describing a well-defined language for defining music. We call this language (rather arrogantly) The Musical Definition Language (mudela for short). LilyPond reads a mudela sourcefile and outputs a TeX file. This musical definition language should: diff --git a/NEWS b/NEWS index 696755258e..fd677144a6 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ +pl 25 + - other clefs added, keys typeset properly (MB) + pl 24: - - Lyrics + - Lyrics (JCN) - Commands in music-mode (an input feature) (there you are, Mats) pl 23: diff --git a/TODO b/TODO index 9b81ff8667..01f9c087c5 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,6 @@ - BUGS * first clef - * position of key acc's - SEVERELY LACKING: * grace notes @@ -54,8 +51,6 @@ SMALLISH PROJECTS * fix symbols in parser.o: `Warning: size of symbol' - * Viola clef - DOC * beam generation. @@ -67,8 +62,6 @@ FUTURE * scrap stem_request? - * Text_pstaff/Lyric_staff - * put requests on barcommands * glissando 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/cadenza.ly b/input/cadenza.ly index 445ec08823..1ca8ba54a5 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -1,6 +1,8 @@ % % Cadenza to Mozart Horn/3 % +% author: unknown. Copyright: none +% cad = music { $ \duration { 8} 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/maartje.ly b/input/maartje.ly index 894118206d..7755894eff 100644 --- a/input/maartje.ly +++ b/input/maartje.ly @@ -1,3 +1,11 @@ +% The purpose of this file is to demonstrate features of LilyPond; +% +% COPYRIGHT: GPL +% +% + + + ritme = staff {rhythmic music {$ c8 @@ -48,7 +56,7 @@ staff { melodic skip 2:0 key skip 5:0 - clef bass + clef "bass" } } diff --git a/input/pavane.ly b/input/pavane.ly index b820506b60..6bd02b32e1 100644 --- a/input/pavane.ly +++ b/input/pavane.ly @@ -1,12 +1,18 @@ % Pavane pour une Infante d\'efunte % by Maurice Ravel % -% (Ravel has been dead for over 50 years. This does not have copyright) +% Ravel deceased in 1937, so copyright on the music will pass in 2008. +% +% The purpose of this file is to demonstrate features of LilyPond; +% I hope this citation isn't beyond the bounds of "fairness" +% % % (there is an accompanying LaTeX file, pavane.tex) % + horn = -staff {melodic +staff { + melodic music{ $ \octave { ' } \duration { 8} @@ -109,8 +115,7 @@ score { skip 1:0 skip 20:0 bar "|:" - skip 9:0 - skip 1:0 + skip 10:0 bar ":|" meter 4* 4 skip 13:0 diff --git a/input/standchen.lily b/input/standchen.lily index a7e4d370eb..81ef61d6b6 100644 --- a/input/standchen.lily +++ b/input/standchen.lily @@ -1,5 +1,5 @@ % st\"andchen.lily -% Franz Schubert +% Franz Schubert (? - ?) % % comments with # note missing stuff % heu, make that %#% @@ -146,6 +146,7 @@ melodie = music { $ [ b8._"f" 'cis16 ] 'd4^> b r %%44 %#% [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r +% typo? [ b8. 'cis16 ] 'd4^> b r %%45 %#% 'cis\grace\stemup @@ -228,7 +229,7 @@ begeleiding = music { $ %%12 == 6 %#% { `d ``bes2 } `e `g `e { `g r4 } `e [ `d `e `g `e `g `e ] -%%13 +%13 %#% { `e ``bes2 } `e `g `e { `g r4 } `e [ `e `e `g `e `g `e ] %%14 @@ -343,25 +344,163 @@ begeleiding = music { $ { `d2.^\fermata ``d2. } $ } +tekst1 = music { + @ + \duration{4} + _ _ _ + _ _ _ + _ _ _ + _ _ _ + % 5 + \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8 + \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8 + Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 } + dir;2 _ + _ _ _ + _ _ _ + % 11 + \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8 + \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8 + Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 } + mir!2 _ + _ _ _ + _ _ _ + + % 17 + Fl\"us-8. ternd16 schlan-4. ke8 + Wip-8. fel16 rau-4. schen8 + \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8 + Licht;2. + _ _ _ + _ _ _ + + % 23 + Des8. Ver-16 r\"a-4. ters8 + feind-8. lich16 Lau-4. schen8 + \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8 + nicht.2. + _ _ _ + _ _ _ + + % volta 1 + % 29 + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + + % volta 2 + % 37 + La\ss8. auch16 dir8. die16 Brust8. be-16 + we- gen, _ + Lieb-4. chen,8 h\"o-8. re16 + mich!2 _ + _ _ _ + _ _ _ + Be-8. bend16 harr' ich8 _8 + dir8. ent-16 ge- gen!8 _8 + \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8 + mich!2. + % 47 + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + % 57 + _ _ _ _ _ _ + @ + } + + tekst2 = music { + @ + \duration{4} + _ _ _ + _ _ _ + _ _ _ + _ _ _ + % 5 + \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8 + \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8 + Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 } + dich,2 _ + _ _ _ + _ _ _ + + % 11 + \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8 + \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8 + Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 } + mich.2 _ + _ _ _ + _ _ _ + + % 17 ok tot hier + Sie-8. ver-16 stehn4. des8 + Bus-8. ens16 Seh-4. nen,8 + \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8 + schmerz,2. + _ _ _ + _ _ _ + + % 23 + R\"uh-8. ren16 mit4. den8 + Sil-8. ber-16 t\"o-4. nen8 + \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8 + Herz.2. + _ _ _ + _ _ _ + + % volta 1 + % 29 + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + + % volta 2 + % 37 + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % 47 + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % _ _ _ _ _ _ + % 57 + % _ _ _ _ _ _ + @ + } + score { paper { symboltables { table_sixteen } output "standchen.uit" unitspace 2.4 cm - geometric 1.4 + % unitspace 4.0 cm % leaves all text stand free +geometric 1.4 } staff { melodic music { melodie } commands { key $bes$ - clef violin + clef "violin" } } + staff { + lyric + music { tekst1 } + music { tekst2 } + } staff { melodic music { begeleiding } commands { key $bes$ - clef bass + clef "bass" } } commands { @@ -371,5 +510,6 @@ score { skip 32:0 bar ":|" skip 22:0 + bar "||" } } 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/parser.y b/src/parser.y index 771734025b..aa3b4f2f37 100644 --- a/src/parser.y +++ b/src/parser.y @@ -63,7 +63,7 @@ Paperdef*default_paper(); %token VOICE STAFF SCORE TITLE BAR NOTENAME OUTPUT %token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND %token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND -%token KEY CLEF VIOLIN BASS MULTI TABLE CHORD VOICES +o%token KEY CLEF MULTI TABLE CHORD VOICES %token PARTIAL RHYTHMIC MELODIC MUSIC LYRIC GROUPING CADENZA %token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET %token MARK GOTO @@ -94,7 +94,7 @@ Paperdef*default_paper(); %type score_commands_block score_commands_body %type staff_commands_block staff_commands_body %type post_request pre_request -%type clef_id pitchmod +%type pitchmod %type music %type music_chord music_chord_body @@ -238,7 +238,7 @@ staff_command: $$ = get_key_interpret_command(*$2); delete $2; } - | CLEF clef_id { + | CLEF STRING { $$ = get_clef_interpret_command(*$2); delete $2; } @@ -588,10 +588,6 @@ unit: CM { $$ = "cm"; } |PT { $$ = "pt"; } ; -clef_id: - VIOLIN { $$ = new String("violin"); } - | BASS { $$ = new String("bass"); } - ; /* symbol tables */ 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.2