]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/display-lily.scm: new file. Define a `display-lily-music'
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Fri, 22 Jul 2005 18:28:35 +0000 (18:28 +0000)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Fri, 22 Jul 2005 18:28:35 +0000 (18:28 +0000)
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.

* 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.

ChangeLog
ly/music-functions-init.ly
scm/clef.scm
scm/define-music-types.scm
scm/markup.scm

index 175d24b267db7a346ad59d8a17d13ed5ae980533..c13e26b40ebe3f0369c69325a1292cc4c2d74e7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+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.
index 2d2b9f112d13784f809ee4b04e744b81dcf3088f..262d9e72b60dae77f2f007cc88873b130d390585 100644 (file)
@@ -47,6 +47,14 @@ displayMusic =
 #(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 
index 68fa718db01d85b9599659c18dd28627950718f4..aeb34db579e7114cd82eb2f7b37e4fe96f3f89ed 100644 (file)
@@ -9,7 +9,7 @@
 ;;
 ;; -- the name clefOctavation is misleading. The value 7 is 1 octave,
 ;; not 7 Octaves.
-(define supported-clefs
+(define-public supported-clefs
   '(("treble" . ("clefs.G" -2 0))
     ("violin" . ("clefs.G" -2 0))
     ("G" . ("clefs.G" -2 0))
index d98cd7b9ad9fcad8c3a7c990fd37f0a6ccc53472..8fa7798a191fff3581fe112360818d3c11eafec1 100644 (file)
@@ -701,7 +701,7 @@ Syntax: @code{\\\\}")
 (set! music-descriptions
       (sort music-descriptions alist<?))
 
-(define music-name-to-property-table (make-vector 59 '()))
+(define-public music-name-to-property-table (make-vector 59 '()))
 
 ;; init hash table,
 ;; transport description to an object property.
index af0d36dc6ea0071c008e1e0ba0d3a3a7feca7d54..dc56901666eddb473654978d0e1ce972d1b85fdc 100644 (file)
@@ -220,43 +220,6 @@ Use `markup*' in a \\notes block."
          (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.