From 02867dc97801a6f72ee11e70eb7a03a8ba3d0b44 Mon Sep 17 00:00:00 2001 From: Nicolas Sceaux Date: Sun, 24 Jul 2005 12:49:14 +0000 Subject: [PATCH] * Documentation/topdocs/NEWS.tely: new item for \displayLilyMusic * scm/define-music-display-methods.scm (markup->lily-string): markup elements can also be strings (without simple-markup appended) --- ChangeLog | 8 ++++++++ Documentation/topdocs/NEWS.tely | 12 ++++++++++++ scm/define-music-display-methods.scm | 17 ++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ef49c9f3f..839dd0d793 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-07-24 Nicolas Sceaux + + * Documentation/topdocs/NEWS.tely: new item for \displayLilyMusic + + * scm/define-music-display-methods.scm (markup->lily-string): + markup elements can also be strings (without simple-markup + appended) + 2005-07-24 Han-Wen Nienhuys * lily/context.cc (where_defined): also assign value in diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index 4cde1d03ae..12cfec7940 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -32,6 +32,18 @@ See user manual, \NAME\ @itemize @bullet + +@item +Music expressions can be displayed, in LilyPond notation, using the +new @code{\displayLilyMusic} function. For instance: +@verbatim +\displayLilyMusic \transpose c a, { c d e f } +@end verbatim +will print: +@verbatim +{ a, b, cis d } +@end verbatim + @item The current bar number may be checked with @code{\barNumberCheck}, eg. diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index 7dba2143dd..ea49d53613 100644 --- a/scm/define-music-display-methods.scm +++ b/scm/define-music-display-methods.scm @@ -60,13 +60,15 @@ (else ;; a scheme argument (format #f "#~a" (scheme-expr->lily-string arg))))) (define (markup->lily-string-aux expr) - (let ((cmd (car expr)) - (args (cdr expr))) - (if (eqv? cmd simple-markup) ;; a simple string - (format #f "~s" (car args)) - (format #f "\\~a~{ ~a~}" - (proc->command cmd) - (map-in-order arg->string args))))) + (if (string? expr) + (format #f "~s" expr) + (let ((cmd (car expr)) + (args (cdr expr))) + (if (eqv? cmd simple-markup) ;; a simple markup + (format #f "~s" (car args)) + (format #f "\\~a~{ ~a~}" + (proc->command cmd) + (map-in-order arg->string args)))))) (cond ((string? markup-expr) (format #f "~s" markup-expr)) ((eqv? (car markup-expr) simple-markup) @@ -74,6 +76,7 @@ (else (format #f "\\markup ~a" (markup->lily-string-aux markup-expr))))) + ;;; ;;; pitch names ;;; -- 2.39.5