{"name", NAME},
{"new", NEWCONTEXT},
{"notemode", NOTEMODE},
- {"once", ONCE},
{"override", OVERRIDE},
{"paper", PAPER},
{"remove", REMOVE},
%token MIDI "\\midi"
%token NAME "\\name"
%token NOTEMODE "\\notemode"
-%token ONCE "\\once"
%token OVERRIDE "\\override"
%token PAPER "\\paper"
%token REMOVE "\\remove"
music_property_def:
simple_music_property_def {
- $$ = LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant ("property-operation"), scm_cons (PARSER->self_scm (), scm_cons2 (make_input (@$), SCM_BOOL_F, $1)));
- }
- | ONCE simple_music_property_def {
- $$ = LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant ("property-operation"), scm_cons (PARSER->self_scm (), scm_cons2 (make_input (@$), SCM_BOOL_T, $2)));
+ $$ = LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant ("property-operation"), scm_cons2 (PARSER->self_scm (), make_input (@$), $1));
}
;
(make-music 'RelativeOctaveCheck
'pitch pitch))
+once =
+#(define-music-function (parser location music) (ly:music?)
+ (_i "Set @code{once} to @code{#t} on all layout instruction events in @var{music}.")
+ (music-map
+ (lambda (m)
+ (cond ((music-is-of-type? m 'layout-instruction-event)
+ (set! (ly:music-property m 'once) #t))
+ ((ly:duration? (ly:music-property m 'duration))
+ (ly:music-warning m (_ "Cannot apply \\once to timed music"))))
+ m)
+ music))
+
ottava =
#(define-music-function (parser location octave) (integer?)
(_i "Set the octavation.")
(if create-new (set! (ly:music-property csm 'create-new) #t))
csm))
-(define-ly-syntax (property-operation parser location once ctx music-type symbol . args)
+(define-ly-syntax (property-operation parser location ctx music-type symbol . args)
(let* ((props (case music-type
((PropertySet) (list 'value (car args)))
((PropertyUnset) '())
(list 'grob-property-path (car args))
(list 'grob-property-path args)))
(else (ly:error (_ "Invalid property operation ~a") music-type))))
- (oprops (if once (cons* 'once once props) props))
(m (apply make-music music-type
'symbol symbol
'origin location
- oprops)))
+ props)))
(make-music 'ContextSpeccedMusic
'element m
'context-type ctx