+2005-07-22 Nicolas Sceaux <nicolas.sceaux@free.fr>
+
+ * scm/display-lily.scm: new file. Define a `display-lily-music'
+ function, that displays the music expression given as an argument,
+ using LilyPond notation.
+
+ * scm/define-music-display-methods.scm: new file. Implementation
+ of display methods for each music type.
+
+ * ly/music-functions-init.ly (displayLilyMusic): new function for
+ displaying music with LilyPond notation.
+
+ * input/regression/display-lily-tests.ly: new regression test file
+ for `display-lily-music'.
+
+ * scm/markup.scm: remove obsolete debugging code (for printing
+ markups with LilyPond notation).
+
+ * scm/define-music-types.scm (music-name-to-property-table):
+ * scm/clef.scm (supported-clefs): export, in order to be accessible
+ from the (scm display-lily) module.
+
2005-07-22 Jan Nieuwenhuizen <janneke@gnu.org>
* Documentation/topdocs/NEWS.tely (Top): Typo.
#(def-music-function (parser location music) (ly:music?)
(display-scheme-music music)
music)
+
+#(use-modules (scm display-lily))
+displayLilyMusic =
+#(def-music-function (parser location music) (ly:music?)
+ (display-lily-init parser)
+ (display-lily-music music)
+ music)
+
applyoutput =
#(def-music-function (parser location proc) (procedure?)
(make-music 'ApplyOutputEvent
(values (cons 'list (compile-all-markup-args (car expr))) (cdr expr)))
(else (values (car expr) (cdr expr)))))
-;;;;;;;;;;;;;;;
-;;; Debugging utilities: print markup expressions in a friendly fashion
-
-(use-modules (ice-9 format))
-(define (markup->string markup-expr)
- "Return a string describing, in LilyPond syntax, the given markup expression."
- (define (proc->command proc)
- (let ((cmd-markup (symbol->string (procedure-name proc))))
- (substring cmd-markup 0 (- (string-length cmd-markup)
- (string-length "-markup")))))
- (define (arg->string arg)
- (cond ((and (pair? arg) (pair? (car arg))) ;; markup list
- (format #f "~{ ~a~}" (map markup->string arg)))
- ((pair? arg) ;; markup
- (markup->string arg))
- ((string? arg) ;; scheme string argument
- (format #f "#\"~a\"" arg))
- (else ;; other scheme arg
- (format #f "#~a" arg))))
- (let ((cmd (car markup-expr))
- (args (cdr markup-expr)))
- (cond ((eqv? cmd simple-markup) ;; a simple string
- (format #f "\"~a\"" (car args)))
- ((eqv? cmd line-markup) ;; { ... }
- (format #f "{~a}" (arg->string (car args))))
- ((eqv? cmd center-align-markup) ;; \center < ... >
- (format #f "\\center-align <~a>" (arg->string (car args))))
- ((eqv? cmd column-markup) ;; \column < ... >
- (format #f "\\column <~a>" (arg->string (car args))))
- (else ;; \command ...
- (format #f "\\~a~{ ~a~} " (proc->command cmd) (map arg->string args))))))
-
-(define-public (display-markup markup-expr)
- "Print a LilyPond-syntax equivalent for the given markup expression."
- (display "\\markup ")
- (display (markup->string markup-expr)))
-
;;;;;;;;;;;;;;;
;;; Utilities for storing and accessing markup commands signature
;;; and keyword.