Thomas Morley <thomasmorle...@gmail.com> writes: > Nevertheless here some coding, returning at least a little tracking info. > Though, it's a crude coding and expensive, use at own risk ;) > > \version "2.19.64" > > remark = > #(define-music-function (strg)(string?) > #{ > \withMusicProperty #'remark #strg <> > #}) > > %% writes remarks to <your-file-name>-remarks.txt > writeRemark = > #(define-void-function (mus)(ly:music?) > (music-map > (lambda (m) > (if (and (music-is-of-type? m 'event-chord) > (ly:music-property m 'remark #f)) > (let* ((log-file > (format #f "~a-remarks.txt" (ly:parser-output-name))) > (port (open-file log-file "a")) > (origin (ly:music-property m 'origin))) > (format #t "\nRemark from ~a written to: ~a" origin log-file) > (format port "\n~a:\t~a" origin (ly:music-property m 'remark)) > (close port) > m) > m)) > mus) > mus) > > \writeRemark > { > \remark text > c4 d e f > \remark more-text > g a b c > \remark "further text: pitch is d, length 4" > d e f g > }
A few comments: it seems overkill to produce an actual music expression here when the purpose is to correlate input position with remarks. While it has the advantage of only writing out expressions put into \writeRemark, there cannot be any location different from the current input location anyway. And that's available as (*location*) in a scheme function already and passing it through a music expression will just lead to duplicates or omissions (depending on how often the music expression is placed in a \writeRemark). -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user