X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=init%2Flily.scm;h=d0f1dc57fbba23669002c41c5384b71b35453cf2;hb=8ef3c0a1a21dfa4d86481130b9a61bbdd27d9e22;hp=ce384d2617486c52388d59063be5a846e98c0b03;hpb=b4d5d1145b0d59ae1ac42c9bc9c43c6d5b055c1c;p=lilypond.git diff --git a/init/lily.scm b/init/lily.scm index ce384d2617..d0f1dc57fb 100644 --- a/init/lily.scm +++ b/init/lily.scm @@ -4,6 +4,11 @@ ; ; (c) 1998 Jan Nieuwenhuizen +; TODO +; - naming +; - ready ps code (draw_bracket) vs tex/ps macros/calls (pianobrace), +; all preparations from ps,tex to scm + ;;; graphical lisp element (define (add-column p) (display "adding column (in guile): ") (display p) (newline)) @@ -37,6 +42,30 @@ (string-append (number->string (car c)) " ") (string-append (number->string (cadr c)) " "))) +(define + (embedded-ps-tex s) + (string-append "\\embeddedps{" s "}")) + +(define + (invoke-char-ps s i) + (string-append + "(\\" (inexact->string i 8) ") " s " " )) + +(define + (invoke-char-tex s i) + (string-append + "\n\\" s "{" (inexact->string i 10) "}" )) + +(define + (invoke-dim1-ps s d) + (string-append + (number->string d) " " s )) + +(define + (invoke-dim1-tex s d) + (string-append + "\n\\" s "{" (number->dim-tex d) "}")) + (define (invoke-output o s) (eval-string (string-append s "-" o))) @@ -54,27 +83,23 @@ (define (beam-tex width slope thick) - (string-append - "\\embeddedps{" - (beam-ps width slope thick) - "}")) + (embedded-ps-tex (beam-ps width slope thick))) (define - (bracket o h) (empty o)) + (bracket o h) + ((invoke-output o "bracket") h)) (define - (char o n) - ((invoke-output o "char") n)) + (bracket-ps h) + (invoke-dim1-ps "draw_bracket" h)) (define - (char-ps n) - (string-append - "(\\" (inexact->string n 8) ") show")) + (bracket-tex h) + (embedded-ps-tex (bracket-ps h))) (define - (char-tex n) - (string-append - "\\char" (inexact->string n 10))) + (char o n) + ((invoke-output o "invoke-char") "show" n)) (define (dashed-slur o thick dash l) @@ -92,10 +117,11 @@ (define (dashed-slur-tex thick dash l) - (string-append - "\\embeddedps{" - (dashed-slur-ps thick dash l) - "}")) + (embedded-ps-tex (dashed-slur-ps thick dash l))) + +(define + (doublebar o h) + ((invoke-output o "invoke-dim1") "doublebar" h)) (define (empty o) @@ -109,6 +135,9 @@ (empty-tex) "%\n\\empty%\n") +(define + (emptybar o h) (empty o)) + (define (end-output o) ((invoke-output o "end-output"))) @@ -132,7 +161,8 @@ (experimental-on-tex) "\\turnOnExperimentalFeatures") (define - (finishbar o h) (empty o)) + (finishbar o h) + ((invoke-output o "invoke-dim1") "finishbar" h)) (define (font i) @@ -143,8 +173,8 @@ (define (font-def o i s) - (empty o)) -; ((invoke-output o "font-def") i s)) + ((invoke-output o "font-def") i s)) +; (empty o)) (define (font-def-ps i s) @@ -225,20 +255,11 @@ (define (maatstreep o h) - ((invoke-output o "maatstreep") h)) + ((invoke-output o "invoke-dim1") "maatstreep" h)) (define - (maatstreep-ps h) - (string-append - (number->string h) " maatstreep " )) - -(define - (maatstreep-tex h) - (string-append - "\n\\maatstreep{" (number->dim-tex h) "}")) - -(define - (pianobrace o h) (empty o)) + (pianobrace o i) + ((invoke-output o "invoke-char") "pianobrace" i)) (define (placebox o x y b) @@ -256,7 +277,12 @@ (number->dim-tex y) "}{" (number->dim-tex x) "}{" s "}")) (define - (repeatbar o h) (empty o)) + (repeatbar o h) + ((invoke-output o "invoke-dim1") "repeatbar" h)) + +(define + (repeatbarstartrepeat o h) + ((invoke-output o "invoke-dim1") "repeatbarstartrepeat" h)) (define (rulesym o x y) @@ -301,10 +327,18 @@ (setLarge o s) ((invoke-output o "text") "Large" s)) +(define + (setnumber o s) + ((invoke-output o "text") "number" s)) + (define (settext o s) ((invoke-output o "text") "text" s)) +(define + (settypewriter o s) + ((invoke-output o "text") "typewriter" s)) + (define (slur o l) ((invoke-output o "slur") l)) @@ -317,10 +351,7 @@ (define (slur-tex l) - (string-append - "\\embeddedps{" - (slur-ps l) - "}")) + (embedded-ps-tex (slur-ps l))) (define (stem o kern width height depth) @@ -356,7 +387,8 @@ "\\hbox{%\n")) (define - (startrepeat o h) (empty o)) + (startrepeat o h) + ((invoke-output o "invoke-dim1") "startrepeat" h)) (define (stop-line o) @@ -371,7 +403,8 @@ "}\\interscoreline") (define - (stoprepeat o h) (empty o)) + (stoprepeat o h) + ((invoke-output o "invoke-dim1") "stoprepeat" h)) (define (text-ps f s)