From c618d901d87deee3b93c00f522383ec386c5845b Mon Sep 17 00:00:00 2001 From: hanwen Date: Sat, 18 Sep 2004 10:53:08 +0000 Subject: [PATCH] * lily/parser.yy (direction_less_char): soft code \< \> \! \( \) ( ) * input/regression/tie.ly (texidoc): cleanup. * ly/declarations-init.ly (tildeSymbol): soft-code meaning of [ ] and ~ --- ChangeLog | 8 +++ input/regression/tie.ly | 23 +++---- lily/parser.yy | 121 ++++++++++++--------------------- ly/declarations-init.ly | 16 +++++ ly/script-init.ly | 2 + scm/define-markup-commands.scm | 4 +- 6 files changed, 81 insertions(+), 93 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd0d0eb9fb..bac9ea8bc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2004-09-18 Han-Wen Nienhuys + * lily/parser.yy (direction_less_char): soft code \< \> \! \( \) ( + ) + + * input/regression/tie.ly (texidoc): cleanup. + + * ly/declarations-init.ly (tildeSymbol): soft-code meaning of [ ] + and ~ + * lily/slur-scoring.cc (score_extra_encompass): check if extra objects are on boundary column. diff --git a/input/regression/tie.ly b/input/regression/tie.ly index 0b99a6e5d5..c48b0a6ff3 100644 --- a/input/regression/tie.ly +++ b/input/regression/tie.ly @@ -7,17 +7,16 @@ Ties are strictly horizontal. They are placed in between note heads. The horizontal middle should not overlap with a staffline. " } -\score{ - \relative c''{ - %b2~b4~b8~b16~b32~b64 r64\break - %a2~a4~a8~a16~a32~a64 r64 - \time 8/4 - d1 ~ d2~d4~d8~d16~d32~d64 r64\break - a1~ a2~a4~a8~a16~a32~a64 r64 - %c2~c4~c8~c16~c32~c64 r64 - } - \paper{ - linewidth=0. - } +\paper{ + raggedright= ##t } + +\relative c''{ + %b2~b4~b8~b16~b32~b64 r64\break + %a2~a4~a8~a16~a32~a64 r64 + \time 8/4 + d1 ~ d2~d4~d8~d16~d32~d64 r64\break + a1~ a2~a4~a8~a16~a32~a64 r64 + %c2~c4~c8~c16~c32~c64 r64 +} diff --git a/lily/parser.yy b/lily/parser.yy index 1ffdfa5f35..267ec9467d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -403,6 +403,7 @@ or %type context_def_spec_block context_def_spec_body %type context_mod context_def_mod optional_context_mod %type context_prop_spec +%type direction_less_char %type duration_length fraction %type embedded_scm scalar %type identifier_init @@ -1743,45 +1744,53 @@ string_number_event: } ; - -direction_less_event: +direction_less_char: '[' { - - -/* - -TODO: should take all these defs out of the parser, adn make use -configurable, i.e. - - -(set-articulation '~ "trill") - -*/ - Music *m = MY_MAKE_MUSIC ("BeamEvent"); - m->set_spot (THIS->here_input ()); - m->set_property ("span-direction", scm_int2num (START)); - $$ = m; + $$ = ly_symbol2scm ("bracketOpenSymbol"); } | ']' { - Music *m = MY_MAKE_MUSIC ("BeamEvent"); - m->set_spot (THIS->here_input ()); - m->set_property ("span-direction", scm_int2num (STOP)); - $$ = m; + $$ = ly_symbol2scm ("bracketCloseSymbol"); } - | '~' { - Music *m = MY_MAKE_MUSIC ("TieEvent"); - m->set_spot (THIS->here_input ()); - $$ = m; + | '~' { + $$ = ly_symbol2scm ("tildeSymbol"); } - | close_event { - $$ = $1; - dynamic_cast ($$)->set_property ("span-direction", - scm_int2num (START)); + | '(' { + $$ = ly_symbol2scm ("parenthesisOpenSymbol"); } - | open_event { - $$ = $1; - dynamic_cast ($$)->set_property ("span-direction", - scm_int2num (STOP)); + | ')' { + $$ = ly_symbol2scm ("parenthesisCloseSymbol"); + } + | E_EXCLAMATION { + $$ = ly_symbol2scm ("escapedExclamationSymbol"); + } + | E_OPEN { + $$ = ly_symbol2scm ("escapedParenthesisOpenSymbol"); + } + | E_CLOSE { + $$ = ly_symbol2scm ("escapedParenthesisCloseSymbol"); + } + | E_BIGGER { + $$ = ly_symbol2scm ("escapedBiggerSymbol"); + } + | E_SMALLER { + $$ = ly_symbol2scm ("escapedSmallerSymbol"); + } + ; + +direction_less_event: + direction_less_char { + SCM predefd = THIS->lexer_->lookup_identifier_symbol ($1); + Music * m = 0: + if (unsmob_music (predefd)) + { + m = unsmob_music (predefd)->clone (); + } + else + { + m = MY_MAKE_MUSIC ("Music"); + } + m->set_spot (THIS->here_input ()); + $$ = m; } | EVENT_IDENTIFIER { $$ = unsmob_music ($1); @@ -1881,52 +1890,6 @@ pitch_also_in_chords: | steno_tonic_pitch ; -close_event: - '(' { - Music *s = MY_MAKE_MUSIC ("SlurEvent"); - $$ = s; - s->set_spot (THIS->here_input ()); - } - | E_OPEN { - Music *s = MY_MAKE_MUSIC ("PhrasingSlurEvent"); - $$ = s; - s->set_spot (THIS->here_input ()); - } - | E_SMALLER { - Music *s = MY_MAKE_MUSIC ("CrescendoEvent"); - $$ = s; - s->set_spot (THIS->here_input ()); - } - | E_BIGGER { - Music *s = MY_MAKE_MUSIC ("DecrescendoEvent"); - $$ = s; - s->set_spot (THIS->here_input ()); - } - ; - - -open_event: - E_EXCLAMATION { - Music *s = MY_MAKE_MUSIC ("CrescendoEvent"); - s->set_spot (THIS->here_input ()); - - $$ = s; - } - | ')' { - Music *s= MY_MAKE_MUSIC ("SlurEvent"); - $$ = s; - s->set_spot (THIS->here_input ()); - - } - | E_CLOSE { - Music *s= MY_MAKE_MUSIC ("PhrasingSlurEvent"); - $$ = s; - s->set_property ("span-type", - scm_makfrom0str ("phrasing-slur")); - s->set_spot (THIS->here_input ()); - } - ; - gen_text_def: full_markup { Music *t = MY_MAKE_MUSIC ("TextScriptEvent"); diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 2a49213901..e85362a885 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -40,8 +40,24 @@ noBreak = #(make-event-chord (list (make-penalty-music 10001 0))) pageBreak = #(make-event-chord (list (make-penalty-music -10001 -10001))) noPageBreak = #(make-event-chord (list (make-penalty-music 0 10001))) + +% +% Code articulation definitions +% noBeam = #(make-music 'BeamForbidEvent) pipeSymbol = #(make-music 'BarCheck) +bracketOpenSymbol = #(make-span-event 'BeamEvent START) +bracketCloseSymbol = #(make-span-event 'BeamEvent STOP) +tildeSymbol = #(make-music 'TieEvent) +parenthesisOpenSymbol = #(make-span-event 'SlurEvent START) +parenthesisCloseSymbol = #(make-span-event 'SlurEvent STOP) +escapedExclamationSymbol = #(make-span-event 'CrescendoEvent STOP) +escapedParenthesisOpenSymbol = #(make-span-event 'PhrasingSlurEvent START) +escapedParenthesisCloseSymbol = #(make-span-event 'PhrasingSlurEvent STOP) +escapedBiggerSymbol = #(make-span-event 'CrescendoEvent START) +escapedSmallerSymbol = #(make-span-event 'DecrescendoEvent START) + + foo = { \pageBreak } diff --git a/ly/script-init.ly b/ly/script-init.ly index 2036ff4518..496dcc0ee2 100644 --- a/ly/script-init.ly +++ b/ly/script-init.ly @@ -1,6 +1,8 @@ \version "2.3.16" +% code char abbreviations +% dashHat= "marcato" dashPlus= "stopped" dashDash= "tenuto" diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 5b76332244..8bc1a0c156 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -609,8 +609,8 @@ any sort of property supported by @internalsref{font-interface} and (def-markup-command (box paper props arg) (markup?) "Draw a box round @var{arg}. Looks at @code{thickness} and -@code{box-padding} to determine line thickness and padding around the -markup." +@code{box-padding} properties to determine line thickness and padding +around the markup." (let ((th (chain-assoc-get 'thickness props 0.1)) (pad (chain-assoc-get 'box-padding props 0.2)) (m (interpret-markup paper props arg))) -- 2.39.5