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 ((Left_edge_item begin-of-note) . (extra-space 1.0))
109 ((none Left_edge_item) . (extra-space 0.0))
110 ((Left_edge_item Staff_bar) . (extra-space 0.0))
111 ; ((none Left_edge_item) . (extra-space -15.0))
112 ; ((none Left_edge_item) . (extra-space -15.0))
113 ((none Clef_item) . (minimum-space 1.0))
114 ((none Staff_bar) . (minimum-space 0.0))
115 ((none Clef_item) . (minimum-space 1.0))
116 ((none Key_item) . (minimum-space 0.5))
117 ((none Time_signature) . (extra-space 0.0))
118 ((none begin-of-note) . (minimum-space 1.5))
119 ((Clef_item Key_item) . (minimum-space 4.0))
120 ((Key_item Time_signature) . (extra-space 1.0))
121 ((Clef_item Time_signature) . (minimum-space 3.5))
122 ((Staff_bar Clef_item) . (minimum-space 1.0))
123 ((Clef_item Staff_bar) . (minimum-space 3.7))
124 ((Time_signature Staff_bar) . (minimum-space 2.0))
125 ((Key_item Staff_bar) . (extra-space 1.0))
126 ((Staff_bar Time_signature) . (minimum-space 1.5)) ;double check this.
127 ((Time_signature begin-of-note) . (extra-space 2.0)) ;double check this.
128 ((Key_item begin-of-note) . (extra-space 2.5))
129 ((Staff_bar begin-of-note) . (extra-space 1.0))
130 ((Clef_item begin-of-note) . (minimum-space 5.0))
131 ((none Breathing_sign) . (minimum-space 0.0))
132 ((Breathing_sign Key_item) . (minimum-space 1.5))
133 ((Breathing_sign begin-of-note) . (minimum-space 1.0))
134 ((Breathing_sign Staff_bar) . (minimum-space 1.5))
135 ((Breathing_sign Clef_item) . (minimum-space 2.0))
139 ;; (define (ly-warn s) (error s))
140 (define (break-align-spacer this next)
141 (let ((entry (assoc (list this next) space-alist)))
144 (begin (ly-warn (string-append "Unknown spacing pair `" this "', `" next "'"))
145 '(minimum-space 0.0)))))
148 (define (find-notehead-symbol duration style)
151 ((harmonic) "0mensural")
153 (string-append (number->string duration)
154 (if (< duration 0) "mensural" "")))
155 ((default) (number->string duration))
157 (string-append (number->string duration) (symbol->string style)))))
162 ;; this is silly, can't we use something like
163 ;; roman-0, roman-1 roman+1 ?
166 ("brace" . "feta-braces")
167 ("default" . "cmr10")
168 ("dynamic" . "feta-din")
172 ("typewriter" . "cmtt")
179 ("mark" . "feta-nummer")
180 ("finger" . "feta-nummer")
181 ("timesig" . "feta-nummer")
182 ("number" . "feta-nummer")
183 ("volta" . "feta-nummer"))
186 (define (string-encode-integer i)
189 ((< i 0) (string-append "n" (string-encode-integer (- i))))
191 (make-string 1 (integer->char (+ 65 (modulo i 26))))
192 (string-encode-integer (quotient i 26))
199 (cdr (assoc i '((-4 . 482)
212 (define script-alist '())
213 (define (articulation-to-scriptdef a)
214 (assoc a script-alist)
217 ;; Map style names to TeX font names. Return false if
218 ;; no font name found.
219 (define (style-to-cmr s)
225 (define font-name-alist '())
226 (define (font-command name-mag)
228 (string-append "magfont"
229 (string-encode-integer (hashq (car name-mag) 1000000))
231 (string-encode-integer (cdr name-mag)))
235 (define (define-fonts names)
236 (set! font-name-alist (map font-command names))
239 (font-load-command (car x) (cdr x))) font-name-alist)
242 (define (fontify name exp)
243 (string-append (select-font name)
250 ; Make a function that checks score element for being of a specific type.
251 (define (make-type-checker name)
253 (not (not (memq name (ly-get-elt-property elt 'interfaces))))))
256 ;;;;;;;;;;;;;;;;;;; TeX output
257 (define (tex-scm action-name)
262 (define (select-font font-name-symbol)
265 (c (assoc font-name-symbol font-name-alist))
270 (ly-warn (string-append
271 "Programming error: No such font known " (car font-name-symbol)))
272 "") ; issue no command
273 (string-append "\\" (cdr c)))
278 (define (beam width slope thick)
279 (embedded-ps ((ps-scm 'beam) width slope thick)))
281 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
282 (embedded-ps ((ps-scm 'bracket) arch_angle arch_width arch_height width height arch_thick thick)))
284 (define (dashed-slur thick dash l)
285 (embedded-ps ((ps-scm 'dashed-slur) thick dash l)))
287 (define (crescendo thick w h cont)
288 (embedded-ps ((ps-scm 'crescendo) thick w h cont)))
291 (string-append "\\char" (inexact->string i 10) " "))
293 (define (dashed-line thick dash w)
294 (embedded-ps ((ps-scm 'dashed-line) thick dash w)))
296 (define (decrescendo thick w h cont)
297 (embedded-ps ((ps-scm 'decrescendo) thick w h cont)))
299 (define (font-load-command name-mag command)
301 "\\font\\" command "="
302 (symbol->string (car name-mag))
304 (number->string (magstep (cdr name-mag)))
307 (define (embedded-ps s)
308 (string-append "\\embeddedps{" s "}"))
311 (string-append "% " s))
314 (string-append "\n\\EndLilyPondOutput"
318 (define (experimental-on)
321 (define (font-switch i)
325 (define (font-def i s)
327 "\\font" (font-switch i) "=" s "\n"))
333 ;; URG: ly-gulp-file: now we can't use scm output without Lily
335 ;; fixed in 1.3.4 for powerpc -- broken on Windows
336 (regexp-substitute/global #f "\n"
337 (ly-gulp-file "lily.ps") 'pre " %\n" 'post)
338 (ly-gulp-file "lily.ps"))
340 "\\input lilyponddefs \\turnOnPostScript"))
342 (define (header creator generate)
344 "%created by: " creator generate "\n"))
346 (define (invoke-char s i)
348 "\n\\" s "{" (inexact->string i 10) "}" ))
350 (define (invoke-dim1 s d)
352 "\n\\" s "{" (number->dim d) "}"))
357 ;; need to do something to make this really safe.
359 (define (output-tex-string s)
360 (if security-paranoia
362 (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
363 (begin (display "warning: not paranoid") (newline) s))
366 (define (lily-def key val)
370 ;; fixed in 1.3.4 for powerpc -- broken on Windows
371 (regexp-substitute/global #f "_"
372 (output-tex-string key) 'pre "X" 'post)
373 (output-tex-string key))
374 "{" (output-tex-string val) "}\n"))
376 (define (number->dim x)
378 (ly-number->string x) " pt "))
380 (define (placebox x y s)
383 (number->dim y) "}{" (number->dim x) "}{" s "}\n"))
385 (define (bezier-sandwich l thick)
386 (embedded-ps ((ps-scm 'bezier-sandwich) l thick)))
388 (define (start-line ht)
389 (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
392 "}\\vss}\\interscoreline")
393 (define (stop-last-line)
395 (define (filledbox breapth width depth height)
397 "\\kern" (number->dim (- breapth))
398 "\\vrule width " (number->dim (+ breapth width))
399 "depth " (number->dim depth)
400 "height " (number->dim height) " "))
403 (string-append "\\hbox{" (output-tex-string s) "}"))
405 (define (tuplet ht gapx dx dy thick dir)
406 (embedded-ps ((ps-scm 'tuplet) ht gapx dx dy thick dir)))
408 (define (volta h w thick vert_start vert_end)
409 (embedded-ps ((ps-scm 'volta) h w thick vert_start vert_end)))
412 ;; The procedures listed below form the public interface of TeX-scm.
413 ;; (should merge the 2 lists)
414 (cond ((eq? action-name 'all-definitions)
416 (define font-load-command ,font-load-command)
418 (define bezier-sandwich ,bezier-sandwich)
419 (define bracket ,bracket)
421 (define crescendo ,crescendo)
422 (define dashed-line ,dashed-line)
423 (define dashed-slur ,dashed-slur)
424 (define decrescendo ,decrescendo)
425 (define end-output ,end-output)
426 (define experimental-on ,experimental-on)
427 (define filledbox ,filledbox)
428 (define font-def ,font-def)
429 (define font-switch ,font-switch)
430 (define header-end ,header-end)
431 (define lily-def ,lily-def)
432 (define header ,header)
433 (define invoke-char ,invoke-char)
434 (define invoke-dim1 ,invoke-dim1)
435 (define placebox ,placebox)
436 (define select-font ,select-font)
437 (define start-line ,start-line)
438 (define stop-line ,stop-line)
439 (define stop-last-line ,stop-last-line)
441 (define tuplet ,tuplet)
442 (define volta ,volta)
445 ((eq? action-name 'beam) beam)
446 ((eq? action-name 'tuplet) tuplet)
447 ((eq? action-name 'bracket) bracket)
448 ((eq? action-name 'crescendo) crescendo)
449 ((eq? action-name 'dashed-line) dashed-line)
450 ((eq? action-name 'dashed-slur) dashed-slur)
451 ((eq? action-name 'decrescendo) decrescendo)
452 ((eq? action-name 'end-output) end-output)
453 ((eq? action-name 'experimental-on) experimental-on)
454 ((eq? action-name 'font-def) font-def)
455 ((eq? action-name 'font-switch) font-switch)
456 ((eq? action-name 'header-end) header-end)
457 ((eq? action-name 'lily-def) lily-def)
458 ((eq? action-name 'header) header)
459 ((eq? action-name 'invoke-char) invoke-char)
460 ((eq? action-name 'invoke-dim1) invoke-dim1)
461 ((eq? action-name 'placebox) placebox)
462 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
463 ((eq? action-name 'start-line) start-line)
464 ((eq? action-name 'stem) stem)
465 ((eq? action-name 'stop-line) stop-line)
466 ((eq? action-name 'stop-last-line) stop-last-line)
467 ((eq? action-name 'volta) volta)
468 (else (error "unknown tag -- PS-TEX " action-name))
474 (define (ps-scm action-name)
476 ;; alist containing fontname -> fontcommand assoc (both strings)
477 (define font-alist '())
478 (define font-count 0)
479 (define current-font "")
482 (define (cached-fontname i)
485 (make-string 1 (integer->char (+ 65 i)))))
487 (define (mag-to-size m)
488 (number->string (case m
491 (2 14) ; really: 14.400
492 (3 17) ; really: 17.280
493 (4 21) ; really: 20.736
494 (5 24) ; really: 24.888
495 (6 30) ; really: 29.856
499 (define (select-font font-name-symbol)
502 (c (assoc font-name-symbol font-name-alist))
507 (ly-warn (string-append
508 "Programming error: No such font known " (car font-name-symbol)))
509 "") ; issue no command
510 (string-append " " (cdr c) " "))
515 (define (font-load-command name-mag command)
519 (symbol->string (car name-mag))
521 (number->string (magstep (cdr name-mag)))
522 " 1000 div 12 mul scalefont setfont } bind def "
526 (define (beam width slope thick)
528 (numbers->string (list width slope thick)) " draw_beam" ))
531 (string-append "% " s))
533 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
535 (numbers->string (list arch_angle arch_width arch_height width height arch_thick thick)) " draw_bracket" ))
538 (invoke-char " show" i))
540 (define (crescendo thick w h cont )
542 (numbers->string (list w h (inexact->exact cont) thick))
545 ;; what the heck is this interface ?
546 (define (dashed-slur thick dash l)
548 (apply string-append (map control->string l))
549 (number->string thick)
551 (number->string dash)
553 (number->string (* 10 thick)) ;UGH. 10 ?
554 " ] 0 draw_dashed_slur"))
556 (define (dashed-line thick dash width)
558 (number->string width)
560 (number->string thick)
562 (number->string dash)
564 (number->string dash)
565 " ] 0 draw_dashed_line"))
567 (define (decrescendo thick w h cont)
569 (numbers->string (list w h (inexact->exact cont) thick))
570 " draw_decrescendo"))
576 (define (experimental-on) "")
578 (define (filledbox breapth width depth height)
579 (string-append (numbers->string (list breapth width depth height))
583 (define (font-def i s)
586 (substring s 0 (- (string-length s) 4))
587 " findfont 12 scalefont setfont} bind def \n"))
589 (define (font-switch i)
590 (string-append (font i) " "))
594 ;; URG: now we can't use scm output without Lily
595 (ly-gulp-file "lilyponddefs.ps")
596 " {exch pop //systemdict /run get exec} "
597 (ly-gulp-file "lily.ps")
598 "{ exch pop //systemdict /run get exec } "
601 (define (lily-def key val)
603 (if (string=? (substring key 0 (min (string-length "mudelapaper") (string-length key))) "mudelapaper")
604 (string-append "/" key " {" val "} bind def\n")
605 (string-append "/" key " (" val ") def\n")
609 (define (header creator generate)
612 "%%Creator: " creator generate "\n"))
614 (define (invoke-char s i)
616 "(\\" (inexact->string i 8) ") " s " " ))
618 (define (invoke-dim1 s d)
620 (number->string (* d (/ 72.27 72))) " " s ))
622 (define (placebox x y s)
624 (number->string x) " " (number->string y) " {" s "} placebox "))
626 (define (bezier-sandwich l thick)
628 (apply string-append (map control->string l))
629 (number->string thick)
630 " draw_bezier_sandwich"))
632 (define (start-line height)
635 (define (stem breapth width depth height)
636 (string-append (numbers->string (list breapth width depth height))
643 (string-append "(" s ") show "))
646 (define (volta h w thick vert_start vert_end)
648 (numbers->string (list h w thick (inexact->exact vert_start) (inexact->exact vert_end)))
651 (define (tuplet ht gap dx dy thick dir)
653 (numbers->string (list ht gap dx dy thick (inexact->exact dir)))
662 (cond ((eq? action-name 'all-definitions)
665 (define tuplet ,tuplet)
666 (define bracket ,bracket)
668 (define crescendo ,crescendo)
669 (define volta ,volta)
670 (define bezier-sandwich ,bezier-sandwich)
671 (define dashed-line ,dashed-line)
672 (define dashed-slur ,dashed-slur)
673 (define decrescendo ,decrescendo)
674 (define end-output ,end-output)
675 (define experimental-on ,experimental-on)
676 (define filledbox ,filledbox)
677 (define font-def ,font-def)
678 (define font-switch ,font-switch)
679 (define header-end ,header-end)
680 (define lily-def ,lily-def)
681 (define font-load-command ,font-load-command)
682 (define header ,header)
683 (define invoke-char ,invoke-char)
684 (define invoke-dim1 ,invoke-dim1)
685 (define placebox ,placebox)
686 (define select-font ,select-font)
687 (define start-line ,start-line)
689 (define stop-line ,stop-line)
690 (define stop-last-line ,stop-line)
693 ((eq? action-name 'tuplet) tuplet)
694 ((eq? action-name 'beam) beam)
695 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
696 ((eq? action-name 'bracket) bracket)
697 ((eq? action-name 'char) char)
698 ((eq? action-name 'crescendo) crescendo)
699 ((eq? action-name 'dashed-line) dashed-line)
700 ((eq? action-name 'dashed-slur) dashed-slur)
701 ((eq? action-name 'decrescendo) decrescendo)
702 ((eq? action-name 'experimental-on) experimental-on)
703 ((eq? action-name 'filledbox) filledbox)
704 ((eq? action-name 'select-font) select-font)
705 ((eq? action-name 'volta) volta)
706 (else (error "unknown tag -- PS-SCM " action-name))
711 (define (arg->string arg)
712 (cond ((number? arg) (inexact->string arg 10))
713 ((string? arg) (string-append "\"" arg "\""))
714 ((symbol? arg) (string-append "\"" (symbol->string arg) "\""))))
716 (define (func name . args)
722 (map (lambda (x) (string-append " " (arg->string x))) args)))
728 (inexact->exact (/ x (abs x)))))
731 (define (as-scm action-name)
733 (define (beam width slope thick)
735 (func "set-line-char" "#")
736 (func "rline-to" width (* width slope))
740 (define (bezier-sandwich l thick)
747 (dy (- (cdr c3) (cdr c0)))
749 (c1-dx (- (car c1) x))
750 (c1-line-y (+ (cdr c0) (* c1-dx rc)))
751 (dir (if (< c1-line-y (cdr c1)) 1 -1))
752 (y (+ -1 (* dir (max (* dir (cdr c0)) (* dir (cdr c3)))))))
754 (func "rmove-to" x y)
755 (func "put" (if (< 0 dir) "/" "\\\\"))
756 (func "rmove-to" 1 (if (< 0 dir) 1 0))
757 (func "set-line-char" "_")
758 (func "h-line" (- dx 1))
759 (func "rmove-to" (- dx 1) (if (< 0 dir) -1 0))
760 (func "put" (if (< 0 dir) "\\\\" "/"))))))
762 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
764 (func "rmove-to" (+ width 1) (- (/ height -2) 1))
766 (func "set-line-char" "|")
767 (func "rmove-to" 0 1)
768 (func "v-line" (+ height 1))
769 (func "rmove-to" 0 (+ height 1))
779 (define (experimental-on)
782 (define (filledbox breapth width depth height)
783 (let ((dx (+ width breapth))
784 (dy (+ depth height)))
786 (func "rmove-to" (* -1 breapth) (* -1 depth))
789 (func "set-line-char"
790 (if (<= dx 1) "|" "#"))
793 (func "set-line-char"
794 (if (<= dy 1) "-" "="))
795 (func "h-line" dx))))))
797 (define (font-load-command name-mag command)
798 (func "load-font" (car name-mag) (magstep (cdr name-mag))))
800 (define (header creator generate)
801 (func "header" creator generate))
806 ;; urg: this is good for half of as2text's execution time
807 (define (xlily-def key val)
808 (string-append "(define " key " " (arg->string val) ")\n"))
810 (define (lily-def key val)
812 (or (equal? key "mudelapaperlinewidth")
813 (equal? key "mudelapaperstaffheight"))
814 (string-append "(define " key " " (arg->string val) ")\n")
817 (define (placebox x y s)
818 (let ((ey (inexact->exact y)))
819 (string-append "(move-to " (number->string (inexact->exact x)) " "
820 (if (= 0.5 (- (abs y) (abs ey)))
825 (define (select-font font-name-symbol)
826 (let* ((c (assoc font-name-symbol font-name-alist)))
831 "Programming error: No such font known "
832 (car font-name-symbol)))
833 "") ; issue no command
834 (func "select-font" (car font-name-symbol)))))
836 (define (start-line height)
837 (func "start-line" height))
845 (define (volta h w thick vert-start vert-end)
848 (func "set-line-char" "|")
849 (func "rmove-to" 0 -4)
850 ;; definition strange-way around
854 (func "rmove-to" 1 h)
855 (func "set-line-char" "_")
856 (func "h-line" (- w 1))
857 (func "set-line-char" "|")
860 (func "rmove-to" (- w 1) (* -1 h))
861 (func "v-line" (* -1 h)))
864 (cond ((eq? action-name 'all-definitions)
867 (define bracket ,bracket)
869 ;;(define crescendo ,crescendo)
870 (define bezier-sandwich ,bezier-sandwich)
871 ;;(define dashed-slur ,dashed-slur)
872 ;;(define decrescendo ,decrescendo)
873 (define end-output ,end-output)
874 (define experimental-on ,experimental-on)
875 (define filledbox ,filledbox)
876 ;;(define font-def ,font-def)
877 (define font-load-command ,font-load-command)
878 ;;(define font-switch ,font-switch)
879 (define header ,header)
880 (define header-end ,header-end)
881 (define lily-def ,lily-def)
882 ;;(define invoke-char ,invoke-char)
883 ;;(define invoke-dim1 ,invoke-dim1)
884 (define placebox ,placebox)
885 (define select-font ,select-font)
886 (define start-line ,start-line)
887 ;;(define stem ,stem)
888 (define stop-line ,stop-line)
889 (define stop-last-line ,stop-line)
891 ;;(define tuplet ,tuplet)
892 (define volta ,volta)
894 ;;((eq? action-name 'tuplet) tuplet)
895 ;;((eq? action-name 'beam) beam)
896 ;;((eq? action-name 'bezier-sandwich) bezier-sandwich)
897 ;;((eq? action-name 'bracket) bracket)
898 ((eq? action-name 'char) char)
899 ;;((eq? action-name 'crescendo) crescendo)
900 ;;((eq? action-name 'dashed-slur) dashed-slur)
901 ;;((eq? action-name 'decrescendo) decrescendo)
902 ;;((eq? action-name 'experimental-on) experimental-on)
903 ((eq? action-name 'filledbox) filledbox)
904 ((eq? action-name 'select-font) select-font)
905 ;;((eq? action-name 'volta) volta)
906 (else (error "unknown tag -- MUSA-SCM " action-name))
911 (define (gulp-file name)
912 (let* ((port (open-file name "r"))
913 (content (let loop ((text ""))
914 (let ((line (read-line port)))
915 (if (or (eof-object? line)
918 (loop (string-append text line "\n")))))))
922 ;; urg: Use when standalone, do:
923 ;; (define ly-gulp-file scm-gulp-file)
924 (define (scm-gulp-file name)
926 (cons (string-append (getenv 'LILYPONDPREFIX) "/ly")
927 (cons (string-append (getenv 'LILYPONDPREFIX) "/ps")
929 (let ((path (%search-load-path name)))
934 (define (scm-tex-output)
935 (eval (tex-scm 'all-definitions)))
937 (define (scm-ps-output)
938 (eval (ps-scm 'all-definitions)))
940 (define (scm-as-output)
941 (eval (as-scm 'all-definitions)))
943 (define (index-cell cell dir)
949 ; How should a bar line behave at a break?
951 (define (break-barline glyph dir)
952 (let ((result (assoc glyph
953 '((":|:" . (":|" . "|:"))
956 ("|:" . ("|" . "|:"))
957 ("|." . ("|." . nil))
958 (".|" . (nil . ".|"))
959 (":|" . (":|" . nil))
960 ("||" . ("||" . nil))
961 (".|." . (".|." . nil))
962 ("scorebar" . (nil . "scorepostbreak"))
963 ("brace" . (nil . "brace"))
964 ("bracket" . (nil . "bracket"))
968 (if (equal? result #f)
969 (ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
970 (index-cell (cdr result) dir))