-noPageTurn =
-#(define-music-function (location parser) ()
- (_i "Forbid a page turn. May be used at toplevel (ie between scores or
-markups), or inside a score.")
- (make-music 'EventChord
- 'page-marker #t
- 'page-turn-permission 'forbid
- 'elements (list (make-music 'PageTurnEvent
- 'break-permission '()))))
-
-allowPageTurn =
-#(define-music-function (location parser) ()
- (_i "Allow a page turn. May be used at toplevel (ie between scores or
-markups), or inside a score.")
- (make-music 'EventChord
- 'page-marker #t
- 'page-turn-permission 'allow
- 'elements (list (make-music 'PageTurnEvent
- 'break-permission 'allow))))
-
-%% Todo:
-%% doing
-%% define-music-function in a .scm causes crash.
-
-octave =
-#(define-music-function (parser location pitch-note) (ly:music?)
- (_i "octave check")
-
- (make-music 'RelativeOctaveCheck
- 'origin location
- 'pitch (pitch-of-note pitch-note)
- ))
-partcombine =
-#(define-music-function (parser location part1 part2) (ly:music? ly:music?)
- (make-part-combine-music parser
- (list part1 part2)))
-
-
-pitchedTrill =
-#(define-music-function
- (parser location main-note secondary-note)
- (ly:music? ly:music?)
- (let*
- ((get-notes (lambda (ev-chord)
- (filter
- (lambda (m) (eq? 'NoteEvent (ly:music-property m 'name)))
- (ly:music-property ev-chord 'elements))))
- (sec-note-events (get-notes secondary-note))
- (trill-events (filter (lambda (m) (music-has-type m 'trill-span-event))
- (ly:music-property main-note 'elements))))
-
- (if (pair? sec-note-events)
- (begin
- (let*
- ((trill-pitch (ly:music-property (car sec-note-events) 'pitch))
- (forced (ly:music-property (car sec-note-events ) 'force-accidental)))
-
- (if (ly:pitch? trill-pitch)
- (for-each (lambda (m) (ly:music-set-property! m 'pitch trill-pitch))
- trill-events)
- (begin
- (ly:warning (_ "Second argument of \\pitchedTrill should be single note: "))
- (display sec-note-events)))
-
- (if (eq? forced #t)
- (for-each (lambda (m) (ly:music-set-property! m 'force-accidental forced))
- trill-events)))))
- main-note))
-
-
-
-%% for lambda*
-#(use-modules (ice-9 optargs))
-