From 99dedf2a84af8fa1d2e1e6aa68ea1e5605d1760b Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 01:03:06 +0000 Subject: [PATCH] lilypond-1.3.150 --- CHANGES | 64 +++++++ lily/parser.yy | 169 ++++++++++-------- .../J.S.Bach/Petites-Preludes/preludes-1.ly | 6 +- .../J.S.Bach/Petites-Preludes/preludes-2.ly | 2 +- .../J.S.Bach/Petites-Preludes/preludes-5.ly | 6 +- 5 files changed, 167 insertions(+), 80 deletions(-) diff --git a/CHANGES b/CHANGES index 54da3bce7e..6552157a3c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,67 @@ +1.3.149.jcn3 +============ + +* Bugfix: markup text: lines with markup. + +* Fixed line height in postscript output. + +* Windows installer stuff: the ``It shouldn't be hard -- but do need + some sleep'' release. + + Think of it: /shouldn't/ is *exactly* why GNU/Linux exists, and + why we advise to run LilyPond on Linux -- UMSDOS if you must. + + You may consider our part of the job done. Any more of this + sad and sorry stuff will drive me to drink. It makes you realise + again how much fun using Linux actually is. + + We'll take patches from now on, from people that have a stronger + stomach. Good night. + + - Ly2dvi: run commands from sh (so that tex wrappers be used). + + - Added cygwin man,less and windows gs, gsview, miktex, python to + lilypond installer repository. Moved profile.d setup functionality to + postinstall. + - Added tex and latex wrappers. + - Wrappers for all python scripts. + +* Removed RMAIL header from german-chords.ly + fixes (Rune). + +1.3.149.hwn1 +============ + +* Website fixes + +* Allow ` for lyric punctuation + +* Add note to refman saying to read the tutorial first. + +* Changed regular identifier error to warning. + +* Make lexer emit FRACTION for N/M (where N, M unsigned numbers). This +fixes one shift reduce, fixing the problem with multiplied durations +and inversions. + +* Set measureLength and beatLength from the parser. This fixes percent +repeats that come directly after a time signature change. + +* Bugfix: process clef change upon Clef_engraver creation. This fixes +grace notes beginning a piece; bug with combining clef changes and +grace notes remains. + +* Bugfix: typo in convert-ly rule + +* spelling: barsize-procedure -> bar-size-procedure + +* fixes for input/test/ (thanks, Laura) + +* Bugfix: \version "1.2.4.foo" now doesn't cause a crash. + + +1.3.149 +======= + 1.3.148.jcn3 ============ diff --git a/lily/parser.yy b/lily/parser.yy index 39ebda46bb..043a658fcf 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -38,6 +38,7 @@ #include "transposed-music.hh" #include "time-scaled-music.hh" #include "repeated-music.hh" + #include "lilypond-input-version.hh" #include "grace-music.hh" #include "part-combine-music.hh" @@ -46,8 +47,6 @@ #include "un-relativable-music.hh" #include "chord.hh" - - bool regular_identifier_b (SCM id) { @@ -64,13 +63,24 @@ regular_identifier_b (SCM id) } +Music* +set_property_music (SCM sym, SCM value) +{ + Music * p = new Music (SCM_EOL); + p->set_mus_property ("symbol", sym); + p->set_mus_property ("iterator-ctor", + Property_iterator::constructor_cxx_function); + + p->set_mus_property ("value", value); + return p; +} + bool is_duration_b (int t) { return t && t == 1 << intlog2 (t); } - void set_music_properties (Music *p, SCM a) { @@ -81,15 +91,9 @@ set_music_properties (Music *p, SCM a) } -// mmm JUNKME ? -Lilypond_version oldest_version ("1.3.59"); -void -print_lilypond_versions (ostream &os) -{ - os << _f ("Oldest supported input version: %s", oldest_version.str ()) - << endl; -} + + // needed for bison.simple's malloc () and free () @@ -231,6 +235,7 @@ yylex (YYSTYPE *s, void * v_l) %token TONICNAME_PITCH %token CHORDMODIFIER_PITCH %token DURATION_IDENTIFIER +%token FRACTION %token IDENTIFIER @@ -271,7 +276,7 @@ yylex (YYSTYPE *s, void * v_l) %type chord_additions chord_subtractions chord_notes chord_step %type chord %type chord_note chord_inversion chord_bass -%type duration_length +%type duration_length fraction %type embedded_scm scalar %type Music Sequential_music Simultaneous_music Music_sequence @@ -284,7 +289,7 @@ yylex (YYSTYPE *s, void * v_l) %type command_req verbose_command_req %type extender_req %type hyphen_req -%type string bare_number number_expression +%type string bare_number number_expression number_term number_factor %type score_block score_body @@ -296,7 +301,10 @@ yylex (YYSTYPE *s, void * v_l) %left '-' '+' -%left '*' '/' + +/* We don't assign precedence to / and *, because we might need varied +prec levels in different prods */ + %left UNARY_MINUS %% @@ -306,11 +314,9 @@ lilypond: /* empty */ | lilypond assignment { } | lilypond error { THIS->error_level_i_ = 1; - //THIS->parser_error (_ ("ly invalid")); } | lilypond INVALID { THIS->error_level_i_ = 1; - //THIS->parser_error (_ ("ly invalid")); } ; @@ -328,7 +334,6 @@ toplevel_expression: } | score_block { score_global_array.push ($1); - } | output_def { if (dynamic_cast ($1)) @@ -351,13 +356,10 @@ chordmodifiers_block: CHORDMODIFIERS notenames_body { $$ = $2; } ; - notenames_block: PITCHNAMES notenames_body { $$ = $2; } ; - - notenames_body: embedded_scm { int i = scm_ilength ($1); @@ -403,8 +405,16 @@ assignment: THIS->remember_spot (); } /* cont */ '=' identifier_init { + + /* + Should find generic way of associating input with objects. + */ + Input ip = THIS->pop_spot (); + if (! regular_identifier_b ($1)) - THIS->parser_error (_ ("Identifier should have alphabetic characters only")); + { + ip.warning (_ ("Identifier should have alphabetic characters only")); + } THIS->lexer_p_->set_identifier (ly_scm2string ($1), $4); @@ -415,10 +425,6 @@ assignment: all objects can be unprotected as soon as they're here. */ - /* - Should find generic way of associating input with objects. - */ - THIS->pop_spot (); } ; @@ -812,11 +818,11 @@ Composite_music: THIS->remember_spot (); } /* CONTINUED */ - bare_unsigned '/' bare_unsigned Music + fraction Music { - int n = $3; int d = $5; - Music *mp = $6; + int n = gh_scm2int (gh_car ($3)); int d = gh_scm2int (gh_cdr ($3)); + Music *mp = $4; $$ = new Time_scaled_music (SCM_EOL); $$->set_spot (THIS->pop_spot ()); @@ -943,13 +949,8 @@ translator_change: property_def: PROPERTY STRING '.' STRING '=' scalar { - Music *t = new Music (SCM_EOL); - - t->set_mus_property ("iterator-ctor", - Property_iterator::constructor_cxx_function); - t->set_mus_property ("symbol", scm_string_to_symbol ($4)); - t->set_mus_property ("value", $6); - + + Music *t = set_property_music (scm_string_to_symbol ($4), $6); Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); @@ -1058,12 +1059,7 @@ command_element: $1-> set_spot (THIS->here_input ()); } | BAR STRING { - Music *t = new Music (SCM_EOL); - - t->set_mus_property ("iterator-ctor", - Property_iterator::constructor_cxx_function); - t->set_mus_property ("symbol", ly_symbol2scm ("whichBar")); - t->set_mus_property ("value", $2); + Music *t = set_property_music (ly_symbol2scm ("whichBar"), $2); Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); @@ -1075,13 +1071,8 @@ command_element: csm->set_mus_property ("context-type", ly_str02scm ("Score")); } | PARTIAL duration_length { - Music * p = new Music (SCM_EOL); - p->set_mus_property ("symbol", ly_symbol2scm ( "measurePosition")); - p->set_mus_property ("iterator-ctor", - Property_iterator::constructor_cxx_function); - Moment m = - unsmob_duration ($2)->length_mom (); - p->set_mus_property ("value", m.smobbed_copy ()); + Music * p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ()); Context_specced_music * sp = new Context_specced_music (SCM_EOL); sp->set_mus_property ("element", p->self_scm ()); @@ -1111,19 +1102,33 @@ command_element: $$ =sp ; sp-> set_mus_property ("context-type", ly_str02scm ("Staff")); } - | TIME_T bare_unsigned '/' bare_unsigned { - Music * p = new Music (SCM_EOL); - p->set_mus_property ("symbol", - ly_symbol2scm ( "timeSignatureFraction")); - p->set_mus_property ("iterator-ctor", - Property_iterator::constructor_cxx_function); + | TIME_T fraction { + Music * p1 = set_property_music (ly_symbol2scm ( "timeSignatureFraction"), $2); + + int l = gh_scm2int (gh_car ($2)); + int o = gh_scm2int (gh_cdr ($2)); + + Moment one_beat = Moment (1)/Moment (o); + Moment len = Moment (l) * one_beat; + - p->set_mus_property ("value", gh_cons (gh_int2scm ($2), - gh_int2scm ($4))); + Music *p2 = set_property_music (ly_symbol2scm ("measureLength"), len.smobbed_copy ()); + Music *p3 = set_property_music (ly_symbol2scm ("beatLength"), one_beat.smobbed_copy ()); + + SCM list = gh_list (p1->self_scm (), p2->self_scm (), p3->self_scm(), SCM_UNDEFINED); + Sequential_music *seq = new Sequential_music (SCM_EOL); + seq->set_mus_property ("elements", list); + Context_specced_music * sp = new Context_specced_music (SCM_EOL); - sp->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + sp->set_mus_property ("element", seq->self_scm ()); + + + + scm_unprotect_object (p3->self_scm ()); + scm_unprotect_object (p2->self_scm ()); + scm_unprotect_object (p1->self_scm ()); + scm_unprotect_object (seq->self_scm ()); $$ = sp; @@ -1588,11 +1593,20 @@ multiplied_duration: steno_duration { $$ = $1; } - | multiplied_duration '*' bare_unsigned { + | steno_duration '*' bare_unsigned { $$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy (); } - | multiplied_duration '/' bare_unsigned { - $$ = unsmob_duration ($$)->compressed (Moment (1,$3)).smobbed_copy (); + | steno_duration '*' FRACTION { + Moment m (gh_scm2int (gh_car ($3)), gh_scm2int (gh_cdr ($3))); + + $$ = unsmob_duration ($$)->compressed (m).smobbed_copy (); + } + ; + +fraction: + FRACTION { $$ = $1; } + | UNSIGNED '/' UNSIGNED { + $$ = gh_cons (gh_int2scm ($1), gh_int2scm ($3)); } ; @@ -1809,29 +1823,38 @@ chord_note: UTILITIES */ number_expression: - bare_number { - $$ = $1; + number_expression '+' number_term { + $$ = scm_sum ($1, $3); } - | '-' number_expression %prec UNARY_MINUS { - $$ = scm_difference ($2, SCM_UNDEFINED); + | number_expression '-' number_term { + $$ = scm_difference ($1, $3); + } + | number_term + ; + +number_term: + number_factor { + $$ = $1; } - | number_expression '*' number_expression { + | number_factor '*' number_factor { $$ = scm_product ($1, $3); } - | number_expression '/' number_expression { + | number_factor '/' number_factor { $$ = scm_divide ($1, $3); } - | number_expression '+' number_expression { - $$ = scm_sum ($1, $3); - } - | number_expression '-' number_expression { - $$ = scm_difference ($1, $3); - } - | '(' number_expression ')' { + ; + +number_factor: + '(' number_expression ')' { $$ = $2; } + | '-' number_factor { /* %prec UNARY_MINUS */ + $$ = scm_difference ($2, SCM_UNDEFINED); + } + | bare_number ; + bare_number: UNSIGNED { $$ = gh_int2scm ($1); diff --git a/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly b/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly index 119471cba3..db728f19d5 100644 --- a/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly +++ b/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly @@ -95,13 +95,13 @@ upper = \context Staff=upper \notes\relative c { lower = \context Staff=lower \notes\relative c{ \context Voice=i \property Voice.TextScript \set #'font-style = #'roman - c4 e g^"\\textsharp"-\mordent g,4 | - d'4-\mordent f a-\mordent^"\\textsharp" a,4 | + c4 e g^#'(music "accidentals-1") -\mordent g,4 | + d'4-\mordent f a-\mordent^#'(music "accidentals-1") a,4 | e' e'-\mordent a, b-\upprall | c4 e, fis gis-\upprall | a4 c, d e-\upprall | f4 e d-\prall c | - g'-\mordent^"\\textsharp" g, g'-\mordent g, | + g'-\mordent^#'(music "accidentals-1") g, g'-\mordent g, | g'-\mordent g, g'-\mordent g, | g' r s s | s s s s \clef "bass" | < diff --git a/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly b/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly index e4046587dc..e8f231a3f9 100644 --- a/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly +++ b/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly @@ -60,7 +60,7 @@ lower = \context Staff \notes\relative c{ g2 r4 g | a8 a, c e c a g' e | fis2 r4 d | - g-\mordent-"(\\textsharp)" g, 4 g'-\mordent g, | + g-\mordent-#'(music "accidentals-1") g, 4 g'-\mordent g, | % mordents in brackets... g'-\mordent g, g'-\mordent g, | g'-\mordent g, g'-\mordent g, | diff --git a/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly b/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly index 3792cad340..d760a91db4 100644 --- a/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly +++ b/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly @@ -26,8 +26,8 @@ upper = \context Staff \notes\relative c { \stemUp \property Voice.TextScript \set #'font-style = #'roman - c4-\mordent^"(\\textsharp)" r r | - c4-\mordent^"(\\textsharp)" r r + c4-\mordent^#'(music "accidentals-1") r r | + c4-\mordent^#'(music "accidentals-1") r r \property Voice.TextScript \set #'font-style = #'italic } \context Voice=ii { \stemDown a4 r r | a4 r r } @@ -124,7 +124,7 @@ lower = \context Staff \notes\relative c{ fis,4 r r d fis d | \property Voice.TextScript \set #'font-style = #'roman - g4-\mordent^"(\\textsharp)" r r8 f!8 | + g4-\mordent^#'(music "accidentals-1") r r8 f!8 | \property Voice.TextScript \set #'font-style = #'italic e4-\prall r r | f4-\mordent r r8 e | -- 2.39.5