+2002-10-13 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * 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 <rune@zedeler.dk>
* lily/accidental-engraver.cc: Fix
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
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
\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
@end lilypond
-@cindex @code{\script}
@cindex scripts
@cindex superscript
@cindex subscript
@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
-\version "1.6.4"
+\version "1.7.2"
\header {
composer = "ARTHUR GRAY"
% 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
)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]
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)))
(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
}
\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
-\version "1.5.68"
+\version "1.7.2"
%
% TODO: what's this?
%
-\version "1.5.68"
+\version "1.7.2"
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. }
+\version "1.7.2"
\header {
\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
-\version "1.5.68"
+\version "1.7.2"
\header {
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
}
}
-\version "1.5.68"
+\version "1.7.2"
\header {
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 { }
}
}
-
/*
This is a convenient (and legacy) interface to TextSpanners
/* 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. */
static Keyword_ent the_key_tab[]={
{"alias", ALIAS},
{"apply", APPLY},
- {"arpeggio", ARPEGGIO },
{"autochange", AUTOCHANGE},
- {"spanrequest", SPANREQUEST},
- {"commandspanrequest", COMMANDSPANREQUEST},
{"simultaneous", SIMULTANEOUS},
{"sequential", SEQUENTIAL},
{"accepts", ACCEPTS},
{"grobdescriptions", GROBDESCRIPTIONS},
{"figures",FIGURES},
{"grace", GRACE},
- {"glissando", GLISSANDO},
{"header", HEADER},
{"in", IN_T},
{"lyrics", LYRICS},
{"revert", REVERT},
{"partial", PARTIAL},
{"paper", PAPER},
- {"penalty", PENALTY},
{"property", PROPERTY},
{"pt", PT_T},
{"relative", RELATIVE},
{"addlyrics", ADDLYRICS},
{"partcombine", PARTCOMBINE},
{"score", SCORE},
- {"script", SCRIPT},
{"skip", SKIP},
{"tempo", TEMPO},
{"translator", TRANSLATOR},
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 ()
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;
%token AUTOCHANGE
%token ALIAS
%token APPLY
-%token ARPEGGIO
%token ACCEPTS
%token ALTERNATIVE
%token BAR
%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
%token ONCE
%token PAPER
%token PARTIAL
-%token PENALTY
%token PROPERTY
%token OVERRIDE SET REVERT
%token PT_T
%token PARTCOMBINE
%token SCM_T
%token SCORE
-%token SCRIPT
%token SKIP
%token SPANREQUEST
-%token STYLESHEET
%token COMMANDSPANREQUEST
%token TEMPO
%token OUTPUTPROPERTY
%token <scm> SCORE_IDENTIFIER
%token <scm> MUSIC_OUTPUT_DEF_IDENTIFIER
-
%token <scm> NUMBER_IDENTIFIER
%token <scm> EVENT_IDENTIFIER
%token <scm> MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER
;
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;
}
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);
| string_event
;
-
string_event:
E_UNSIGNED {
Music * s = MY_MAKE_MUSIC("StringNumberEvent");
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:
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)
{
-\version "1.5.68"
+\version "1.7.2"
% Symbols needed to print accordion music
%
% 2' = T
% 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")
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
\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)
% 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)
-\version "1.5.68"
+\version "1.7.2"
dashHat= "marcato"
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")
-\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
}
% 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."
))
))
+(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)
))
-(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*
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
################################