From 368c6346e0d46aed9931f43f662ff5207dd943d8 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 13 Oct 2002 19:38:44 +0000 Subject: [PATCH] * scm/music-types.scm: junk compat glue * scripts/convert-ly.py: add rules for stuff below, junk compatibility glue for spanrequest. * lily/parser.yy (verbose_event): remove \spanrequest, \commandspanrequest, \script. * lily/identifier-smob.cc (LY_DEFINE): change name to ly-export * lily/parser.yy: remove arpeggio keyword; use identifier. Idem for \penalty, \glissando. --- ChangeLog | 15 ++++ Documentation/user/internals.itely | 37 -------- Documentation/user/refman.itely | 15 +--- input/les-nereides.ly | 6 +- input/mutopia/W.A.Mozart/mozart-hrn3-defs.ly | 4 +- input/regression/break.ly | 5 +- input/test/ac-extra-voice.ly | 2 +- input/test/ottava.ly | 4 +- input/test/scheme-interactions.ly | 3 +- input/test/text-spanner.ly | 18 ++-- input/test/trill.ly | 6 +- lily/dynamic-engraver.cc | 1 - lily/identifier-smob.cc | 4 +- lily/my-lily-lexer.cc | 6 -- lily/parser.yy | 64 +------------- ly/accordion-defs-init.ly | 88 ++++++++++---------- ly/declarations-init.ly | 5 +- ly/property-init.ly | 5 +- ly/script-init.ly | 69 +++++++-------- ly/spanners-init.ly | 43 +++++----- scm/music-functions.scm | 15 ++++ scm/music-types.scm | 21 ----- scripts/convert-ly.py | 43 ++++++++++ 23 files changed, 213 insertions(+), 266 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71b6d05a68..e4e71ac089 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2002-10-13 Han-Wen Nienhuys + + * scm/music-types.scm: junk compat glue + + * scripts/convert-ly.py: add rules for stuff below, junk + compatibility glue for spanrequest. + + * lily/parser.yy (verbose_event): remove \spanrequest, + \commandspanrequest, \script. + + * lily/identifier-smob.cc (LY_DEFINE): change name to ly-export + + * lily/parser.yy: remove arpeggio keyword; use identifier. Idem + for \penalty, \glissando. + 2002-10-13 Rune Zedeler * lily/accidental-engraver.cc: Fix diff --git a/Documentation/user/internals.itely b/Documentation/user/internals.itely index c60766df94..81d7e672ff 100644 --- a/Documentation/user/internals.itely +++ b/Documentation/user/internals.itely @@ -707,43 +707,6 @@ music = \notes { c'4 d'4( e'4 f'4 } More examples are given in the distributed example files in @code{input/test/}. - -@c . {Span requests} -@menu -* Span requests:: -@end menu - -@node Span requests -@subsection Span requests -@cindex Span requests - -Notational constructs that start and end on different notes can be -entered using span requests. The syntax is as follows: - -@example -\spanrequest @var{startstop} @var{type} -@end example - -@cindex @code{\start} -@cindex @code{\stop} - -@noindent -This defines a spanning request. The @var{startstop} parameter is either --1 (@code{\start}) or 1 (@code{\stop}) and @var{type} is a string that -describes what should be started. Much of the syntactic sugar is a -shorthand for @code{\spanrequest}, for example - -@lilypond[fragment,verbatim,center] -c'4-\spanrequest \start "slur" -c'4-\spanrequest \stop "slur" -@end lilypond - -Among the supported types are @code{crescendo}, @code{decrescendo}, -@code{beam}, @code{slur}. This is an internal command. Users are -encouraged to use the shorthands which are defined in the initialization -file @file{spanners.ly}. - - @c . {Assignments} @node Assignments @subsection Assignments diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 787d21dcd4..20adac1d36 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1770,8 +1770,8 @@ over many measures. This is indicated by following the text with a dotted line. You can create such texts using text spanners. The syntax is as follows: @example -\spanrequest \start "text" -\spanrequest \stop "text" + \startTextSpan + \stopTextSpan @end example LilyPond will respond by creating a @internalsref{TextSpanner} object (typically in @internalsref{Voice} context). The string to be printed, as well as the @@ -1784,7 +1784,7 @@ An application---or rather, a hack---is to fake octavation indications. \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5) \property Voice.TextSpanner \set #'edge-text = #'("8va " . "") \property Staff.centralCPosition = #-13 - a\spanrequest \start "text" b c a \spanrequest \stop "text" } + a\startTextSpan b c a \stopTextSpan } @end lilypond @@ -1916,7 +1916,6 @@ finger changes, use markup texts: @end lilypond -@cindex @code{\script} @cindex scripts @cindex superscript @cindex subscript @@ -2837,14 +2836,6 @@ Piano pedal instruction can be expressed using @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda}, @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp}. -These identifiers are shorthands for spanner commands of the types -@internalsref{Sustain}, @internalsref{UnaCorda} and @internalsref{Sostenuto}: - -@lilypond[fragment,verbatim] -c''4 \spanrequest \start "Sustain" c''4 -c''4 \spanrequest \stop "Sustain" -@end lilypond - The symbols that are printed can be modified by setting @code{pedal@var{X}Strings}, where @var{X} is one of the pedal types: Sustain, Sostenuto or UnaCorda. Refer to the generated documentation of diff --git a/input/les-nereides.ly b/input/les-nereides.ly index 97ebe1921a..ce04d52dcb 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -1,4 +1,4 @@ -\version "1.6.4" +\version "1.7.2" \header { composer = "ARTHUR GRAY" @@ -85,7 +85,7 @@ treble = \context Voice=treble \notes\relative c''{ % currently, this can't be (small) italic, because in the paperblock % we set italic_magnifictation to get large italics. - cis''''4^"m.g."\arpeggio \spanrequest \start "text" ( + cis''''4^"m.g."\arpeggio #(ly-export (make-span-event 'TextSpanEvent START)) ( \property Voice.Stem \revert #'direction @@ -93,7 +93,7 @@ treble = \context Voice=treble \notes\relative c''{ )cis8 \property Voice.Stem \revert #'direction \property Voice.Stem \override #'direction = #0 - [a16-5( fis dis \spanrequest \stop "text" ] + [a16-5( fis dis #(ly-export (make-span-event 'TextSpanEvent STOP)) ] \property Staff.centralCPosition = #-6 [cis32 a-1 fis-4 dis] [cis a )fis-2] diff --git a/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ly b/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ly index 2be2b1cbca..3ef3d9eba8 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ly +++ b/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ly @@ -6,7 +6,7 @@ longgrace = \property Voice.Stem \override #'stroke-style = #'() endlonggrace = \property Voice.Stem \revert #'stroke-style ritenuto = \textscript #'(italic "rit.") -\version "1.6.4" +\version "1.7.2" #(define italic-bf '((font-shape . italic) (font-series . bold))) @@ -22,7 +22,7 @@ ritenuto = \textscript #'(italic "rit.") (font-relative-size . 3))) cresc = \notes { - \commandspanrequest \start "crescendo" + #(ly-export (make-event-chord (list (make-span-event 'CrescendoEvent START)))) \property Voice.crescendoText = #`(,italic-bf "cresc.") \property Voice.crescendoSpanner = #'dashed-line } diff --git a/input/regression/break.ly b/input/regression/break.ly index 4f7887346b..116fe8242e 100644 --- a/input/regression/break.ly +++ b/input/regression/break.ly @@ -3,13 +3,12 @@ \header{ texidoc=" Breaks can be encouraged and discouraged using @code{\\break} and -@code{\\noBreak}. They are abbrevs for @code{\\penalty} commands. -" +@code{\\noBreak}." } \score{ - \notes\context Voice{ + \notes\relative c'' \context Voice{ \emptyText c1 \noBreak c1 \noBreak \mark "nobreak" c1 \noBreak c1 \break \mark "break" c1 \break \mark "break" c1 diff --git a/input/test/ac-extra-voice.ly b/input/test/ac-extra-voice.ly index f1a7c6738e..1a526e0fd9 100644 --- a/input/test/ac-extra-voice.ly +++ b/input/test/ac-extra-voice.ly @@ -1,4 +1,4 @@ -\version "1.5.68" +\version "1.7.2" % % TODO: what's this? % diff --git a/input/test/ottava.ly b/input/test/ottava.ly index ad8aecc860..3bfe76b22b 100644 --- a/input/test/ottava.ly +++ b/input/test/ottava.ly @@ -1,4 +1,4 @@ -\version "1.5.68" +\version "1.7.2" fragment = \notes { @@ -7,7 +7,7 @@ fragment = \notes { \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5) \property Voice.TextSpanner \set #'edge-text = #'("8va " . "") \property Staff.centralCPosition = #-13 - a\spanrequest \start "text" b c a \spanrequest \stop "text" + a#(ly-export (make-span-event 'TextSpanEvent START)) b c a #(ly-export (make-span-event 'TextSpanEvent STOP)) } \paper { linewidth = -1. } diff --git a/input/test/scheme-interactions.ly b/input/test/scheme-interactions.ly index 76710822ef..e7802cad24 100644 --- a/input/test/scheme-interactions.ly +++ b/input/test/scheme-interactions.ly @@ -1,3 +1,4 @@ +\version "1.7.2" \header { @@ -14,7 +15,7 @@ bra = \notes \transpose c' { e'4-. } \score { \context Voice \notes\relative c' { c4 - #(ly-id (make-sequential-music (list foo foo foo ))) + #(ly-import (make-sequential-music (list foo foo foo ))) #(begin (define baz (make-simultaneous-music (list foo bra))) (empty-music)) c4 diff --git a/input/test/text-spanner.ly b/input/test/text-spanner.ly index fce5b92e24..22b30373d9 100644 --- a/input/test/text-spanner.ly +++ b/input/test/text-spanner.ly @@ -1,4 +1,4 @@ -\version "1.5.68" +\version "1.7.2" \header { texidoc = "ottava spanners." @@ -7,31 +7,31 @@ texidoc = "ottava spanners." \score{ \notes\relative c''{ \property Voice.TextSpanner \override #'edge-text = #'("8 " . "") - a \spanrequest \start "text" + a #(ly-export (make-span-event 'TextSpanEvent START)) b c - a \spanrequest \stop "text" + a #(ly-export (make-span-event 'TextSpanEvent STOP)) \property Voice.TextSpanner \revert #'type \property Voice.TextSpanner \override #'type = #'dotted-line - a \spanrequest \start "text" + a #(ly-export (make-span-event 'TextSpanEvent START)) b c - a \spanrequest \stop "text" + a #(ly-export (make-span-event 'TextSpanEvent STOP)) \property Voice.TextSpanner \revert #'type \property Voice.TextSpanner \override #'type = #'dashed-line \property Voice.TextSpanner \override #'edge-height = #'(1 . -2) - a \spanrequest \start "text" + a #(ly-export (make-span-event 'TextSpanEvent START)) b c - a \spanrequest \stop "text" + a #(ly-export (make-span-event 'TextSpanEvent STOP)) \property Staff.centralCPosition = #-13 \property Voice.TextSpanner \override #'dash-length = #5 \property Voice.TextSpanner \override #'thickness = #10 - a \spanrequest \start "text" + a #(ly-export (make-span-event 'TextSpanEvent START)) b c - a \spanrequest \stop "text" + a #(ly-export (make-span-event 'TextSpanEvent STOP)) \property Staff.centralCPosition = #-6 } } diff --git a/input/test/trill.ly b/input/test/trill.ly index fba7d72a1b..af64192ca6 100644 --- a/input/test/trill.ly +++ b/input/test/trill.ly @@ -1,4 +1,4 @@ -\version "1.5.68" +\version "1.7.2" \header { texidoc="show trill line type" @@ -13,13 +13,13 @@ texidoc="show trill line type" \property Voice.TextSpanner \set #'type = #'dotted-line \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5) \property Voice.TextSpanner \set #'edge-text = #'("8va " . "") - a\spanrequest \start "text" b c a \spanrequest \stop "text" + a#(ly-export (make-span-event 'TextSpanEvent START)) b c a #(ly-export (make-span-event 'TextSpanEvent STOP)) %\property Voice.TextSpanner \set #'font-family = #'music \property Voice.TextSpanner \set #'type = #'trill \property Voice.TextSpanner \set #'edge-height = #'(0 . 0) \property Voice.TextSpanner \set #'edge-text = #'((line (music "scripts-trill") " ") . "") - a\spanrequest \start "text" b c a \spanrequest \stop "text" + a#(ly-export (make-span-event 'TextSpanEvent START)) b c a #(ly-export (make-span-event 'TextSpanEvent STOP)) } \paper { } } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 61ba3b5141..5361a19220 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -251,7 +251,6 @@ Dynamic_engraver::process_music () } - /* This is a convenient (and legacy) interface to TextSpanners diff --git a/lily/identifier-smob.cc b/lily/identifier-smob.cc index 2d380454d8..f3881b48ed 100644 --- a/lily/identifier-smob.cc +++ b/lily/identifier-smob.cc @@ -31,8 +31,8 @@ print_box (SCM b, SCM port, scm_print_state *pstate) /* This defines the primitve `make-box', which returns a new smob of type `box', initialized to `#f'. */ -LY_DEFINE(package_identifier, "ly-id", 1,0,0, (SCM arg), - "Package a Scheme object, so it is treated as an identifier.") +LY_DEFINE(package_identifier, "ly-export", 1,0,0, (SCM arg), + "Export a Scheme object to the parser, so it is treated as an identifier.") { /* This macro creates the new objects, stores the value `#f' into it and returns it to the caller. */ diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index edc49b7c50..c4d69313c7 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -28,10 +28,7 @@ static Keyword_ent the_key_tab[]={ {"alias", ALIAS}, {"apply", APPLY}, - {"arpeggio", ARPEGGIO }, {"autochange", AUTOCHANGE}, - {"spanrequest", SPANREQUEST}, - {"commandspanrequest", COMMANDSPANREQUEST}, {"simultaneous", SIMULTANEOUS}, {"sequential", SEQUENTIAL}, {"accepts", ACCEPTS}, @@ -52,7 +49,6 @@ static Keyword_ent the_key_tab[]={ {"grobdescriptions", GROBDESCRIPTIONS}, {"figures",FIGURES}, {"grace", GRACE}, - {"glissando", GLISSANDO}, {"header", HEADER}, {"in", IN_T}, {"lyrics", LYRICS}, @@ -74,7 +70,6 @@ static Keyword_ent the_key_tab[]={ {"revert", REVERT}, {"partial", PARTIAL}, {"paper", PAPER}, - {"penalty", PENALTY}, {"property", PROPERTY}, {"pt", PT_T}, {"relative", RELATIVE}, @@ -83,7 +78,6 @@ static Keyword_ent the_key_tab[]={ {"addlyrics", ADDLYRICS}, {"partcombine", PARTCOMBINE}, {"score", SCORE}, - {"script", SCRIPT}, {"skip", SKIP}, {"tempo", TEMPO}, {"translator", TRANSLATOR}, diff --git a/lily/parser.yy b/lily/parser.yy index 2492b91be2..520bb9000f 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -93,16 +93,6 @@ set_property_music (SCM sym, SCM value) return p; } -Music* -make_span_req (SCM name) -{ - static SCM proc; - if (!proc) - proc = scm_c_eval_string ("old-span-event->event"); - SCM m = scm_call_1 (proc, name); - scm_gc_protect_object (m); - return unsmob_music (m); -} // needed for bison.simple's malloc () and free () @@ -135,7 +125,6 @@ of the parse stack onto the heap. */ String *string; // needed by the lexer as temporary scratch area. Music *music; Score *score; - Scheme_hash_table *scmhash; Music_output_def * outputdef; SCM scm; int i; @@ -162,7 +151,6 @@ yylex (YYSTYPE *s, void * v) %token AUTOCHANGE %token ALIAS %token APPLY -%token ARPEGGIO %token ACCEPTS %token ALTERNATIVE %token BAR @@ -179,11 +167,9 @@ yylex (YYSTYPE *s, void * v) %token SIMULTANEOUS %token CONSISTSEND %token DENIES -%token DURATION %token EXTENDER %token FIGURES FIGURE_OPEN FIGURE_CLOSE %token FIGURE_BRACKET_CLOSE FIGURE_BRACKET_OPEN -%token GLISSANDO %token GRACE %token HEADER %token HYPHEN @@ -203,7 +189,6 @@ yylex (YYSTYPE *s, void * v) %token ONCE %token PAPER %token PARTIAL -%token PENALTY %token PROPERTY %token OVERRIDE SET REVERT %token PT_T @@ -214,10 +199,8 @@ yylex (YYSTYPE *s, void * v) %token PARTCOMBINE %token SCM_T %token SCORE -%token SCRIPT %token SKIP %token SPANREQUEST -%token STYLESHEET %token COMMANDSPANREQUEST %token TEMPO %token OUTPUTPROPERTY @@ -252,7 +235,6 @@ yylex (YYSTYPE *s, void * v) %token SCORE_IDENTIFIER %token MUSIC_OUTPUT_DEF_IDENTIFIER - %token NUMBER_IDENTIFIER %token EVENT_IDENTIFIER %token MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER @@ -1295,13 +1277,7 @@ shorthand_command_req: ; verbose_command_req: - COMMANDSPANREQUEST bare_int STRING { - Music *sp = make_span_req ($3); - sp->set_mus_property ("span-direction", gh_int2scm (Direction ($2))); - sp->set_spot (THIS->here_input ()); - $$ = sp; - } - | MARK DEFAULT { + MARK DEFAULT { Music * m = MY_MAKE_MUSIC("MarkEvent"); $$ = m; } @@ -1310,16 +1286,6 @@ verbose_command_req: m->set_mus_property ("label", $2); $$ = m; } - | PENALTY SCM_T { - Music * b = MY_MAKE_MUSIC("BreakEvent"); - SCM s = $2; - if (!gh_number_p (s)) - s = gh_int2scm (0); - - b->set_mus_property ("penalty", s); - b->set_spot (THIS->here_input ()); - $$ = b; - } | SKIP duration_length { Music * skip = MY_MAKE_MUSIC("SkipEvent"); skip->set_mus_property ("duration", $2); @@ -1359,7 +1325,6 @@ post_event: | string_event ; - string_event: E_UNSIGNED { Music * s = MY_MAKE_MUSIC("StringNumberEvent"); @@ -1396,38 +1361,12 @@ verbose_event: EVENT_IDENTIFIER { $$ = unsmob_music ($1); } - | SPANREQUEST bare_int STRING { - Music * sp = make_span_req ($3); - sp->set_mus_property ("span-direction", gh_int2scm ( $2)); - sp->set_spot (THIS->here_input ()); - $$ = sp; - } | tremolo_type { Music * a = MY_MAKE_MUSIC("TremoloEvent"); a->set_spot (THIS->here_input ()); a->set_mus_property ("tremolo-type", gh_int2scm ($1)); $$ = a; } - | SCRIPT STRING { - Music * a = MY_MAKE_MUSIC("ArticulationEvent"); - a->set_mus_property ("articulation-type", $2); - a->set_spot (THIS->here_input ()); - $$ = a; - } - - /* - duh, junk this syntax from the parser, if possible. - */ - | ARPEGGIO { - Music *a = MY_MAKE_MUSIC("ArpeggioEvent"); - a->set_spot (THIS->here_input ()); - $$ = a; - } - | GLISSANDO { - Music *g = MY_MAKE_MUSIC("GlissandoEvent"); - g->set_spot /* No pun intended */ (THIS->here_input ()); - $$ = g; - } ; sup_quotes: @@ -2165,6 +2104,7 @@ which is entirely legitimate. Or we can scrap it. Barchecks should detect wrong durations, and skipTypesetting speeds it up a lot. */ + void My_lily_parser::beam_check (SCM dur) { diff --git a/ly/accordion-defs-init.ly b/ly/accordion-defs-init.ly index 5e3453809e..175f0492be 100644 --- a/ly/accordion-defs-init.ly +++ b/ly/accordion-defs-init.ly @@ -1,4 +1,4 @@ -\version "1.5.68" +\version "1.7.2" % Symbols needed to print accordion music % % 2' = T @@ -7,50 +7,50 @@ % 16' = S % -accDiscant = \script "accDiscant" -accDiscantF = \script "accDiscantF" -accDiscantE = \script "accDiscantE" -accDiscantEh = \script "accDiscantEh" -accDiscantFE = \script "accDiscantFE" -accDiscantFEh = \script "accDiscantFEh" -accDiscantEE = \script "accDiscantEE" -accDiscantFEE = \script "accDiscantFEE" -accDiscantEEE = \script "accDiscantEEE" -accDiscantFEEE = \script "accDiscantFEEE" -accDiscantS = \script "accDiscantS" -accDiscantFS = \script "accDiscantFS" -accDiscantES = \script "accDiscantES" -accDiscantEhS = \script "accDiscantEhS" -accDiscantFES = \script "accDiscantFES" -accDiscantFEhS = \script "accDiscantFEhS" -accDiscantEES = \script "accDiscantEES" -accDiscantFEES = \script "accDiscantFEES" -accDiscantEEES = \script "accDiscantEEES" -accDiscantFEEES = \script "accDiscantFEEES" -accDiscantSS = \script "accDiscantSS" -accDiscantESS = \script "accDiscantESS" -accDiscantEESS = \script "accDiscantEESS" -accDiscantEEESS = \script "accDiscantEEESS" +accDiscant = #(make-articulation "accDiscant") +accDiscantF = #(make-articulation "accDiscantF") +accDiscantE = #(make-articulation "accDiscantE") +accDiscantEh = #(make-articulation "accDiscantEh") +accDiscantFE = #(make-articulation "accDiscantFE") +accDiscantFEh = #(make-articulation "accDiscantFEh") +accDiscantEE = #(make-articulation "accDiscantEE") +accDiscantFEE = #(make-articulation "accDiscantFEE") +accDiscantEEE = #(make-articulation "accDiscantEEE") +accDiscantFEEE = #(make-articulation "accDiscantFEEE") +accDiscantS = #(make-articulation "accDiscantS") +accDiscantFS = #(make-articulation "accDiscantFS") +accDiscantES = #(make-articulation "accDiscantES") +accDiscantEhS = #(make-articulation "accDiscantEhS") +accDiscantFES = #(make-articulation "accDiscantFES") +accDiscantFEhS = #(make-articulation "accDiscantFEhS") +accDiscantEES = #(make-articulation "accDiscantEES") +accDiscantFEES = #(make-articulation "accDiscantFEES") +accDiscantEEES = #(make-articulation "accDiscantEEES") +accDiscantFEEES = #(make-articulation "accDiscantFEEES") +accDiscantSS = #(make-articulation "accDiscantSS") +accDiscantESS = #(make-articulation "accDiscantESS") +accDiscantEESS = #(make-articulation "accDiscantEESS") +accDiscantEEESS = #(make-articulation "accDiscantEEESS") -accFreebase = \script "accFreebase" -accFreebaseF = \script "accFreebaseF" -accFreebaseE = \script "accFreebaseE" -accFreebaseFE = \script "accFreebaseFE" +accFreebase = #(make-articulation "accFreebase") +accFreebaseF = #(make-articulation "accFreebaseF") +accFreebaseE = #(make-articulation "accFreebaseE") +accFreebaseFE = #(make-articulation "accFreebaseFE") -accBayanbase = \script "accBayanbase" -accBayanbaseT = \script "accBayanbaseT" -accBayanbaseE = \script "accBayanbaseE" -accBayanbaseTE = \script "accBayanbaseTE" -accBayanbaseEE = \script "accBayanbaseEE" -accBayanbaseTEE = \script "accBayanbaseTEE" +accBayanbase = #(make-articulation "accBayanbase") +accBayanbaseT = #(make-articulation "accBayanbaseT") +accBayanbaseE = #(make-articulation "accBayanbaseE") +accBayanbaseTE = #(make-articulation "accBayanbaseTE") +accBayanbaseEE = #(make-articulation "accBayanbaseEE") +accBayanbaseTEE = #(make-articulation "accBayanbaseTEE") -accStdbase = \script "accStdbase" -accStdbaseFE = \script "accStdbaseFE" -accStdbaseTFE = \script "accStdbaseTFE" -accStdbaseMES = \script "accStdbaseMES" -accStdbaseTFMES = \script "accStdbaseTFMES" +accStdbase = #(make-articulation "accStdbase") +accStdbaseFE = #(make-articulation "accStdbaseFE") +accStdbaseTFE = #(make-articulation "accStdbaseTFE") +accStdbaseMES = #(make-articulation "accStdbaseMES") +accStdbaseTFMES = #(make-articulation "accStdbaseTFMES") -accSB = \script "accSB" -accBB = \script "accBB" -accOldEE = \script "accOldEE" -accOldEES = \script "accOldEES" +accSB = #(make-articulation "accSB") +accBB = #(make-articulation "accBB") +accOldEE = #(make-articulation "accOldEE") +accOldEES = #(make-articulation "accOldEES") diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 516326f80c..40c01f5d0b 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -18,9 +18,10 @@ stop = 1 smaller = -1 bigger = 1 center=0 + +break = #(make-event-chord (list (make-penalty-music -10001))) +noBreak = #(make-event-chord (list (make-penalty-music 10001))) -break = \penalty #-10000 -noBreak = \penalty #10001 \include "scale-definitions-init.ly" melisma = \property Staff.melismaBusy = ##t diff --git a/ly/property-init.ly b/ly/property-init.ly index 003d54f2de..d3a8767fca 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -72,7 +72,8 @@ cadenzaOff = { \property Timing.measurePosition = #(make-moment 0 1) } -newpage = { +newpage = \notes +{ \break % urg, only works for TeX output \context Score \outputproperty #(make-type-checker 'paper-column-interface) @@ -237,3 +238,5 @@ turnOff = #'() % cross-staff brackets are desired. arpeggioBracket = #(lambda (grob) (Arpeggio::brew_chord_bracket grob)) +arpeggio = #(make-music-by-name 'ArpeggioEvent) +glissando = #(make-music-by-name 'GlissandoEvent) diff --git a/ly/script-init.ly b/ly/script-init.ly index f4d95f51cd..c2c0e42188 100644 --- a/ly/script-init.ly +++ b/ly/script-init.ly @@ -1,4 +1,4 @@ -\version "1.5.68" +\version "1.7.2" dashHat= "marcato" @@ -9,36 +9,37 @@ dashLarger= "accent" dashDot= "staccato" dashUnderscore = "portato" -thumb = \script "thumb" -accent = \script "accent" -marcato = \script "marcato" -staccatissimo = \script "staccatissimo" -portato = \script "portato" -fermata = \script "fermata" -stopped = \script "stopped" -staccato = \script "staccato" -tenuto = \script "tenuto" -upbow = \script "upbow" -downbow = \script "downbow" -lheel = \script "lheel" -rheel = \script "rheel" -ltoe = \script "ltoe" -rtoe = \script "rtoe" -turn = \script "turn" -open = \script "open" -flageolet = \script "flageolet" -reverseturn = \script "reverseturn" -trill = \script "trill" -prall = \script "prall" -mordent = \script "mordent" -upmordent = \script "upmordent" -downmordent = \script "downmordent" -prallprall = \script "prallprall" -prallup = \script "prallup" -pralldown = \script "pralldown" -lineprall = \script "lineprall" -prallmordent = \script "prallmordent" -upprall = \script "upprall" -downprall = \script "downprall" -segno = \script "segno" -coda = \script "coda" + +thumb = #(make-articulation "thumb") +accent = #(make-articulation "accent") +marcato = #(make-articulation "marcato") +staccatissimo = #(make-articulation "staccatissimo") +portato = #(make-articulation "portato") +fermata = #(make-articulation "fermata") +stopped = #(make-articulation "stopped") +staccato = #(make-articulation "staccato") +tenuto = #(make-articulation "tenuto") +upbow = #(make-articulation "upbow") +downbow = #(make-articulation "downbow") +lheel = #(make-articulation "lheel") +rheel = #(make-articulation "rheel") +ltoe = #(make-articulation "ltoe") +rtoe = #(make-articulation "rtoe") +turn = #(make-articulation "turn") +open = #(make-articulation "open") +flageolet = #(make-articulation "flageolet") +reverseturn = #(make-articulation "reverseturn") +trill = #(make-articulation "trill") +prall = #(make-articulation "prall") +mordent = #(make-articulation "mordent") +upmordent = #(make-articulation "upmordent") +downmordent = #(make-articulation "downmordent") +prallprall = #(make-articulation "prallprall") +prallup = #(make-articulation "prallup") +pralldown = #(make-articulation "pralldown") +lineprall = #(make-articulation "lineprall") +prallmordent = #(make-articulation "prallmordent") +upprall = #(make-articulation "upprall") +downprall = #(make-articulation "downprall") +segno = #(make-articulation "segno") +coda = #(make-articulation "coda") diff --git a/ly/spanners-init.ly b/ly/spanners-init.ly index bfccd05cab..952e67f620 100644 --- a/ly/spanners-init.ly +++ b/ly/spanners-init.ly @@ -1,23 +1,26 @@ -\version "1.5.68" +\version "1.7.2" -#(define (make-span-request type spandir) +#(define (make-span-event type spandir) (let* ((m (make-music-by-name type))) (ly-set-mus-property! m 'span-direction spandir) m )) -groupOpen = #(make-span-request 'NoteGroupingEvent START) -groupClose = #(make-span-request 'NoteGroupingEvent STOP) +groupOpen = #(make-span-event 'NoteGroupingEvent START) +groupClose = #(make-span-event 'NoteGroupingEvent STOP) -cr = #(make-span-request 'CrescendoEvent START) -rc = #(make-span-request 'CrescendoEvent STOP) -decr = #(make-span-request 'DecrescendoEvent START) -rced = #(make-span-request 'DecrescendoEvent STOP) +cr = #(make-span-event 'CrescendoEvent START) +rc = #(make-span-event 'CrescendoEvent STOP) +decr = #(make-span-event 'DecrescendoEvent START) +rced = #(make-span-event 'DecrescendoEvent STOP) + +startTextSpan = #(make-span-event 'TextSpanEvent START) +stopTextSpan = #(make-span-event 'TextSpanEvent STOP) cresc = \notes { - \commandspanrequest \start "crescendo" + #(ly-export (make-event-chord (list cr))) \property Voice.crescendoText = #'((font-shape . italic) "cresc.") \property Voice.crescendoSpanner = #'dashed-line } @@ -25,39 +28,39 @@ cresc = \notes { % ah, this is handy: maybe drop resetting of properties in % dynamic-engraver ? endcresc = \notes { - \commandspanrequest \stop "crescendo" + #(ly-export (make-event-chord (list rc))) \property Voice.crescendoText \unset \property Voice.crescendoSpanner \unset } dim = \notes { - \commandspanrequest \start "decrescendo" + #(ly-export (make-event-chord (list decr))) + \property Voice.decrescendoText = #"dim." \property Voice.decrescendoSpanner = #'dashed-line } enddim = \notes { - \commandspanrequest \stop "decrescendo" + #(ly-export (make-event-chord (list rced))) \property Voice.decrescendoText \unset \property Voice.decrescendoSpanner \unset } %{ -cresc = \spanrequest \start "crescendo" -endcresc = \spanrequest \stop "crescendo" +cresc = \spanevent \start "crescendo" +endcresc = \spanevent \stop "crescendo" %} % better name sustainstart/stop? -sustainDown = \spanrequest \start "Sustain" -sustainUp = \spanrequest \stop "Sustain" +sustainUp = #(make-span-event 'SustainPedalEvent STOP) -unaCorda = \spanrequest \start "UnaCorda" -treCorde = \spanrequest \stop "UnaCorda" +unaCorda = #(make-span-event 'UnaCordaEvent START) +treCorde = #(make-span-event 'UnaCordaEvent STOP) -sostenutoDown = \spanrequest \start "Sostenuto" -sostenutoUp = \spanrequest \stop "Sostenuto" +sostenutoDown = #(make-span-event 'SostenutoEvent START) +sostenutoUp = #(make-span-event 'SostenutoEvent STOP) %crescpoco = \property Voice.crescendoText = "cresc. poco a poco" %decresc = \property Voice.crescendoText = "decr." diff --git a/scm/music-functions.scm b/scm/music-functions.scm index eb536e3750..8fc904aebc 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -234,6 +234,21 @@ this is not an override )) )) +(define-public (make-penalty-music pen) + (let + ((m (make-music-by-name 'BreakEvent))) + (ly-set-mus-property! m 'penalty pen) + m)) + +(define-public (make-articulation name) + (let* ( + (m (make-music-by-name 'ArticulationEvent)) + ) + (ly-set-mus-property! m 'articulation-type name) + m + )) + + (define-public (set-mus-properties! m alist) "Set all of ALIST as properties of M." (if (pair? alist) diff --git a/scm/music-types.scm b/scm/music-types.scm index f2182207ee..b56fb33069 100644 --- a/scm/music-types.scm +++ b/scm/music-types.scm @@ -558,27 +558,6 @@ )) -(define-public (old-span-event->event name) - (let - ( - (entry (assoc - name - '( - ("text" . TextSpanEvent) - ("decrescendo" . DecrescendoEvent) - ("crescendo" . CrescendoEvent) - ("Sustain" . SustainPedalEvent) - ("slur" . SlurEvent) - ("UnaCorda" . UnaCordaEvent) - ("Sostenuto" . SostenutoEvent) - ))) - ) - (if (eq? entry #f) - (error (format "Could not find span type ~a" name)) - - (make-music-by-name (cdr entry)) - ) - )) (define-public (make-repeated-music name) (let* diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 25bb3e215b..89552fc3bb 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -987,6 +987,49 @@ if 1: conversions.append (((1,7,1), conv, 'ly-make-music foo_bar_req -> make-music-by-name FooBarEvent')) + +if 1: + spanner_subst ={ + "text" : 'TextSpanEvent', + "decrescendo" : 'DecrescendoEvent', + "crescendo" : 'CrescendoEvent', + "Sustain" : 'SustainPedalEvent', + "slur" : 'SlurEvent', + "UnaCorda" : 'UnaCordaEvent', + "Sostenuto" : 'SostenutoEvent', + } + def subst_ev_name (match): + stype = 'STOP' + if re.search ('start', match.group(1)): + stype= 'START' + + mtype = spanner_subst[match.group(2)] + return "(make-span-event '%s %s)" % (mtype , stype) + + def subst_definition_ev_name(match): + return ' = #%s' % subst_ev_name (match) + def subst_inline_ev_name (match): + s = subst_ev_name (match) + return '#(ly-export %s)' % s + def subst_csp_definition (match): + return ' = #(make-event-chord (list %s))' % subst_ev_name (match) + def subst_csp_inline (match): + return '#(ly-export (make-event-chord (list %s)))' % subst_ev_name (match) + + def conv (str): + str = re.sub (r' *= *\\spanrequest *([^ ]+) *"([^"]+)"', subst_definition_ev_name, str) + str = re.sub (r'\\spanrequest *([^ ]+) *"([^"]+)"', subst_inline_ev_name, str) + str = re.sub (r' *= *\\commandspanrequest *([^ ]+) *"([^"]+)"', subst_csp_definition, str) + str = re.sub (r'\\commandspanrequest *([^ ]+) *"([^"]+)"', subst_csp_inline, str) + str = re.sub (r'ly-id ', 'ly-import ', str) + + str = re.sub (r' *= *\\script "([^"]+)"', ' = #(make-articulation "\\1")', str) + str = re.sub (r'\\script "([^"]+)"', '#(ly-export (make-articulation "\\1"))', str) + return str + + conversions.append (((1,7,2), conv, '\\spanrequest -> #(make-span-event .. ), \script -> #(make-articulation .. )')) + + ################################ # END OF CONVERSIONS ################################ -- 2.39.2