X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdisplay-lily.scm;h=9536c3dd42b25b626dd0300b8f7f9a9cf31f80a6;hb=2411d0e11c5ca03997122c905bc2e58ea6a8682e;hp=6fc933499df5c0ace9bb92ef2fda02b70d4683d9;hpb=2c3bd5e85d39155e3e6804f9818722bef483056d;p=lilypond.git diff --git a/scm/display-lily.scm b/scm/display-lily.scm index 6fc933499d..9536c3dd42 100644 --- a/scm/display-lily.scm +++ b/scm/display-lily.scm @@ -2,7 +2,7 @@ ;;; ;;; ;;; -;;; Copyright (C) 2005--2011 Nicolas Sceaux +;;; Copyright (C) 2005--2012 Nicolas Sceaux ;;; ;;; - This file defines the procedures used to define display methods for each @@ -79,6 +79,15 @@ display method will be called." (format #f "~a\\tag #'~a" (if post-event? "-" "") tag)) (ly:music-property expr 'tags)))) +(define* (tweaks->lily-string expr #:optional (post-event? #f)) + (format #f "~{~a ~}" + (map (lambda (tweak) + (format #f "~a\\tweak #'~a #~a" + (if post-event? "-" "") + (car tweak) + (scheme-expr->lily-string (cdr tweak)))) + (ly:music-property expr 'tweaks)))) + (define-public (music->lily-string expr parser) "Print @var{expr}, a music expression, in LilyPond syntax." (if (ly:music? expr) @@ -90,8 +99,9 @@ display method will be called." (proc expr parser)) procs)))) (if result-string - (format #f "~a~a" - (tag->lily-string expr (post-event? expr)) + (format #f "~a~a~a" + (tag->lily-string expr (post-event? expr)) + (tweaks->lily-string expr (post-event? expr)) result-string) (format #f "%{ Print method not implemented for music type ~a %}" music-type)))