{"figures", FIGURES},
{"grobdescriptions", GROBDESCRIPTIONS},
{"header", HEADER},
- {"key", KEY},
{"layout", LAYOUT},
{"lyricmode", LYRICMODE},
{"lyrics", LYRICS},
%token GROBDESCRIPTIONS "\\grobdescriptions"
%token HEADER "\\header"
%token INVALID "\\version-error"
-%token KEY "\\key"
%token LAYOUT "\\layout"
%token LYRICMODE "\\lyricmode"
%token LYRICS "\\lyrics"
| tempo_event {
$$ = $1;
}
- | KEY DEFAULT {
- Music *key = MY_MAKE_MUSIC ("KeyChangeEvent", @$);
- $$ = key->unprotect ();
- }
- | KEY NOTENAME_PITCH SCM_IDENTIFIER {
-
- Music *key = MY_MAKE_MUSIC ("KeyChangeEvent", @$);
- if (scm_ilength ($3) > 0)
- {
- key->set_property ("pitch-alist", $3);
- key->set_property ("tonic", Pitch (0, 0, 0).smobbed_copy ());
- key->transpose (* unsmob_pitch ($2));
- } else {
- PARSER->parser_error (@3, _ ("second argument must be pitch list"));
- }
-
- $$ = key->unprotect ();
- }
;
res)))
music))
+key =
+#(define-music-function (parser location tonic pitch-alist)
+ ((ly:pitch? '()) (list? '()))
+ (_i "Set key to @var{tonic} and scale @var{pitch-alist}.
+If both are null, just generate @code{KeyChangeEvent}.")
+ (cond ((null? tonic) (make-music 'KeyChangeEvent))
+ ((null? pitch-alist)
+ (ly:parser-error parser (_ "second argument must be pitch list")
+ location)
+ (make-music 'SequentialMusic 'void #t))
+ (else
+ (ly:music-transpose
+ (make-music 'KeyChangeEvent
+ 'tonic (ly:make-pitch 0 0 0)
+ 'pitch-alist pitch-alist)
+ tonic))))
+
killCues =
#(define-music-function (parser location music) (ly:music?)
(_i "Remove cue notes from @var{music}.")