On 27 September 2010 20:02, Marc Hohl <m...@hohlart.de> wrote: > harmonicTestOne = #(define-music-function (parser location music) > (ly:music?) > (let* ((test 2) > (result (/ test 2))) > > #{ > \override TabNoteHead #'transparent = ##t > #} > (make-harmonic music) > (display "\nDummy output to check the let-block: ")(display result) > #{ > \revert TabNoteHead #'transparent > #}))
This swallows the music, since the (make-harmonic music) part isn't last in the list: it returns the \revert only. > harmonicTestTwo = #(define-music-function (parser location music) > (ly:music?) > (let* ((test 4) > (result (/ test 2))) > #{ > \override TabNoteHead #'transparent = ##t > > #(begin > (display "\nDummy output to check the let-block: ") > (display result) > (make-harmonic $music)) > \revert TabNoteHead #'transparent > #})) Here the \override and \revert are both included, since the #{ #} block creates a sequential music section. Unfortunately, the (make-harmonic music) part never gets processed by the parser: as a scheme object, it's ignored unless treated like an identifier via `ly:export'. It can't be part of the `begin' in this case. harmonicTestTwo = #(define-music-function (parser location music) (ly:music?) (let* ((test 4) (result (/ test 2))) #{ \override TabNoteHead #'transparent = ##t #(begin (display "\nDummy output to check the let-block: ") (display $result)) #(ly:export (make-harmonic $music)) \revert TabNoteHead #'transparent #})) > harmonicTestThree = #(define-music-function (parser location music) > (ly:music?) > (let* ((test 6) > (result (/ test 2))) > > #{ > \override TabNoteHead #'transparent = ##t > #} > (begin > (display "\nDummy output to check the let-block: ") > (display result) > (make-harmonic music)))) You're on the right track here: now you're actually returning the correct music, but it's also junking the \override, since it's not part of the returned music. If you wrap it in make-sequential-music, both actions will take place in sequence: harmonicTestThree = #(define-music-function (parser location music) (ly:music?) (let* ((test 6) (result (/ test 2))) (make-sequential-music (list #{ \override TabNoteHead #'transparent = ##t #} (begin (display "\nDummy output to check the let-block: ") (display result) (make-harmonic music)))))) I suggest you stay in scheme for this kind of music function rather than switching into lily code (which can't be auto-indented properly). Cheers, Neil _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user