\version "2.17.21" % Uncomment the following line to show the skylines. %#(ly:set-option 'debug-skylines) \paper { indent = #0 } % Note: In order to prevent "bleed-over" from one session to another, it is % recommended that .ly files using the following functions be processed % individually (rather than in a batch). %%%%%%%%%%%%%%%%%%%%%%%%%%% CREATE NEW EVENT CLASSES %%%%%%%%%%%%%%%%%%%%%%%%%%% #(define my-event-classes (ly:make-context-mod)) defineEventClass = #(define-void-function (parser location class parent) (symbol? symbol?) (ly:add-context-mod my-event-classes `(apply ,(lambda (context class parent) (ly:context-set-property! context 'EventClasses (event-class-cons class parent (ly:context-property context 'EventClasses '())))) ,class ,parent))) \defineEventClass #'frame-event #'span-event \defineEventClass #'frame-extender-event #'span-event %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MUSIC DESCRIPTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #(define frame-types '( (FrameEvent . ((description . "Signals where a frame starts and stops.") (types . (general-music frame-event span-event event)) )) )) #(set! frame-types (map (lambda (x) (set-object-property! (car x) 'music-description (cdr (assq 'description (cdr x)))) (let ((lst (cdr x))) (set! lst (assoc-set! lst 'name (car x))) (set! lst (assq-remove! lst 'description)) (hashq-set! music-name-to-property-table (car x) lst) (cons (car x) lst))) frame-types)) #(define frame-extender-types '( (FrameExtenderEvent . ((description . "Signals where a frame extender line stops.") (types . (general-music frame-extender-event span-event event)) )) )) #(set! frame-extender-types (map (lambda (x) (set-object-property! (car x) 'music-description (cdr (assq 'description (cdr x)))) (let ((lst (cdr x))) (set! lst (assoc-set! lst 'name (car x))) (set! lst (assq-remove! lst 'description)) (hashq-set! music-name-to-property-table (car x) lst) (cons (car x) lst))) frame-extender-types)) #(set! music-descriptions (append frame-types music-descriptions)) #(set! music-descriptions (sort music-descriptions alist= (length siblings) 2) (eq? grob (first siblings))) (< (length siblings) 2)) (set! stil (ly:stencil-combine-at-edge stil X LEFT protrusion (- blot)))) ;; Right edge: (if (or (and (>= (length siblings) 2) (eq? grob (last siblings))) (< (length siblings) 2)) (set! stil (ly:stencil-combine-at-edge stil X RIGHT protrusion (- blot)))) ;; Text is only added to the first piece of a broken bracket. Possibly ;; the text should be added in parentheses to the pieces (as in a measure ;; count). 0.5 is a hardcoded padding value which controls the separation ;; between the text and the bracket. (if (or (and (>= (length siblings) 2) (eq? grob (first siblings))) (< (length siblings) 2)) (set! stil (ly:stencil-combine-at-edge stil Y UP text (* 0.5 staff-space)))) stil)) %%%%%%%%%%%%%%%%%%%%%%%%% ADD NEW GROB DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%% #(define my-grob-descriptions '()) #(define (add-grob-definition grob-name grob-entry) (let* ((meta-entry (assoc-get 'meta grob-entry)) (class (assoc-get 'class meta-entry)) (ifaces-entry (assoc-get 'interfaces meta-entry))) (set-object-property! grob-name 'translation-type? list?) (set-object-property! grob-name 'is-grob? #t) (set! ifaces-entry (append (case class ((Item) '(item-interface)) ((Spanner) '(spanner-interface)) ((Paper_column) '((item-interface paper-column-interface))) ((System) '((system-interface spanner-interface))) (else '(unknown-interface))) ifaces-entry)) (set! ifaces-entry (uniq-list (sort ifaces-entry symbol> \layout { %ragged-right = ##t \context { \Global \grobdescriptions #my-grob-descriptions #my-event-classes } \context { \Score \remove "Bar_number_engraver" proportionalNotationDuration = #(ly:make-moment 1 4) \override SpacingSpanner #'uniform-stretching = ##t } \context { \Staff \remove "Time_signature_engraver" } \context { \Voice %\override Beam.stencil = ##f %\override Stem.stencil = #point-stencil \consists \frameEngraver } }