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 ((none Left_edge_item) . (extra-space 0.0))
108 ((Left_edge_item Staff_bar) . (extra-space 0.0))
109 ; ((none Left_edge_item) . (extra-space -15.0))
110 ; ((none Left_edge_item) . (extra-space -15.0))
111 ((none Clef_item) . (minimum-space 1.0))
112 ((none Staff_bar) . (minimum-space 0.0))
113 ((none Clef_item) . (minimum-space 1.0))
114 ((none Key_item) . (minimum-space 0.5))
115 ((none Time_signature) . (extra-space 0.0))
116 ((none begin-of-note) . (minimum-space 1.5))
117 ((Clef_item Key_item) . (minimum-space 4.0))
118 ((Key_item Time_signature) . (extra-space 1.0))
119 ((Clef_item Time_signature) . (minimum-space 3.5))
120 ((Staff_bar Clef_item) . (minimum-space 1.0))
121 ((Clef_item Staff_bar) . (minimum-space 3.7))
122 ((Time_signature Staff_bar) . (minimum-space 2.0))
123 ((Key_item Staff_bar) . (extra-space 1.0))
124 ((Staff_bar Time_signature) . (minimum-space 1.5)) ;double check this.
125 ((Time_signature begin-of-note) . (extra-space 2.0)) ;double check this.
126 ((Key_item begin-of-note) . (extra-space 2.5))
127 ((Staff_bar begin-of-note) . (extra-space 1.0))
128 ((Clef_item begin-of-note) . (minimum-space 5.0))
129 ((none Breathing_sign) . (minimum-space 0.0))
130 ((Breathing_sign Key_item) . (minimum-space 1.5))
131 ((Breathing_sign begin-of-note) . (minimum-space 1.0))
132 ((Breathing_sign Staff_bar) . (minimum-space 1.5))
133 ((Breathing_sign Clef_item) . (minimum-space 2.0))
137 ;; (define (ly-warn s) (error s))
138 (define (break-align-spacer this next)
139 (let ((entry (assoc (list this next) space-alist)))
142 (begin (ly-warn (string-append "Unknown spacing pair `" this "', `" next "'"))
143 '(minimum-space 0.0)))))
146 (define (find-notehead-symbol duration style)
149 ((harmonic) "0mensural")
151 (string-append (number->string duration)
152 (if (< duration 0) "mensural" "")))
153 ((default) (number->string duration))
155 (string-append (number->string duration) (symbol->string style)))))
160 ;; this is silly, can't we use something like
161 ;; roman-0, roman-1 roman+1 ?
164 ("brace" . "feta-braces")
165 ("default" . "cmr10")
166 ("dynamic" . "feta-din")
170 ("typewriter" . "cmtt")
176 ("mark" . "feta-nummer")
177 ("finger" . "feta-nummer")
178 ("timesig" . "feta-nummer")
179 ("number" . "feta-nummer")
180 ("volta" . "feta-nummer"))
183 (define (string-encode-integer i)
186 ((< i 0) (string-append "n" (string-encode-integer (- i))))
188 (make-string 1 (integer->char (+ 65 (modulo i 26))))
189 (string-encode-integer (quotient i 26))
196 (cdr (assoc i '((-4 . 482)
209 (define script-alist '())
210 (define (articulation-to-scriptdef a)
211 (assoc a script-alist)
214 ;; Map style names to TeX font names. Return false if
215 ;; no font name found.
216 (define (style-to-cmr s)
222 (define font-name-alist '())
223 (define (font-command name-mag)
225 (string-append "magfont"
226 (string-encode-integer (hashq (car name-mag) 1000000))
228 (string-encode-integer (cdr name-mag)))
232 (define (define-fonts names)
233 (set! font-name-alist (map font-command names))
236 (font-load-command (car x) (cdr x))) font-name-alist)
239 (define (fontify name exp)
240 (string-append (select-font name)
247 ; Make a function that checks score element for being of a specific type.
248 (define (make-type-checker name)
250 (not (not (memq name (ly-get-elt-property elt 'interfaces))))))
253 ;;;;;;;;;;;;;;;;;;; TeX output
254 (define (tex-scm action-name)
259 (define (select-font font-name-symbol)
262 (c (assoc font-name-symbol font-name-alist))
267 (ly-warn (string-append
268 "Programming error: No such font known " (car font-name-symbol)))
269 "") ; issue no command
270 (string-append "\\" (cdr c)))
275 (define (beam width slope thick)
276 (embedded-ps ((ps-scm 'beam) width slope thick)))
278 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
279 (embedded-ps ((ps-scm 'bracket) arch_angle arch_width arch_height width height arch_thick thick)))
281 (define (dashed-slur thick dash l)
282 (embedded-ps ((ps-scm 'dashed-slur) thick dash l)))
284 (define (crescendo thick w h cont)
285 (embedded-ps ((ps-scm 'crescendo) thick w h cont)))
288 (string-append "\\char" (inexact->string i 10) " "))
290 (define (dashed-line thick dash w)
291 (embedded-ps ((ps-scm 'dashed-line) thick dash w)))
293 (define (decrescendo thick w h cont)
294 (embedded-ps ((ps-scm 'decrescendo) thick w h cont)))
296 (define (font-load-command name-mag command)
298 "\\font\\" command "="
299 (symbol->string (car name-mag))
301 (number->string (magstep (cdr name-mag)))
304 (define (embedded-ps s)
305 (string-append "\\embeddedps{" s "}"))
308 (string-append "% " s))
311 "\n\\EndLilyPondOutput")
313 (define (experimental-on)
316 (define (font-switch i)
320 (define (font-def i s)
322 "\\font" (font-switch i) "=" s "\n"))
328 ;; URG: ly-gulp-file: now we can't use scm output without Lily
330 ;; fixed in 1.3.4 for powerpc -- broken on Windows
331 (regexp-substitute/global #f "\n"
332 (ly-gulp-file "lily.ps") 'pre " %\n" 'post)
333 (ly-gulp-file "lily.ps"))
335 "\\input lilyponddefs \\turnOnPostScript"))
337 (define (header creator generate)
339 "%created by: " creator generate "\n"))
341 (define (invoke-char s i)
343 "\n\\" s "{" (inexact->string i 10) "}" ))
345 (define (invoke-dim1 s d)
347 "\n\\" s "{" (number->dim d) "}"))
352 ;; need to do something to make this really safe.
354 (define (output-tex-string s)
355 (if security-paranoia
357 (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
358 (begin (display "warning: not paranoid") (newline) s))
361 (define (lily-def key val)
365 ;; fixed in 1.3.4 for powerpc -- broken on Windows
366 (regexp-substitute/global #f "_"
367 (output-tex-string key) 'pre "X" 'post)
368 (output-tex-string key))
369 "{" (output-tex-string val) "}\n"))
371 (define (number->dim x)
373 (ly-number->string x) " pt "))
375 (define (placebox x y s)
378 (number->dim y) "}{" (number->dim x) "}{" s "}\n"))
380 (define (bezier-sandwich l thick)
381 (embedded-ps ((ps-scm 'bezier-sandwich) l thick)))
383 (define (start-line ht)
384 (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
387 "}\\vss}\\interscoreline")
388 (define (stop-last-line)
390 (define (filledbox breapth width depth height)
392 "\\kern" (number->dim (- breapth))
393 "\\vrule width " (number->dim (+ breapth width))
394 "depth " (number->dim depth)
395 "height " (number->dim height) " "))
398 (string-append "\\hbox{" (output-tex-string s) "}"))
400 (define (tuplet ht gapx dx dy thick dir)
401 (embedded-ps ((ps-scm 'tuplet) ht gapx dx dy thick dir)))
403 (define (volta h w thick vert_start vert_end)
404 (embedded-ps ((ps-scm 'volta) h w thick vert_start vert_end)))
407 ;; The procedures listed below form the public interface of TeX-scm.
408 ;; (should merge the 2 lists)
409 (cond ((eq? action-name 'all-definitions)
411 (define font-load-command ,font-load-command)
413 (define bezier-sandwich ,bezier-sandwich)
414 (define bracket ,bracket)
416 (define crescendo ,crescendo)
417 (define dashed-line ,dashed-line)
418 (define dashed-slur ,dashed-slur)
419 (define decrescendo ,decrescendo)
420 (define end-output ,end-output)
421 (define experimental-on ,experimental-on)
422 (define filledbox ,filledbox)
423 (define font-def ,font-def)
424 (define font-switch ,font-switch)
425 (define header-end ,header-end)
426 (define lily-def ,lily-def)
427 (define header ,header)
428 (define invoke-char ,invoke-char)
429 (define invoke-dim1 ,invoke-dim1)
430 (define placebox ,placebox)
431 (define select-font ,select-font)
432 (define start-line ,start-line)
433 (define stop-line ,stop-line)
434 (define stop-last-line ,stop-last-line)
436 (define tuplet ,tuplet)
437 (define volta ,volta)
440 ((eq? action-name 'beam) beam)
441 ((eq? action-name 'tuplet) tuplet)
442 ((eq? action-name 'bracket) bracket)
443 ((eq? action-name 'crescendo) crescendo)
444 ((eq? action-name 'dashed-line) dashed-line)
445 ((eq? action-name 'dashed-slur) dashed-slur)
446 ((eq? action-name 'decrescendo) decrescendo)
447 ((eq? action-name 'end-output) end-output)
448 ((eq? action-name 'experimental-on) experimental-on)
449 ((eq? action-name 'font-def) font-def)
450 ((eq? action-name 'font-switch) font-switch)
451 ((eq? action-name 'header-end) header-end)
452 ((eq? action-name 'lily-def) lily-def)
453 ((eq? action-name 'header) header)
454 ((eq? action-name 'invoke-char) invoke-char)
455 ((eq? action-name 'invoke-dim1) invoke-dim1)
456 ((eq? action-name 'placebox) placebox)
457 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
458 ((eq? action-name 'start-line) start-line)
459 ((eq? action-name 'stem) stem)
460 ((eq? action-name 'stop-line) stop-line)
461 ((eq? action-name 'stop-last-line) stop-last-line)
462 ((eq? action-name 'volta) volta)
463 (else (error "unknown tag -- PS-TEX " action-name))
469 (define (ps-scm action-name)
471 ;; alist containing fontname -> fontcommand assoc (both strings)
472 (define font-alist '())
473 (define font-count 0)
474 (define current-font "")
477 (define (cached-fontname i)
480 (make-string 1 (integer->char (+ 65 i)))))
482 (define (mag-to-size m)
483 (number->string (case m
486 (2 14) ; really: 14.400
487 (3 17) ; really: 17.280
488 (4 21) ; really: 20.736
489 (5 24) ; really: 24.888
490 (6 30) ; really: 29.856
494 (define (select-font font-name-symbol)
497 (c (assoc font-name-symbol font-name-alist))
502 (ly-warn (string-append
503 "Programming error: No such font known " (car font-name-symbol)))
504 "") ; issue no command
505 (string-append " " (cdr c) " "))
510 (define (font-load-command name-mag command)
514 (symbol->string (car name-mag))
516 (number->string (magstep (cdr name-mag)))
517 " 1000 div 12 mul scalefont setfont } bind def "
521 (define (beam width slope thick)
523 (numbers->string (list width slope thick)) " draw_beam" ))
526 (string-append "% " s))
528 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
530 (numbers->string (list arch_angle arch_width arch_height width height arch_thick thick)) " draw_bracket" ))
533 (invoke-char " show" i))
535 (define (crescendo thick w h cont )
537 (numbers->string (list w h (inexact->exact cont) thick))
540 ;; what the heck is this interface ?
541 (define (dashed-slur thick dash l)
543 (apply string-append (map control->string l))
544 (number->string thick)
546 (number->string dash)
548 (number->string (* 10 thick)) ;UGH. 10 ?
549 " ] 0 draw_dashed_slur"))
551 (define (dashed-line thick dash width)
553 (number->string width)
555 (number->string thick)
557 (number->string dash)
559 (number->string dash)
560 " ] 0 draw_dashed_line"))
562 (define (decrescendo thick w h cont)
564 (numbers->string (list w h (inexact->exact cont) thick))
565 " draw_decrescendo"))
571 (define (experimental-on) "")
573 (define (filledbox breapth width depth height)
574 (string-append (numbers->string (list breapth width depth height))
578 (define (font-def i s)
581 (substring s 0 (- (string-length s) 4))
582 " findfont 12 scalefont setfont} bind def \n"))
584 (define (font-switch i)
585 (string-append (font i) " "))
589 ;; URG: now we can't use scm output without Lily
590 (ly-gulp-file "lilyponddefs.ps")
591 " {exch pop //systemdict /run get exec} "
592 (ly-gulp-file "lily.ps")
593 "{ exch pop //systemdict /run get exec } "
596 (define (lily-def key val)
598 (if (string=? (substring key 0 (min (string-length "mudelapaper") (string-length key))) "mudelapaper")
599 (string-append "/" key " {" val "} bind def\n")
600 (string-append "/" key " (" val ") def\n")
604 (define (header creator generate)
607 "%%Creator: " creator generate "\n"))
609 (define (invoke-char s i)
611 "(\\" (inexact->string i 8) ") " s " " ))
613 (define (invoke-dim1 s d)
615 (number->string (* d (/ 72.27 72))) " " s ))
617 (define (placebox x y s)
619 (number->string x) " " (number->string y) " {" s "} placebox "))
621 (define (bezier-sandwich l thick)
623 (apply string-append (map control->string l))
624 (number->string thick)
625 " draw_bezier_sandwich"))
627 (define (start-line height)
630 (define (stem breapth width depth height)
631 (string-append (numbers->string (list breapth width depth height))
638 (string-append "(" s ") show "))
641 (define (volta h w thick vert_start vert_end)
643 (numbers->string (list h w thick (inexact->exact vert_start) (inexact->exact vert_end)))
646 (define (tuplet ht gap dx dy thick dir)
648 (numbers->string (list ht gap dx dy thick (inexact->exact dir)))
657 (cond ((eq? action-name 'all-definitions)
660 (define tuplet ,tuplet)
661 (define bracket ,bracket)
663 (define crescendo ,crescendo)
664 (define volta ,volta)
665 (define bezier-sandwich ,bezier-sandwich)
666 (define dashed-line ,dashed-line)
667 (define dashed-slur ,dashed-slur)
668 (define decrescendo ,decrescendo)
669 (define end-output ,end-output)
670 (define experimental-on ,experimental-on)
671 (define filledbox ,filledbox)
672 (define font-def ,font-def)
673 (define font-switch ,font-switch)
674 (define header-end ,header-end)
675 (define lily-def ,lily-def)
676 (define font-load-command ,font-load-command)
677 (define header ,header)
678 (define invoke-char ,invoke-char)
679 (define invoke-dim1 ,invoke-dim1)
680 (define placebox ,placebox)
681 (define select-font ,select-font)
682 (define start-line ,start-line)
684 (define stop-line ,stop-line)
685 (define stop-last-line ,stop-line)
688 ((eq? action-name 'tuplet) tuplet)
689 ((eq? action-name 'beam) beam)
690 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
691 ((eq? action-name 'bracket) bracket)
692 ((eq? action-name 'char) char)
693 ((eq? action-name 'crescendo) crescendo)
694 ((eq? action-name 'dashed-line) dashed-line)
695 ((eq? action-name 'dashed-slur) dashed-slur)
696 ((eq? action-name 'decrescendo) decrescendo)
697 ((eq? action-name 'experimental-on) experimental-on)
698 ((eq? action-name 'filledbox) filledbox)
699 ((eq? action-name 'select-font) select-font)
700 ((eq? action-name 'volta) volta)
701 (else (error "unknown tag -- PS-SCM " action-name))
706 (define (arg->string arg)
707 (cond ((number? arg) (inexact->string arg 10))
708 ((string? arg) (string-append "\"" arg "\""))
709 ((symbol? arg) (string-append "\"" (symbol->string arg) "\""))))
711 (define (func name . args)
717 (map (lambda (x) (string-append " " (arg->string x))) args)))
723 (inexact->exact (/ x (abs x)))))
726 (define (as-scm action-name)
728 (define (beam width slope thick)
730 (func "set-line-char" "#")
731 (func "rline-to" width (* width slope))
735 (define (bezier-sandwich l thick)
742 (dy (- (cdr c3) (cdr c0)))
744 (c1-dx (- (car c1) x))
745 (c1-line-y (+ (cdr c0) (* c1-dx rc)))
746 (dir (if (< c1-line-y (cdr c1)) 1 -1))
747 (y (+ -1 (* dir (max (* dir (cdr c0)) (* dir (cdr c3)))))))
749 (func "rmove-to" x y)
750 (func "put" (if (< 0 dir) "/" "\\\\"))
751 (func "rmove-to" 1 (if (< 0 dir) 1 0))
752 (func "set-line-char" "_")
753 (func "h-line" (- dx 1))
754 (func "rmove-to" (- dx 1) (if (< 0 dir) -1 0))
755 (func "put" (if (< 0 dir) "\\\\" "/"))))))
757 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
759 (func "rmove-to" (+ width 1) (- (/ height -2) 1))
761 (func "set-line-char" "|")
762 (func "rmove-to" 0 1)
763 (func "v-line" (+ height 1))
764 (func "rmove-to" 0 (+ height 1))
774 (define (experimental-on)
777 (define (filledbox breapth width depth height)
778 (let ((dx (+ width breapth))
779 (dy (+ depth height)))
781 (func "rmove-to" (* -1 breapth) (* -1 depth))
784 (func "set-line-char"
785 (if (<= dx 1) "|" "#"))
788 (func "set-line-char"
789 (if (<= dy 1) "-" "="))
790 (func "h-line" dx))))))
792 (define (font-load-command name-mag command)
793 (func "load-font" (car name-mag) (magstep (cdr name-mag))))
795 (define (header creator generate)
796 (func "header" creator generate))
801 ;; urg: this is good for half of as2text's execution time
802 (define (xlily-def key val)
803 (string-append "(define " key " " (arg->string val) ")\n"))
805 (define (lily-def key val)
807 (or (equal? key "mudelapaperlinewidth")
808 (equal? key "mudelapaperstaffheight"))
809 (string-append "(define " key " " (arg->string val) ")\n")
812 (define (placebox x y s)
813 (let ((ey (inexact->exact y)))
814 (string-append "(move-to " (number->string (inexact->exact x)) " "
815 (if (= 0.5 (- (abs y) (abs ey)))
820 (define (select-font font-name-symbol)
821 (let* ((c (assoc font-name-symbol font-name-alist)))
826 "Programming error: No such font known "
827 (car font-name-symbol)))
828 "") ; issue no command
829 (func "select-font" (car font-name-symbol)))))
831 (define (start-line height)
832 (func "start-line" height))
840 (define (volta h w thick vert-start vert-end)
843 (func "set-line-char" "|")
844 (func "rmove-to" 0 -4)
845 ;; definition strange-way around
849 (func "rmove-to" 1 h)
850 (func "set-line-char" "_")
851 (func "h-line" (- w 1))
852 (func "set-line-char" "|")
855 (func "rmove-to" (- w 1) (* -1 h))
856 (func "v-line" (* -1 h)))
859 (cond ((eq? action-name 'all-definitions)
862 (define bracket ,bracket)
864 ;;(define crescendo ,crescendo)
865 (define bezier-sandwich ,bezier-sandwich)
866 ;;(define dashed-slur ,dashed-slur)
867 ;;(define decrescendo ,decrescendo)
868 (define end-output ,end-output)
869 (define experimental-on ,experimental-on)
870 (define filledbox ,filledbox)
871 ;;(define font-def ,font-def)
872 (define font-load-command ,font-load-command)
873 ;;(define font-switch ,font-switch)
874 (define header ,header)
875 (define header-end ,header-end)
876 (define lily-def ,lily-def)
877 ;;(define invoke-char ,invoke-char)
878 ;;(define invoke-dim1 ,invoke-dim1)
879 (define placebox ,placebox)
880 (define select-font ,select-font)
881 (define start-line ,start-line)
882 ;;(define stem ,stem)
883 (define stop-line ,stop-line)
884 (define stop-last-line ,stop-line)
886 ;;(define tuplet ,tuplet)
887 (define volta ,volta)
889 ;;((eq? action-name 'tuplet) tuplet)
890 ;;((eq? action-name 'beam) beam)
891 ;;((eq? action-name 'bezier-sandwich) bezier-sandwich)
892 ;;((eq? action-name 'bracket) bracket)
893 ((eq? action-name 'char) char)
894 ;;((eq? action-name 'crescendo) crescendo)
895 ;;((eq? action-name 'dashed-slur) dashed-slur)
896 ;;((eq? action-name 'decrescendo) decrescendo)
897 ;;((eq? action-name 'experimental-on) experimental-on)
898 ((eq? action-name 'filledbox) filledbox)
899 ((eq? action-name 'select-font) select-font)
900 ;;((eq? action-name 'volta) volta)
901 (else (error "unknown tag -- MUSA-SCM " action-name))
906 (define (gulp-file name)
907 (let* ((port (open-file name "r"))
908 (content (let loop ((text ""))
909 (let ((line (read-line port)))
910 (if (or (eof-object? line)
913 (loop (string-append text line "\n")))))))
917 ;; urg: Use when standalone, do:
918 ;; (define (ly-gulp-file name) (scm-gulp-file name))
919 (define (scm-gulp-file name)
921 (cons (string-append (getenv 'LILYPONDPREFIX) "/ly")
922 (cons (string-append (getenv 'LILYPONDPREFIX) "/ps")
924 (let ((path (%search-load-path name)))
929 (define (scm-tex-output)
930 (eval (tex-scm 'all-definitions)))
932 (define (scm-ps-output)
933 (eval (ps-scm 'all-definitions)))
935 (define (scm-as-output)
936 (eval (as-scm 'all-definitions)))
938 (define (index-cell cell dir)
944 ; How should a bar line behave at a break?
946 (define (break-barline glyph dir)
947 (let ((result (assoc glyph
948 '((":|:" . (":|" . "|:"))
951 ("|:" . ("|" . "|:"))
952 ("|." . ("|." . nil))
953 (":|" . (":|" . nil))
954 ("||" . ("||" . nil))
955 (".|." . (".|." . nil))
956 ("scorebar" . (nil . "scorepostbreak"))
957 ("brace" . (nil . "brace"))
958 ("bracket" . (nil . "bracket"))
962 (if (equal? result #f)
963 (ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
964 (index-cell (cdr result) dir))