1 ; lily.scm -- implement Scheme output routines for TeX and PostScript
3 ; source file of the GNU LilyPond music typesetter
5 ; (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
9 ; This file contains various routines in Scheme that are easier to
10 ; do here than in C++. At present it is an unorganised mess. Sorry.
14 ;(debug-enable 'backtrace)
18 (use-modules (ice-9 regex))
20 ;; The regex module may not be available, or may be broken.
21 ;; If you have trouble with regex, define #f
22 ;;(define use-regex #t)
23 ;;(define use-regex #f)
26 (let ((os (string-downcase (vector-ref (uname) 0))))
27 (not (equal? "cygwin" (substring os 0 (min 6 (string-length os)))))))
29 ;; do nothing in .scm output
30 (define (comment s) "")
36 (define (cons-map f x)
37 (cons (f (car x)) (f (cdr x))))
39 (define (reduce operator list)
40 (if (null? (cdr list)) (car list)
41 (operator (car list) (reduce operator (cdr list)))
46 (define (numbers->string l)
47 (apply string-append (map ly-number->string l)))
49 ; (define (chop-decimal x) (if (< (abs x) 0.001) 0.0 x))
51 (define (number->octal-string x)
52 (let* ((n (inexact->exact x))
54 (n8 (quotient (- n (* n64 64)) 8)))
58 (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8)))))
60 (define (inexact->string x radix)
61 (let ((n (inexact->exact x)))
62 (number->string n radix)))
65 (define (control->string c)
66 (string-append (number->string (car c)) " "
67 (number->string (cdr c)) " "))
73 (make-string 1 (integer->char (+ (char->integer #\A) i)))
78 (define (scm-scm action-name)
81 (define security-paranoia #f)
84 ;; See documentation of Item::visibility_lambda_
85 (define (begin-of-line-visible d) (if (= d 1) '(#f . #f) '(#t . #t)))
86 (define (spanbar-begin-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
87 (define (all-visible d) '(#f . #f))
88 (define (all-invisible d) '(#t . #t))
89 (define (begin-of-line-invisible d) (if (= d 1) '(#t . #t) '(#f . #f)))
90 (define (end-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
93 (define mark-visibility end-of-line-invisible)
95 ;; Spacing constants for prefatory matter.
97 ;; rules for this spacing are much more complicated than this. See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147
101 ;; (Measured in staff space)
104 ((none Instrument_name) . (extra-space 1.0))
105 ((Instrument_name Left_edge_item) . (extra-space 1.0))
106 ((Left_edge_item Clef_item) . (extra-space 1.0))
107 ((Left_edge_item Key_item) . (extra-space 0.0))
108 ((none Left_edge_item) . (extra-space 0.0))
109 ((Left_edge_item Staff_bar) . (extra-space 0.0))
110 ; ((none Left_edge_item) . (extra-space -15.0))
111 ; ((none Left_edge_item) . (extra-space -15.0))
112 ((none Clef_item) . (minimum-space 1.0))
113 ((none Staff_bar) . (minimum-space 0.0))
114 ((none Clef_item) . (minimum-space 1.0))
115 ((none Key_item) . (minimum-space 0.5))
116 ((none Time_signature) . (extra-space 0.0))
117 ((none begin-of-note) . (minimum-space 1.5))
118 ((Clef_item Key_item) . (minimum-space 4.0))
119 ((Key_item Time_signature) . (extra-space 1.0))
120 ((Clef_item Time_signature) . (minimum-space 3.5))
121 ((Staff_bar Clef_item) . (minimum-space 1.0))
122 ((Clef_item Staff_bar) . (minimum-space 3.7))
123 ((Time_signature Staff_bar) . (minimum-space 2.0))
124 ((Key_item Staff_bar) . (extra-space 1.0))
125 ((Staff_bar Time_signature) . (minimum-space 1.5)) ;double check this.
126 ((Time_signature begin-of-note) . (extra-space 2.0)) ;double check this.
127 ((Key_item begin-of-note) . (extra-space 2.5))
128 ((Staff_bar begin-of-note) . (extra-space 1.0))
129 ((Clef_item begin-of-note) . (minimum-space 5.0))
130 ((none Breathing_sign) . (minimum-space 0.0))
131 ((Breathing_sign Key_item) . (minimum-space 1.5))
132 ((Breathing_sign begin-of-note) . (minimum-space 1.0))
133 ((Breathing_sign Staff_bar) . (minimum-space 1.5))
134 ((Breathing_sign Clef_item) . (minimum-space 2.0))
138 ;; (define (ly-warn s) (error s))
139 (define (break-align-spacer this next)
140 (let ((entry (assoc (list this next) space-alist)))
143 (begin (ly-warn (string-append "Unknown spacing pair `" this "', `" next "'"))
144 '(minimum-space 0.0)))))
147 (define (find-notehead-symbol duration style)
150 ((harmonic) "0mensural")
152 (string-append (number->string duration)
153 (if (< duration 0) "mensural" "")))
154 ((default) (number->string duration))
156 (string-append (number->string duration) (symbol->string style)))))
161 ;; this is silly, can't we use something like
162 ;; roman-0, roman-1 roman+1 ?
165 ("brace" . "feta-braces")
166 ("default" . "cmr10")
167 ("dynamic" . "feta-din")
171 ("typewriter" . "cmtt")
177 ("mark" . "feta-nummer")
178 ("finger" . "feta-nummer")
179 ("timesig" . "feta-nummer")
180 ("number" . "feta-nummer")
181 ("volta" . "feta-nummer"))
184 (define (string-encode-integer i)
187 ((< i 0) (string-append "n" (string-encode-integer (- i))))
189 (make-string 1 (integer->char (+ 65 (modulo i 26))))
190 (string-encode-integer (quotient i 26))
197 (cdr (assoc i '((-4 . 482)
210 (define script-alist '())
211 (define (articulation-to-scriptdef a)
212 (assoc a script-alist)
215 ;; Map style names to TeX font names. Return false if
216 ;; no font name found.
217 (define (style-to-cmr s)
223 (define font-name-alist '())
224 (define (font-command name-mag)
226 (string-append "magfont"
227 (string-encode-integer (hashq (car name-mag) 1000000))
229 (string-encode-integer (cdr name-mag)))
233 (define (define-fonts names)
234 (set! font-name-alist (map font-command names))
237 (font-load-command (car x) (cdr x))) font-name-alist)
240 (define (fontify name exp)
241 (string-append (select-font name)
248 ; Make a function that checks score element for being of a specific type.
249 (define (make-type-checker name)
251 (not (not (memq name (ly-get-elt-property elt 'interfaces))))))
254 ;;;;;;;;;;;;;;;;;;; TeX output
255 (define (tex-scm action-name)
260 (define (select-font font-name-symbol)
263 (c (assoc font-name-symbol font-name-alist))
268 (ly-warn (string-append
269 "Programming error: No such font known " (car font-name-symbol)))
270 "") ; issue no command
271 (string-append "\\" (cdr c)))
276 (define (beam width slope thick)
277 (embedded-ps ((ps-scm 'beam) width slope thick)))
279 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
280 (embedded-ps ((ps-scm 'bracket) arch_angle arch_width arch_height width height arch_thick thick)))
282 (define (dashed-slur thick dash l)
283 (embedded-ps ((ps-scm 'dashed-slur) thick dash l)))
285 (define (crescendo thick w h cont)
286 (embedded-ps ((ps-scm 'crescendo) thick w h cont)))
289 (string-append "\\char" (inexact->string i 10) " "))
291 (define (dashed-line thick dash w)
292 (embedded-ps ((ps-scm 'dashed-line) thick dash w)))
294 (define (decrescendo thick w h cont)
295 (embedded-ps ((ps-scm 'decrescendo) thick w h cont)))
297 (define (font-load-command name-mag command)
299 "\\font\\" command "="
300 (symbol->string (car name-mag))
302 (number->string (magstep (cdr name-mag)))
305 (define (embedded-ps s)
306 (string-append "\\embeddedps{" s "}"))
309 (string-append "% " s))
312 "\n\\EndLilyPondOutput")
314 (define (experimental-on)
317 (define (font-switch i)
321 (define (font-def i s)
323 "\\font" (font-switch i) "=" s "\n"))
329 ;; URG: ly-gulp-file: now we can't use scm output without Lily
331 ;; fixed in 1.3.4 for powerpc -- broken on Windows
332 (regexp-substitute/global #f "\n"
333 (ly-gulp-file "lily.ps") 'pre " %\n" 'post)
334 (ly-gulp-file "lily.ps"))
336 "\\input lilyponddefs \\turnOnPostScript"))
338 (define (header creator generate)
340 "%created by: " creator generate "\n"))
342 (define (invoke-char s i)
344 "\n\\" s "{" (inexact->string i 10) "}" ))
346 (define (invoke-dim1 s d)
348 "\n\\" s "{" (number->dim d) "}"))
353 ;; need to do something to make this really safe.
355 (define (output-tex-string s)
356 (if security-paranoia
358 (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
359 (begin (display "warning: not paranoid") (newline) s))
362 (define (lily-def key val)
366 ;; fixed in 1.3.4 for powerpc -- broken on Windows
367 (regexp-substitute/global #f "_"
368 (output-tex-string key) 'pre "X" 'post)
369 (output-tex-string key))
370 "{" (output-tex-string val) "}\n"))
372 (define (number->dim x)
374 (ly-number->string x) " pt "))
376 (define (placebox x y s)
379 (number->dim y) "}{" (number->dim x) "}{" s "}\n"))
381 (define (bezier-sandwich l thick)
382 (embedded-ps ((ps-scm 'bezier-sandwich) l thick)))
384 (define (start-line ht)
385 (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
388 "}\\vss}\\interscoreline")
389 (define (stop-last-line)
391 (define (filledbox breapth width depth height)
393 "\\kern" (number->dim (- breapth))
394 "\\vrule width " (number->dim (+ breapth width))
395 "depth " (number->dim depth)
396 "height " (number->dim height) " "))
399 (string-append "\\hbox{" (output-tex-string s) "}"))
401 (define (tuplet ht gapx dx dy thick dir)
402 (embedded-ps ((ps-scm 'tuplet) ht gapx dx dy thick dir)))
404 (define (volta h w thick vert_start vert_end)
405 (embedded-ps ((ps-scm 'volta) h w thick vert_start vert_end)))
408 ;; The procedures listed below form the public interface of TeX-scm.
409 ;; (should merge the 2 lists)
410 (cond ((eq? action-name 'all-definitions)
412 (define font-load-command ,font-load-command)
414 (define bezier-sandwich ,bezier-sandwich)
415 (define bracket ,bracket)
417 (define crescendo ,crescendo)
418 (define dashed-line ,dashed-line)
419 (define dashed-slur ,dashed-slur)
420 (define decrescendo ,decrescendo)
421 (define end-output ,end-output)
422 (define experimental-on ,experimental-on)
423 (define filledbox ,filledbox)
424 (define font-def ,font-def)
425 (define font-switch ,font-switch)
426 (define header-end ,header-end)
427 (define lily-def ,lily-def)
428 (define header ,header)
429 (define invoke-char ,invoke-char)
430 (define invoke-dim1 ,invoke-dim1)
431 (define placebox ,placebox)
432 (define select-font ,select-font)
433 (define start-line ,start-line)
434 (define stop-line ,stop-line)
435 (define stop-last-line ,stop-last-line)
437 (define tuplet ,tuplet)
438 (define volta ,volta)
441 ((eq? action-name 'beam) beam)
442 ((eq? action-name 'tuplet) tuplet)
443 ((eq? action-name 'bracket) bracket)
444 ((eq? action-name 'crescendo) crescendo)
445 ((eq? action-name 'dashed-line) dashed-line)
446 ((eq? action-name 'dashed-slur) dashed-slur)
447 ((eq? action-name 'decrescendo) decrescendo)
448 ((eq? action-name 'end-output) end-output)
449 ((eq? action-name 'experimental-on) experimental-on)
450 ((eq? action-name 'font-def) font-def)
451 ((eq? action-name 'font-switch) font-switch)
452 ((eq? action-name 'header-end) header-end)
453 ((eq? action-name 'lily-def) lily-def)
454 ((eq? action-name 'header) header)
455 ((eq? action-name 'invoke-char) invoke-char)
456 ((eq? action-name 'invoke-dim1) invoke-dim1)
457 ((eq? action-name 'placebox) placebox)
458 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
459 ((eq? action-name 'start-line) start-line)
460 ((eq? action-name 'stem) stem)
461 ((eq? action-name 'stop-line) stop-line)
462 ((eq? action-name 'stop-last-line) stop-last-line)
463 ((eq? action-name 'volta) volta)
464 (else (error "unknown tag -- PS-TEX " action-name))
470 (define (ps-scm action-name)
472 ;; alist containing fontname -> fontcommand assoc (both strings)
473 (define font-alist '())
474 (define font-count 0)
475 (define current-font "")
478 (define (cached-fontname i)
481 (make-string 1 (integer->char (+ 65 i)))))
483 (define (mag-to-size m)
484 (number->string (case m
487 (2 14) ; really: 14.400
488 (3 17) ; really: 17.280
489 (4 21) ; really: 20.736
490 (5 24) ; really: 24.888
491 (6 30) ; really: 29.856
495 (define (select-font font-name-symbol)
498 (c (assoc font-name-symbol font-name-alist))
503 (ly-warn (string-append
504 "Programming error: No such font known " (car font-name-symbol)))
505 "") ; issue no command
506 (string-append " " (cdr c) " "))
511 (define (font-load-command name-mag command)
515 (symbol->string (car name-mag))
517 (number->string (magstep (cdr name-mag)))
518 " 1000 div 12 mul scalefont setfont } bind def "
522 (define (beam width slope thick)
524 (numbers->string (list width slope thick)) " draw_beam" ))
527 (string-append "% " s))
529 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
531 (numbers->string (list arch_angle arch_width arch_height width height arch_thick thick)) " draw_bracket" ))
534 (invoke-char " show" i))
536 (define (crescendo thick w h cont )
538 (numbers->string (list w h (inexact->exact cont) thick))
541 ;; what the heck is this interface ?
542 (define (dashed-slur thick dash l)
544 (apply string-append (map control->string l))
545 (number->string thick)
547 (number->string dash)
549 (number->string (* 10 thick)) ;UGH. 10 ?
550 " ] 0 draw_dashed_slur"))
552 (define (dashed-line thick dash width)
554 (number->string width)
556 (number->string thick)
558 (number->string dash)
560 (number->string dash)
561 " ] 0 draw_dashed_line"))
563 (define (decrescendo thick w h cont)
565 (numbers->string (list w h (inexact->exact cont) thick))
566 " draw_decrescendo"))
572 (define (experimental-on) "")
574 (define (filledbox breapth width depth height)
575 (string-append (numbers->string (list breapth width depth height))
579 (define (font-def i s)
582 (substring s 0 (- (string-length s) 4))
583 " findfont 12 scalefont setfont} bind def \n"))
585 (define (font-switch i)
586 (string-append (font i) " "))
590 ;; URG: now we can't use scm output without Lily
591 (ly-gulp-file "lilyponddefs.ps")
592 " {exch pop //systemdict /run get exec} "
593 (ly-gulp-file "lily.ps")
594 "{ exch pop //systemdict /run get exec } "
597 (define (lily-def key val)
599 (if (string=? (substring key 0 (min (string-length "mudelapaper") (string-length key))) "mudelapaper")
600 (string-append "/" key " {" val "} bind def\n")
601 (string-append "/" key " (" val ") def\n")
605 (define (header creator generate)
608 "%%Creator: " creator generate "\n"))
610 (define (invoke-char s i)
612 "(\\" (inexact->string i 8) ") " s " " ))
614 (define (invoke-dim1 s d)
616 (number->string (* d (/ 72.27 72))) " " s ))
618 (define (placebox x y s)
620 (number->string x) " " (number->string y) " {" s "} placebox "))
622 (define (bezier-sandwich l thick)
624 (apply string-append (map control->string l))
625 (number->string thick)
626 " draw_bezier_sandwich"))
628 (define (start-line height)
631 (define (stem breapth width depth height)
632 (string-append (numbers->string (list breapth width depth height))
639 (string-append "(" s ") show "))
642 (define (volta h w thick vert_start vert_end)
644 (numbers->string (list h w thick (inexact->exact vert_start) (inexact->exact vert_end)))
647 (define (tuplet ht gap dx dy thick dir)
649 (numbers->string (list ht gap dx dy thick (inexact->exact dir)))
658 (cond ((eq? action-name 'all-definitions)
661 (define tuplet ,tuplet)
662 (define bracket ,bracket)
664 (define crescendo ,crescendo)
665 (define volta ,volta)
666 (define bezier-sandwich ,bezier-sandwich)
667 (define dashed-line ,dashed-line)
668 (define dashed-slur ,dashed-slur)
669 (define decrescendo ,decrescendo)
670 (define end-output ,end-output)
671 (define experimental-on ,experimental-on)
672 (define filledbox ,filledbox)
673 (define font-def ,font-def)
674 (define font-switch ,font-switch)
675 (define header-end ,header-end)
676 (define lily-def ,lily-def)
677 (define font-load-command ,font-load-command)
678 (define header ,header)
679 (define invoke-char ,invoke-char)
680 (define invoke-dim1 ,invoke-dim1)
681 (define placebox ,placebox)
682 (define select-font ,select-font)
683 (define start-line ,start-line)
685 (define stop-line ,stop-line)
686 (define stop-last-line ,stop-line)
689 ((eq? action-name 'tuplet) tuplet)
690 ((eq? action-name 'beam) beam)
691 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
692 ((eq? action-name 'bracket) bracket)
693 ((eq? action-name 'char) char)
694 ((eq? action-name 'crescendo) crescendo)
695 ((eq? action-name 'dashed-line) dashed-line)
696 ((eq? action-name 'dashed-slur) dashed-slur)
697 ((eq? action-name 'decrescendo) decrescendo)
698 ((eq? action-name 'experimental-on) experimental-on)
699 ((eq? action-name 'filledbox) filledbox)
700 ((eq? action-name 'select-font) select-font)
701 ((eq? action-name 'volta) volta)
702 (else (error "unknown tag -- PS-SCM " action-name))
707 (define (arg->string arg)
708 (cond ((number? arg) (inexact->string arg 10))
709 ((string? arg) (string-append "\"" arg "\""))
710 ((symbol? arg) (string-append "\"" (symbol->string arg) "\""))))
712 (define (func name . args)
718 (map (lambda (x) (string-append " " (arg->string x))) args)))
724 (inexact->exact (/ x (abs x)))))
727 (define (as-scm action-name)
729 (define (beam width slope thick)
731 (func "set-line-char" "#")
732 (func "rline-to" width (* width slope))
736 (define (bezier-sandwich l thick)
743 (dy (- (cdr c3) (cdr c0)))
745 (c1-dx (- (car c1) x))
746 (c1-line-y (+ (cdr c0) (* c1-dx rc)))
747 (dir (if (< c1-line-y (cdr c1)) 1 -1))
748 (y (+ -1 (* dir (max (* dir (cdr c0)) (* dir (cdr c3)))))))
750 (func "rmove-to" x y)
751 (func "put" (if (< 0 dir) "/" "\\\\"))
752 (func "rmove-to" 1 (if (< 0 dir) 1 0))
753 (func "set-line-char" "_")
754 (func "h-line" (- dx 1))
755 (func "rmove-to" (- dx 1) (if (< 0 dir) -1 0))
756 (func "put" (if (< 0 dir) "\\\\" "/"))))))
758 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
760 (func "rmove-to" (+ width 1) (- (/ height -2) 1))
762 (func "set-line-char" "|")
763 (func "rmove-to" 0 1)
764 (func "v-line" (+ height 1))
765 (func "rmove-to" 0 (+ height 1))
775 (define (experimental-on)
778 (define (filledbox breapth width depth height)
779 (let ((dx (+ width breapth))
780 (dy (+ depth height)))
782 (func "rmove-to" (* -1 breapth) (* -1 depth))
785 (func "set-line-char"
786 (if (<= dx 1) "|" "#"))
789 (func "set-line-char"
790 (if (<= dy 1) "-" "="))
791 (func "h-line" dx))))))
793 (define (font-load-command name-mag command)
794 (func "load-font" (car name-mag) (magstep (cdr name-mag))))
796 (define (header creator generate)
797 (func "header" creator generate))
802 ;; urg: this is good for half of as2text's execution time
803 (define (xlily-def key val)
804 (string-append "(define " key " " (arg->string val) ")\n"))
806 (define (lily-def key val)
808 (or (equal? key "mudelapaperlinewidth")
809 (equal? key "mudelapaperstaffheight"))
810 (string-append "(define " key " " (arg->string val) ")\n")
813 (define (placebox x y s)
814 (let ((ey (inexact->exact y)))
815 (string-append "(move-to " (number->string (inexact->exact x)) " "
816 (if (= 0.5 (- (abs y) (abs ey)))
821 (define (select-font font-name-symbol)
822 (let* ((c (assoc font-name-symbol font-name-alist)))
827 "Programming error: No such font known "
828 (car font-name-symbol)))
829 "") ; issue no command
830 (func "select-font" (car font-name-symbol)))))
832 (define (start-line height)
833 (func "start-line" height))
841 (define (volta h w thick vert-start vert-end)
844 (func "set-line-char" "|")
845 (func "rmove-to" 0 -4)
846 ;; definition strange-way around
850 (func "rmove-to" 1 h)
851 (func "set-line-char" "_")
852 (func "h-line" (- w 1))
853 (func "set-line-char" "|")
856 (func "rmove-to" (- w 1) (* -1 h))
857 (func "v-line" (* -1 h)))
860 (cond ((eq? action-name 'all-definitions)
863 (define bracket ,bracket)
865 ;;(define crescendo ,crescendo)
866 (define bezier-sandwich ,bezier-sandwich)
867 ;;(define dashed-slur ,dashed-slur)
868 ;;(define decrescendo ,decrescendo)
869 (define end-output ,end-output)
870 (define experimental-on ,experimental-on)
871 (define filledbox ,filledbox)
872 ;;(define font-def ,font-def)
873 (define font-load-command ,font-load-command)
874 ;;(define font-switch ,font-switch)
875 (define header ,header)
876 (define header-end ,header-end)
877 (define lily-def ,lily-def)
878 ;;(define invoke-char ,invoke-char)
879 ;;(define invoke-dim1 ,invoke-dim1)
880 (define placebox ,placebox)
881 (define select-font ,select-font)
882 (define start-line ,start-line)
883 ;;(define stem ,stem)
884 (define stop-line ,stop-line)
885 (define stop-last-line ,stop-line)
887 ;;(define tuplet ,tuplet)
888 (define volta ,volta)
890 ;;((eq? action-name 'tuplet) tuplet)
891 ;;((eq? action-name 'beam) beam)
892 ;;((eq? action-name 'bezier-sandwich) bezier-sandwich)
893 ;;((eq? action-name 'bracket) bracket)
894 ((eq? action-name 'char) char)
895 ;;((eq? action-name 'crescendo) crescendo)
896 ;;((eq? action-name 'dashed-slur) dashed-slur)
897 ;;((eq? action-name 'decrescendo) decrescendo)
898 ;;((eq? action-name 'experimental-on) experimental-on)
899 ((eq? action-name 'filledbox) filledbox)
900 ((eq? action-name 'select-font) select-font)
901 ;;((eq? action-name 'volta) volta)
902 (else (error "unknown tag -- MUSA-SCM " action-name))
907 (define (gulp-file name)
908 (let* ((port (open-file name "r"))
909 (content (let loop ((text ""))
910 (let ((line (read-line port)))
911 (if (or (eof-object? line)
914 (loop (string-append text line "\n")))))))
918 ;; urg: Use when standalone, do:
919 ;; (define (ly-gulp-file name) (scm-gulp-file name))
920 (define (scm-gulp-file name)
922 (cons (string-append (getenv 'LILYPONDPREFIX) "/ly")
923 (cons (string-append (getenv 'LILYPONDPREFIX) "/ps")
925 (let ((path (%search-load-path name)))
930 (define (scm-tex-output)
931 (eval (tex-scm 'all-definitions)))
933 (define (scm-ps-output)
934 (eval (ps-scm 'all-definitions)))
936 (define (scm-as-output)
937 (eval (as-scm 'all-definitions)))
939 (define (index-cell cell dir)
945 ; How should a bar line behave at a break?
947 (define (break-barline glyph dir)
948 (let ((result (assoc glyph
949 '((":|:" . (":|" . "|:"))
952 ("|:" . ("|" . "|:"))
953 ("|." . ("|." . nil))
954 (":|" . (":|" . nil))
955 ("||" . ("||" . nil))
956 (".|." . (".|." . nil))
957 ("scorebar" . (nil . "scorepostbreak"))
958 ("brace" . (nil . "brace"))
959 ("bracket" . (nil . "bracket"))
963 (if (equal? result #f)
964 (ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
965 (index-cell (cdr result) dir))