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>
8 ;(debug-enable 'backtrace)
12 (use-modules (ice-9 regex))
14 ;; do nothing in .scm output
15 (define (comment s) "")
21 (define (cons-map f x)
22 (cons (f (car x)) (f (cdr x))))
24 (define (reduce operator list)
25 (if (null? (cdr list)) (car list)
26 (operator (car list) (reduce operator (cdr list)))
30 (define (glue-2-strings a b)
31 (string-append a " " b))
33 (define (numbers->string l)
34 (reduce glue-2-strings (map number->string l)))
36 (define (chop-decimal x) (if (< (abs x) 0.001) 0.0 x))
38 (define (number->octal-string x)
39 (let* ((n (inexact->exact x))
41 (n8 (quotient (- n (* n64 64)) 8)))
45 (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8)))))
47 (define (inexact->string x radix)
48 (let ((n (inexact->exact x)))
49 (number->string n radix)))
55 (string-append (number->string (car c)) " ")
56 (string-append (number->string (cdr c)) " ")))
62 (make-string 1 (integer->char (+ (char->integer #\A) i)))
67 (define (scm-scm action-name)
70 (define security-paranoia #f)
73 ;; See documentation of Item::visibility_lambda_
74 (define (begin-of-line-visible d) (if (= d 1) '(#f . #f) '(#t . #t)))
75 (define (spanbar-begin-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
76 (define (all-visible d) '(#f . #f))
77 (define (begin-of-line-invisible d) (if (= d 1) '(#t . #t) '(#f . #f)))
78 (define (end-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
81 ;; Score_span_bars are only visible at start of line
82 ;; i.e. if break_dir == RIGHT == 1
83 (define Span_bar_engraver-visibility begin-of-line-invisible)
84 (define Base_span_bar_engraver-visibility begin-of-line-invisible)
85 (define mark-visibility end-of-line-invisible)
86 (define Span_score_bar_engraver-visibility begin-of-line-visible)
87 (define Piano_bar_engraver-visibility begin-of-line-visible)
88 (define Staff_group_bar_engraver-visibility begin-of-line-visible)
90 ;; Spacing constants for prefatory matter.
92 ;; rules for this spacing are much more complicated than this. See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147
96 ;; (Measured in staff space)
99 (("" "Clef_item") . (minimum-space 1.0))
100 (("" "Staff_bar") . (minimum-space 0.0))
101 (("" "Clef_item") . (minimum-space 1.0))
102 (("" "Key_item") . (minimum-space 0.5))
103 (("" "Span_bar") . (extra-space 0.0))
104 (("" "Time_signature") . (extra-space 0.0))
105 (("" "begin-of-note") . (minimum-space 1.5))
106 (("Clef_item" "Key_item") . (minimum-space 4.0))
107 (("Key_item" "Time_signature") . (extra-space 1.0))
108 (("Clef_item" "Time_signature") . (minimum-space 3.5))
109 (("Staff_bar" "Clef_item") . (minimum-space 1.0))
110 (("Clef_item" "Staff_bar") . (minimum-space 3.7))
111 (("Time_signature" "Staff_bar") . (minimum-space 2.0))
112 (("Key_item" "Staff_bar") . (extra-space 1.0))
113 (("Span_bar" "Clef_item") . (extra-space 1.0))
114 (("Clef_item" "Span_bar") . (minimum-space 3.7))
115 (("Time_signature" "Span_bar") . (minimum-space 2.0))
116 (("Key_item" "Span_bar") . (minimum-space 2.5))
117 (("Staff_bar" "Time_signature") . (minimum-space 1.5)) ;double check this.
118 (("Time_signature" "begin-of-note") . (extra-space 2.0)) ;double check this.
119 (("Key_item" "begin-of-note") . (extra-space 2.5))
120 (("Staff_bar" "begin-of-note") . (extra-space 1.0))
121 (("Clef_item" "begin-of-note") . (minimum-space 5.0))
122 (("" "Breathing_sign") . (minimum-space 0.0))
123 (("Breathing_sign" "Key_item") . (minimum-space 1.5))
124 (("Breathing_sign" "begin-of-note") . (minimum-space 1.0))
125 (("Breathing_sign" "Staff_bar") . (minimum-space 1.5))
126 (("Breathing_sign" "Clef_item") . (minimum-space 2.0))
130 (define (break-align-spacer this next)
131 (let ((entry (assoc `(,this ,next) space-alist)))
134 (begin (ly-warn (string-append "Unknown spacing pair `" this "', `" next "'"))
135 '(minimum-space 0.0)))))
141 ;; this is silly, can't we use something like
142 ;; roman-0, roman-1 roman+1 ?
145 ("brace" . "feta-braces")
146 ("default" . "cmr10")
147 ("dynamic" . "feta-din")
151 ("finger" . "feta-nummer")
152 ("typewriter" . "cmtt")
158 ("mark" . "feta-nummer")
159 ("number" . "feta-nummer")
160 ("volta" . "feta-nummer"))
163 (define (string-encode-integer i)
166 ((< i 0) (string-append "n" (string-encode-integer (- i))))
168 (make-string 1 (integer->char (+ 65 (modulo i 26))))
169 (string-encode-integer (quotient i 26))
176 (cdr (assoc i '((-4 . 482)
189 (define script-alist '())
190 (define (articulation-to-scriptdef a)
191 (assoc a script-alist)
194 ;; Map style names to TeX font names. Return false if
195 ;; no font name found.
196 (define (style-to-cmr s)
202 (define font-name-alist '())
203 (define (font-command name-mag)
205 (string-append "magfont"
206 (string-encode-integer (hashq (car name-mag) 1000000))
208 (string-encode-integer (cdr name-mag)))
212 (define (define-fonts names)
213 (set! font-name-alist (map font-command names))
216 (font-load-command (car x) (cdr x))) font-name-alist)
219 (define (fontify name exp)
220 (string-append (select-font name)
227 ; Make a function that checks score element for being of a specific type.
228 (define (make-type-checker name)
230 (not (not (memq name (ly-get-elt-property elt 'interfaces))))))
241 ;;;;;;;;;;;;;;;;;;; generic output
243 (define (translate-molecule offset)
247 ;;;;;;;;;;;;;;;;;;; TeX output
248 (define (tex-scm action-name)
253 (define (select-font font-name-symbol)
256 (c (assoc font-name-symbol font-name-alist))
261 (ly-warn (string-append
262 "Programming error: No such font known " (car font-name-symbol)))
263 "") ; issue no command
264 (string-append "\\" (cdr c)))
269 (define (beam width slope thick)
270 (embedded-ps ((ps-scm 'beam) width slope thick)))
272 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
273 (embedded-ps ((ps-scm 'bracket) arch_angle arch_width arch_height width height arch_thick thick)))
275 (define (dashed-slur thick dash l)
276 (embedded-ps ((ps-scm 'dashed-slur) thick dash l)))
278 (define (crescendo thick w h cont)
279 (embedded-ps ((ps-scm 'crescendo) thick w h cont)))
282 (string-append "\\char" (inexact->string i 10) " "))
284 (define (dashed-line thick dash w)
285 (embedded-ps ((ps-scm 'dashed-line) thick dash w)))
287 (define (decrescendo thick w h cont)
288 (embedded-ps ((ps-scm 'decrescendo) thick w h cont)))
290 ;This sets CTM so that you get to the currentpoint
291 ; by executing a 0 0 moveto
296 (define (font-load-command name-mag command)
298 "\\font\\" command "="
299 (symbol->string (car name-mag))
301 (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 ;(ly-gulp-file "lily.ps")
331 (regexp-substitute/global #f "\n" (ly-gulp-file "lily.ps") 'pre " %\n" 'post)
333 "\\input lilyponddefs \\turnOnPostScript"))
335 (define (header creator generate)
337 "%created by: " creator generate "\n"))
339 (define (invoke-char s i)
341 "\n\\" s "{" (inexact->string i 10) "}" ))
343 (define (invoke-dim1 s d)
345 "\n\\" s "{" (number->dim d) "}"))
350 ;; need to do something to make this really safe.
352 (define (output-tex-string s)
353 (if security-paranoia
354 (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
357 (define (lily-def key val)
361 (regexp-substitute/global #f "_" (output-tex-string key) 'pre "X" 'post)
362 ;(output-tex-string key)
363 "{" (output-tex-string val) "}\n"))
365 (define (number->dim x)
367 (number->string (chop-decimal x)) " pt "))
369 (define (placebox x y s)
372 (number->dim y) "}{" (number->dim x) "}{" s "}\n"))
374 (define (bezier-sandwich l thick)
375 (embedded-ps ((ps-scm 'bezier-sandwich) l thick)))
377 (define (start-line ht)
378 (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
381 "}\\vss}\\interscoreline")
382 (define (stop-last-line)
384 (define (filledbox breapth width depth height)
386 "\\kern" (number->dim (- breapth))
387 "\\vrule width " (number->dim (+ breapth width))
388 "depth " (number->dim depth)
389 "height " (number->dim height) " "))
392 (string-append "\\hbox{" (output-tex-string s) "}"))
394 (define (tuplet ht gapx dx dy thick dir)
395 (embedded-ps ((ps-scm 'tuplet) ht gapx dx dy thick dir)))
397 (define (volta h w thick vert_start vert_end)
398 (embedded-ps ((ps-scm 'volta) h w thick vert_start vert_end)))
401 ;; The procedures listed below form the public interface of TeX-scm.
402 ;; (should merge the 2 lists)
403 (cond ((eq? action-name 'all-definitions)
405 (define font-load-command ,font-load-command)
407 (define bezier-sandwich ,bezier-sandwich)
408 (define bracket ,bracket)
410 (define crescendo ,crescendo)
411 (define dashed-line ,dashed-line)
412 (define dashed-slur ,dashed-slur)
413 (define decrescendo ,decrescendo)
414 (define end-output ,end-output)
415 (define experimental-on ,experimental-on)
416 (define filledbox ,filledbox)
417 (define font-def ,font-def)
418 (define font-switch ,font-switch)
419 (define header-end ,header-end)
420 (define lily-def ,lily-def)
421 (define header ,header)
422 (define invoke-char ,invoke-char)
423 (define invoke-dim1 ,invoke-dim1)
424 (define placebox ,placebox)
425 (define select-font ,select-font)
426 (define start-line ,start-line)
427 (define stop-line ,stop-line)
428 (define stop-last-line ,stop-last-line)
430 (define tuplet ,tuplet)
431 (define volta ,volta)
434 ((eq? action-name 'beam) beam)
435 ((eq? action-name 'tuplet) tuplet)
436 ((eq? action-name 'bracket) bracket)
437 ((eq? action-name 'crescendo) crescendo)
438 ((eq? action-name 'dashed-line) dashed-line)
439 ((eq? action-name 'dashed-slur) dashed-slur)
440 ((eq? action-name 'decrescendo) decrescendo)
441 ((eq? action-name 'end-output) end-output)
442 ((eq? action-name 'experimental-on) experimental-on)
443 ((eq? action-name 'font-def) font-def)
444 ((eq? action-name 'font-switch) font-switch)
445 ((eq? action-name 'header-end) header-end)
446 ((eq? action-name 'lily-def) lily-def)
447 ((eq? action-name 'header) header)
448 ((eq? action-name 'invoke-char) invoke-char)
449 ((eq? action-name 'invoke-dim1) invoke-dim1)
450 ((eq? action-name 'placebox) placebox)
451 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
452 ((eq? action-name 'start-line) start-line)
453 ((eq? action-name 'stem) stem)
454 ((eq? action-name 'stop-line) stop-line)
455 ((eq? action-name 'stop-last-line) stop-last-line)
456 ((eq? action-name 'volta) volta)
457 (else (error "unknown tag -- PS-TEX " action-name))
463 (define (ps-scm action-name)
466 ;; alist containing fontname -> fontcommand assoc (both strings)
467 (define font-alist '())
468 (define font-count 0)
469 (define current-font "")
472 (define (cached-fontname i)
475 (make-string 1 (integer->char (+ 65 i)))))
477 (define (mag-to-size m)
478 (number->string (case m
481 (2 14) ; really: 14.400
482 (3 17) ; really: 17.280
483 (4 21) ; really: 20.736
484 (5 24) ; really: 24.888
485 (6 30) ; really: 29.856
489 (define (select-font font-name-symbol)
492 (c (assoc font-name-symbol font-name-alist))
497 (ly-warn (string-append
498 "Programming error: No such font known " (car font-name-symbol)))
499 "") ; issue no command
500 (string-append " " (cdr c) " "))
505 (define (font-load-command name-mag command)
509 (symbol->string (car name-mag))
511 (number->string (magstep (cdr name-mag)))
512 " 1000 div 12 mul scalefont setfont } bind def "
516 (define (beam width slope thick)
518 (numbers->string (list width slope thick)) " draw_beam" ))
521 (string-append "% " s))
523 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
525 (numbers->string (list arch_angle arch_width arch_height width height arch_thick thick)) " draw_bracket" ))
528 (invoke-char " show" i))
530 (define (crescendo thick w h cont )
532 (numbers->string (list w h (inexact->exact cont) thick))
535 ;; what the heck is this interface ?
536 (define (dashed-slur thick dash l)
538 (apply string-append (map control->string l))
539 (number->string thick)
541 (number->string dash)
543 (number->string (* 10 thick)) ;UGH. 10 ?
544 " ] 0 draw_dashed_slur"))
546 (define (dashed-line thick dash width)
548 (number->string width)
550 (number->string thick)
552 (number->string dash)
554 (number->string dash)
555 " ] 0 draw_dashed_line"))
557 (define (decrescendo thick w h cont)
559 (numbers->string (list w h (inexact->exact cont) thick))
560 " draw_decrescendo"))
566 (define (experimental-on) "")
568 (define (filledbox breapth width depth height)
569 (string-append (numbers->string (list breapth width depth height))
573 (define (font-def i s)
576 (substring s 0 (- (string-length s) 4))
577 " findfont 12 scalefont setfont} bind def \n"))
579 (define (font-switch i)
580 (string-append (font i) " "))
584 (ly-gulp-file "lilyponddefs.ps")
585 " {exch pop //systemdict /run get exec} "
586 (ly-gulp-file "lily.ps")
587 "{ exch pop //systemdict /run get exec } "
590 (define (lily-def key val)
592 (if (string=? (substring key 0 (min (string-length "mudelapaper") (string-length key))) "mudelapaper")
593 (string-append "/" key " {" val "} bind def\n")
594 (string-append "/" key " (" val ") def\n")
598 (define (header creator generate)
601 "%%Creator: " creator generate "\n"))
603 (define (invoke-char s i)
605 "(\\" (inexact->string i 8) ") " s " " ))
607 (define (invoke-dim1 s d)
609 (number->string (* d (/ 72.27 72))) " " s ))
611 (define (placebox x y s)
613 (number->string x) " " (number->string y) " {" s "} placebox "))
615 (define (bezier-sandwich l thick)
617 (apply string-append (map control->string l))
618 (number->string thick)
619 " draw_bezier_sandwich"))
621 (define (start-line height)
624 (define (stem breapth width depth height)
625 (string-append (numbers->string (list breapth width depth height))
632 (string-append "(" s ") show "))
635 (define (volta h w thick vert_start vert_end)
637 (numbers->string (list h w thick (inexact->exact vert_start) (inexact->exact vert_end)))
640 (define (tuplet ht gap dx dy thick dir)
642 (numbers->string (list ht gap dx dy thick (inexact->exact dir)))
651 (cond ((eq? action-name 'all-definitions)
654 (define tuplet ,tuplet)
655 (define bracket ,bracket)
657 (define crescendo ,crescendo)
658 (define volta ,volta)
659 (define bezier-sandwich ,bezier-sandwich)
660 (define dashed-line ,dashed-line)
661 (define dashed-slur ,dashed-slur)
662 (define decrescendo ,decrescendo)
663 (define end-output ,end-output)
664 (define experimental-on ,experimental-on)
665 (define filledbox ,filledbox)
666 (define font-def ,font-def)
667 (define font-switch ,font-switch)
668 (define header-end ,header-end)
669 (define lily-def ,lily-def)
670 (define font-load-command ,font-load-command)
671 (define header ,header)
672 (define invoke-char ,invoke-char)
673 (define invoke-dim1 ,invoke-dim1)
674 (define placebox ,placebox)
675 (define select-font ,select-font)
676 (define start-line ,start-line)
678 (define stop-line ,stop-line)
679 (define stop-last-line ,stop-line)
682 ((eq? action-name 'tuplet) tuplet)
683 ((eq? action-name 'beam) beam)
684 ((eq? action-name 'bezier-sandwich) bezier-sandwich)
685 ((eq? action-name 'bracket) bracket)
686 ((eq? action-name 'char) char)
687 ((eq? action-name 'crescendo) crescendo)
688 ((eq? action-name 'dashed-line) dashed-line)
689 ((eq? action-name 'dashed-slur) dashed-slur)
690 ((eq? action-name 'decrescendo) decrescendo)
691 ((eq? action-name 'experimental-on) experimental-on)
692 ((eq? action-name 'filledbox) filledbox)
693 ((eq? action-name 'select-font) select-font)
694 ((eq? action-name 'volta) volta)
695 (else (error "unknown tag -- PS-SCM " action-name))
700 (define (arg->string arg)
701 (cond ((number? arg) (inexact->string arg 10))
702 ((string? arg) (string-append "\"" arg "\""))
703 ((symbol? arg) (string-append "\"" (symbol->string arg) "\""))))
705 (define (func name . args)
711 (map (lambda (x) (string-append " " (arg->string x))) args)))
717 (inexact->exact (/ x (abs x)))))
720 (define (as-scm action-name)
722 (define (beam width slope thick)
724 (func "set-line-char" "#")
725 (func "rline-to" width (* width slope))
729 (define (bezier-sandwich l thick)
736 (dy (- (cdr c3) (cdr c0)))
738 (c1-dx (- (car c1) x))
739 (c1-line-y (+ (cdr c0) (* c1-dx rc)))
740 (dir (if (< c1-line-y (cdr c1)) 1 -1))
741 (y (+ -1 (* dir (max (* dir (cdr c0)) (* dir (cdr c3)))))))
743 (func "rmove-to" x y)
744 (func "put" (if (< 0 dir) "/" "\\\\"))
745 (func "rmove-to" 1 (if (< 0 dir) 1 0))
746 (func "set-line-char" "_")
747 (func "h-line" (- dx 1))
748 (func "rmove-to" (- dx 1) (if (< 0 dir) -1 0))
749 (func "put" (if (< 0 dir) "\\\\" "/"))))))
751 (define (bracket arch_angle arch_width arch_height width height arch_thick thick)
753 (func "rmove-to" (+ width 1) (- (/ height -2) 1))
755 (func "set-line-char" "|")
756 (func "rmove-to" 0 1)
757 (func "v-line" (+ height 1))
758 (func "rmove-to" 0 (+ height 1))
768 (define (experimental-on)
771 (define (filledbox breapth width depth height)
772 (let ((dx (+ width breapth))
773 (dy (+ depth height)))
775 (func "rmove-to" (* -1 breapth) (* -1 depth))
778 (func "set-line-char"
779 (if (<= dx 1) "|" "#"))
782 (func "set-line-char"
783 (if (<= dy 1) "-" "="))
784 (func "h-line" dx))))))
786 (define (font-load-command name-mag command)
787 (func "load-font" (car name-mag) (magstep (cdr name-mag))))
789 (define (header creator generate)
790 (func "header" creator generate))
795 ;; urg: this is good for half of as2text's execution time
796 (define (xlily-def key val)
797 (string-append "(define " key " " (arg->string val) ")\n"))
799 (define (lily-def key val)
801 (or (equal? key "mudelapaperlinewidth")
802 (equal? key "mudelapaperstaffheight"))
803 (string-append "(define " key " " (arg->string val) ")\n")
806 (define (placebox x y s)
807 (let ((ey (inexact->exact y)))
808 (string-append "(move-to " (number->string (inexact->exact x)) " "
809 (if (= 0.5 (- (abs y) (abs ey)))
814 (define (select-font font-name-symbol)
815 (let* ((c (assoc font-name-symbol font-name-alist)))
820 "Programming error: No such font known "
821 (car font-name-symbol)))
822 "") ; issue no command
823 (func "select-font" (car font-name-symbol)))))
825 (define (start-line height)
826 (func "start-line" height))
834 (define (volta h w thick vert-start vert-end)
837 (func "set-line-char" "|")
838 (func "rmove-to" 0 -4)
839 ;; definition strange-way around
843 (func "rmove-to" 1 h)
844 (func "set-line-char" "_")
845 (func "h-line" (- w 1))
846 (func "set-line-char" "|")
849 (func "rmove-to" (- w 1) (* -1 h))
850 (func "v-line" (* -1 h)))
853 (cond ((eq? action-name 'all-definitions)
856 (define bracket ,bracket)
858 ;;(define crescendo ,crescendo)
859 (define bezier-sandwich ,bezier-sandwich)
860 ;;(define dashed-slur ,dashed-slur)
861 ;;(define decrescendo ,decrescendo)
862 (define end-output ,end-output)
863 (define experimental-on ,experimental-on)
864 (define filledbox ,filledbox)
865 ;;(define font-def ,font-def)
866 (define font-load-command ,font-load-command)
867 ;;(define font-switch ,font-switch)
868 (define header ,header)
869 (define header-end ,header-end)
870 (define lily-def ,lily-def)
871 ;;(define invoke-char ,invoke-char)
872 ;;(define invoke-dim1 ,invoke-dim1)
873 (define placebox ,placebox)
874 (define select-font ,select-font)
875 (define start-line ,start-line)
876 ;;(define stem ,stem)
877 (define stop-line ,stop-line)
878 (define stop-last-line ,stop-line)
880 ;;(define tuplet ,tuplet)
881 (define volta ,volta)
883 ;;((eq? action-name 'tuplet) tuplet)
884 ;;((eq? action-name 'beam) beam)
885 ;;((eq? action-name 'bezier-sandwich) bezier-sandwich)
886 ;;((eq? action-name 'bracket) bracket)
887 ((eq? action-name 'char) char)
888 ;;((eq? action-name 'crescendo) crescendo)
889 ;;((eq? action-name 'dashed-slur) dashed-slur)
890 ;;((eq? action-name 'decrescendo) decrescendo)
891 ;;((eq? action-name 'experimental-on) experimental-on)
892 ((eq? action-name 'filledbox) filledbox)
893 ((eq? action-name 'select-font) select-font)
894 ;;((eq? action-name 'volta) volta)
895 (else (error "unknown tag -- MUSA-SCM " action-name))
900 (define (gulp-file name)
901 (let* ((port (open-file name "r"))
902 (content (let loop ((text ""))
903 (let ((line (read-line port)))
904 (if (or (eof-object? line)
907 (loop (string-append text line "\n")))))))
911 (define (scm-gulp-file name)
914 (getenv 'LILYPONDPREFIX) "/ps") %load-path))
915 (let ((path (%search-load-path name)))
920 (define (scm-tex-output)
921 (eval (tex-scm 'all-definitions)))
923 (define (scm-ps-output)
924 (eval (ps-scm 'all-definitions)))
926 (define (scm-as-output)
927 (eval (as-scm 'all-definitions)))
929 ; Russ McManus, <mcmanus@IDT.NET>
931 ; I use the following, which should definitely be provided somewhere
932 ; in guile, but isn't, AFAIK:
936 (define (hash-table-for-each fn ht)
938 ((= i (vector-length ht)))
939 (do ((alist (vector-ref ht i) (cdr alist)))
941 (fn (car (car alist)) (cdr (car alist))))))
943 (define (hash-table-map fn ht)
946 ((= i (vector-length ht)) (reverse ret-ls))
947 (do ((alist (vector-ref ht i) (cdr alist)))
949 (set! ret-ls (cons (fn (car (car alist)) (cdr (car alist))) ret-ls)))))
953 (define (index-cell cell dir)
959 ; How should a bar line behave at a break?
961 (define (break-barline glyph dir)
962 (let ((result (assoc glyph
963 '((":|:" . (":|" . "|:"))
966 ("|:" . ("|" . "|:"))
967 ("|." . ("|." . nil))
968 (":|" . (":|" . nil))
969 ("||" . ("||" . nil))
970 (".|." . (".|." . nil))
971 ("scorebar" . (nil . "scorepostbreak"))
972 ("brace" . (nil . "brace"))
973 ("bracket" . (nil . "bracket"))
977 (if (equal? result #f)
978 (ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
979 (index-cell (cdr result) dir))
984 (define (slur-ugly ind ht)
989 (> ht (+ (* 2 ind) -4))
990 (< ht (+ (* -2 ind) 8)))