\version "2.19.56" %% Two overrides, attempting to demonstrate/trigger how embedding lily in guile %% and vice versa works. %% Both doing some simple string-operations foo = { \override Score.BarNumber.break-visibility = ##(#t #t #t) \override Score.BarNumber.before-line-breaking = #(lambda (grob) (let ((b-nmbr (string->number (markup->string (ly:grob-property grob 'text))))) (ly:grob-set-property! grob 'self-alignment-X CENTER) (ly:grob-set-property! grob 'text #{ \markup #(if (and (number? b-nmbr) (odd? b-nmbr)) (format #f "guile ~a" (version)) (format #f "lilypond ~a" (lilypond-version))) #}))) } fooII = \override NoteHead.after-line-breaking = #(lambda (grob) (if (positive? (ly:pitch-octave (ly:prob-property (ly:grob-property grob 'cause) 'pitch))) (begin (ly:grob-set-property! grob 'stencil (ly:stencil-aligned-to (grob-interpret-markup grob #{ \markup #(string-concatenate '("名" "字" "-" "♥" "-" "字" "名")) #}) CENTER X)) (ly:grob-set-property! grob 'color red)) (ly:grob-set-property! grob 'color green))) { %% successively uncomment: %\foo %\fooII \repeat unfold 20 { \repeat unfold 4 { c'4 e' g' c'' } \break } }