From: Jan Nieuwenhuizen Date: Mon, 2 Nov 1998 17:09:59 +0000 (+0100) Subject: patch::: 1.1.1.jcn1: Re: geil X-Git-Tag: release/1.1.2~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=96c20e0d65d98ac10fb2ed72c14f478bdaa33e81;p=lilypond.git patch::: 1.1.1.jcn1: Re: geil pl 0.jcn4 -set: export GUILE_LOAD_PATH=$HOME/usr/src/lilypond/init - dstream: Score_element, Column_info - -fscm debug hack: lilypond -fscm a; guile a.scm > a.tex; tex a - init/lily.scm --- diff --git a/Documentation/tex/feta.tex b/Documentation/tex/feta.tex index cf2f881c94..032c1dcf69 100644 --- a/Documentation/tex/feta.tex +++ b/Documentation/tex/feta.tex @@ -11,8 +11,11 @@ \font\fetanumber = feta-nummer12 \font\fetafinger = feta-nummer5 \font\fetadyn = feta-din10 scaled \magstep 2 +\font\title = cmbx12 scaled \magstep 4 +\font\subtitle = cmr9 -\def\setchar#1#2{\hbox to\charwidth{\hss{#1\char#2}}} +\def\lilyfooter{Lily was here, 1.1.0} +\def\setchar#1#2{\hbox to\charwidth{\hss{#1\char#2}\hss}} \def\charsperline{6} \def\charheight{55pt} @@ -25,12 +28,19 @@ \loop\ifnum\n<#3 \advance\n by\charsperline \i=0 - \vbox to\charheight{\vss\hbox{ + {\vbox to\charheight{\vss\centerline{ {\loop\ifnum\i<\charsperline \advance\i by1 \advance\n by1 {\setchar{#1}{\number\n}} - \repeat}}}\repeat} + \repeat}}}}\repeat} + + +\centerline{\title FETA} + +\centerline{\subtitle (definately not an abbreviation for Font-En-Tja)} + +\vskip5mm \listfont{\fetatwenty}{0}{78} % urg @@ -43,4 +53,6 @@ \listfont{\fetadyn}{0}{6} \vskip-\charheight +\lilyfooter + \bye diff --git a/NEWS b/NEWS index c11ce8fd55..6b9b37174d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +pl 0.jcn4 + -set: + export GUILE_LOAD_PATH=$HOME/usr/src/lilypond/init + - dstream: Score_element, Column_info + - -fscm debug hack: lilypond -fscm a; guile a.scm > a.tex; tex a + - init/lily.scm + pl 0.uu5 - fixed MIDI output. diff --git a/VERSION b/VERSION index deeabc172b..6ad281102e 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 PATCH_LEVEL=1 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/dstreamrc b/dstreamrc index 2d4ef5938b..330a276b84 100644 --- a/dstreamrc +++ b/dstreamrc @@ -41,9 +41,8 @@ Clef_item 1 Clef_change_req 1 Col_configuration 1 Col_hpositions 1 -Colinfo 1 -Colinfo 1 Collision 1 +Column_info 1 Column_rod 1 Duration_identifier 1 Engraver 0 @@ -92,7 +91,7 @@ Rhythmic_req 1 Scope 1 Score 0 Score_column 0 -Score_elem 0 +Score_element 0 Score_engraver 0 Score_performer 1 Script_column 1 diff --git a/init/GNUmakefile b/init/GNUmakefile index 7b213816c7..105ca5fc69 100644 --- a/init/GNUmakefile +++ b/init/GNUmakefile @@ -3,7 +3,8 @@ depth = .. INI_FILES = $(FLY_FILES) $(LY_FILES) -# DIST_FILES = Makefile $(INI_FILES) +SCM_FILES = $(wildcard *.scm) +EXTRA_DIST_FILES = $(SCM_FILES) INSTALLATION_DIR=$(datadir)/ly/ INSTALLATION_FILES=$(INI_FILES) diff --git a/init/lily.scm b/init/lily.scm new file mode 100644 index 0000000000..cc47c8e573 --- /dev/null +++ b/init/lily.scm @@ -0,0 +1,389 @@ +; lily.scm -- implement Scheme output routines for TeX and PostScript +; +; source file of the GNU LilyPond music typesetter +; +; (c) 1998 Jan Nieuwenhuizen + +;;; graphical lisp element +(define (add-column p) (display "adding column (in guile): ") (display p) (newline)) + +;;; library funtions +(define + (numbers->string l) + (apply string-append + (map (lambda (n) (string-append (number->string n) " ")) l))) + +(define (number->octal-string x) + (let* ((n (inexact->exact x)) + (n64 (quotient n 64)) + (n8 (quotient (- n (* n64 64)) 8))) + (string-append + (number->string n64) + (number->string n8) + (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8))))) + +(define (inexact->string x radix) + (let ((n (inexact->exact x))) + (number->string n radix))) + +(define + (number->dim-tex x) + (string-append + (number->string x) "pt ")) + +(define + (control->string c) + (string-append + (string-append (number->string (car c)) " ") + (string-append (number->string (cadr c)) " "))) + +(define + (invoke-output o s) + (eval-string (string-append s "-" o))) + +;;; output definitions + +(define + (beam o width slope thick) + ((invoke-output o "beam") width slope thick)) + +(define + (beam-ps width slope thick) + (string-append + (numbers->string (list width slope thick)) " draw_beam " )) + +(define + (beam-tex width slope thick) + (string-append + "\\embeddedps{" + (beam-ps width slope thick) + "}")) + +(define + (char o n) + ((invoke-output o "char") n)) + +(define + (char-ps n) + (string-append + "(\\" (inexact->string n 8) ") show")) + +(define + (char-tex n) + (string-append + "\\char" (inexact->string n 10))) + +(define + (dashed-slur o thick dash l) + ((invoke-output o "dashed-slur") thick dash l)) + +(define + (dashed-slur-ps thick dash l) + (string-append + (apply string-append (map control->string l)) + (number->string thick) + " [ " + (if (> 1 dash) (number->string (- (* thick dash) thick)) "0") " " + (number->string (* 2 thick)) + " ] 0 draw_dashed_slur")) + +(define + (dashed-slur-tex thick dash l) + (string-append + "\\embeddedps{" + (dashed-slur-ps thick dash l) + "}")) + +(define + (empty o) + ((invoke-output o "empty"))) + +(define + (empty-ps) + "\n empty\n") + +(define + (empty-tex) + "%\n\\empty%\n") + +(define + (end-output o) + ((invoke-output o "end-output"))) + +(define + (end-output-ps) + "\nshowpage\n") + +(define + (end-output-tex) + "\n\\EndLilyPondOutput") + +(define + (experimental-on o) + ((invoke-output o "experimental-on"))) + +(define + (experimental-on-ps) "") + +(define + (experimental-on-tex) "\\turnOnExperimentalFeatures") + +(define + (finishbar o h) (empty o)) + +(define + (font i) + (string-append + "font" + (make-string 1 (integer->char (+ (char->integer #\A) i))) + )) + +(define + (font-def o i s) + (empty o)) +; ((invoke-output o "font-def") i s)) + +(define + (font-def-ps i s) + (string-append + "\n/" (font i) " {/" + (substring s 0 (- (string-length s) 3)) + " findfont 12 scalefont setfont} bind def\n")) + +(define + (font-def-tex i s) + (string-append + "\\font" (font-switch-tex i) "=" s "\n")) + +(define + (font-switch o i) + ((invoke-output o "font-switch") i)) + +(define + (font-switch-ps i) + (string-append (font i) " ")) + +(define + (font-switch-tex i) + (string-append + "\\" (font i) "\n")) + +(define + (generalmeter o num den) + ((invoke-output o "generalmeter") num den)) + +(define + (generalmeter-ps num den) + (string-append (number->string (inexact->exact num)) " " (number->string (inexact->exact den)) " generalmeter ")) + +(define + (generalmeter-tex num den) + (string-append + "\\generalmeter{" (number->string (inexact->exact num)) "}{" (number->string (inexact->exact den)) "}")) + +(define + (header o creator generate) + ((invoke-output o "header") creator generate)) + +(define + (header-ps creator generate) + (string-append + "%!PS-Adobe-3.0\n" + "%%Creator: " creator generate "\n")) + +(define + (header-tex creator generate) + (string-append + "%created by: " creator generate "\n")) + +(define + (header-end o) + ((invoke-output o "header-end"))) + +(define + (header-end-ps) "") + +(define + (header-end-tex) "\\turnOnPostScript") + +(define + (lily-def o key val) + ((invoke-output o "lily-def") key val)) + +(define + (lily-def-ps key val) + (string-append + "/" key " {" val "} bind def\n")) + +(define + (lily-def-tex key val) + (string-append + "\\def\\" key "{" val "}\n")) + +(define + (maatstreep o h) + ((invoke-output o "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)) + +(define + (placebox o x y b) + ((invoke-output o "placebox") x y (b o))) + +(define + (placebox-ps x y s) + (string-append + (number->string x) " " (number->string y) " {" s "} placebox ")) + +(define + (placebox-tex x y s) + (string-append + "\\placebox{" + (number->dim-tex y) "}{" (number->dim-tex x) "}{" s "}")) + +(define + (repeatbar o h) (empty o)) + +(define + (rulesym o x y) + ((invoke-output o "rulesym") x y)) + +(define + (rulesym-ps x y) + (string-append + (number->string x) " " + (number->string y) " " + "rulesym")) + +(define + (rulesym-tex x y) + (string-append + "\\rulesym{" (number->dim-tex x) "}{" (number->dim-tex y) "}")) + +(define + (setbold o s) + ((invoke-output o "text") "bold" s)) + +(define + (setfinger o s) + ((invoke-output o "text") "finger" s)) + +(define + (sethuge o s) + ((invoke-output o "text") "huge" s)) + +(define + (setitalic o s) + ((invoke-output o "text") "italic" s)) + +(define + (setlarge o s) + ((invoke-output o "text") "large" s)) + +(define + (setLarge o s) + ((invoke-output o "text") "Large" s)) + +(define + (settext o s) + ((invoke-output o "text") "text" s)) + +(define + (slur o l) + ((invoke-output o "slur") l)) + +(define + (slur-ps l) + (string-append + (apply string-append (map control->string l)) + " draw_slur")) + +(define + (slur-tex l) + (string-append + "\\embeddedps{" + (slur-ps l) + "}")) + +(define + (stem o kern width height depth) + ((invoke-output o "stem") kern width height depth)) + +(define + (stem-ps kern width height depth) + (string-append (numbers->string (list kern width height depth)) + "draw_stem" )) + +(define + (stem-tex kern width height depth) + (string-append + "\\kern" (number->dim-tex kern) + "\\vrule width " (number->dim-tex width) + "depth " (number->dim-tex depth) + "height " (number->dim-tex height) " ")) + +(define + (start-line o) + ((invoke-output o "start-line"))) + +(define + (start-line-ps) + (string-append + (urg-fix-font-ps) + "\nstart_line {\n")) + +(define + (start-line-tex) + (string-append + (urg-fix-font-tex) + "\\hbox{%\n")) + +(define + (startrepeat o h) (empty o)) + +(define + (stop-line o) + ((invoke-output o "stop-line"))) + +(define + (stop-line-ps) + "}\nstop_line\n") + +(define + (stop-line-tex) + "}\\interscoreline") + +(define + (stoprepeat o h) (empty o)) + +(define + (text-ps f s) + (string-append "(" s ") set" f " ")) + +(define + (text-tex f s) + (string-append "\\set" f "{" s "}")) + +(define + (urg-fix-font-ps) + "/fontA { /feta20 findfont 12 scalefont setfont} bind def fontA\n") + +(define + (urg-fix-font-tex) + "\\font\\fontA=feta20.afm\\fontA\n") + +(define + (urg-font-switch-ps i) + "\n/feta20 findfont 12 scalefont setfont \n") + diff --git a/init/paper16.ly b/init/paper16.ly index 11aa7a8fd2..53ab49363d 100644 --- a/init/paper16.ly +++ b/init/paper16.ly @@ -20,6 +20,8 @@ paper_sixteen = \paper { arithmetic_multiplier = 4.8\pt; texsetting = "\\input lilyponddefs \\musixsixteendefs "; pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; + scmsetting = "(display \"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\");\n"; + scmsetting = "(display \"\\\\input lilyponddefs \\\\musixsixteendefs\");\n"; 0 = \symboltables { \table_sixteen } -1 = \symboltables { \table_thirteen } diff --git a/init/paper20.ly b/init/paper20.ly index 226cfb6a74..e799f529bc 100644 --- a/init/paper20.ly +++ b/init/paper20.ly @@ -20,7 +20,8 @@ paper_twenty = \paper { texsetting = "\\input lilyponddefs \\musixtwentydefs "; pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; % urg, debugging only - scmsetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; + scmsetting = "(display \"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\");\n"; + scmsetting = "(display \"\\\\input lilyponddefs \\\\musixtwentydefs\");\n"; -2 = \symboltables { \table_thirteen } -1 = \symboltables { \table_sixteen } diff --git a/init/scm.ly b/init/scm.ly index f576ea8875..c2c3155fb2 100644 --- a/init/scm.ly +++ b/init/scm.ly @@ -5,384 +5,8 @@ % (c) 1998 Jan Nieuwenhuizen \scm " - -;;; graphical lisp element -(define (add-column p) (display \"adding column (in guile): \") (display p) (newline)) - -;;; library funtions -(define - (numbers->string l) - (apply string-append - (map (lambda (n) (string-append (number->string n) \" \")) l))) - -(define (number->octal-string x) - (let* ((n (inexact->exact x)) - (n64 (quotient n 64)) - (n8 (quotient (- n (* n64 64)) 8))) - (string-append - (number->string n64) - (number->string n8) - (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8))))) - -(define (inexact->string x radix) - (let ((n (inexact->exact x))) - (number->string n radix))) - -(define - (number->dim-tex x) - (string-append - (number->string x) \"pt \")) - -(define - (control->string c) - (string-append - (string-append (number->string (car c)) \" \") - (string-append (number->string (cadr c)) \" \"))) - -(define - (invoke-output o s) - (eval-string (string-append s \"-\" o))) - -;;; output definitions - -(define - (beam o width slope thick) - ((invoke-output o \"beam\") width slope thick)) - -(define - (beam-ps width slope thick) - (string-append - (numbers->string (list width slope thick)) \" draw_beam \" )) - -(define - (beam-tex width slope thick) - (string-append - \"\\\\embeddedps{\" - (beam-ps width slope thick) - \"}\")) - -(define - (char o n) - ((invoke-output o \"char\") n)) - -(define - (char-ps n) - (string-append - \"(\\\\\" (inexact->string n 8) \") show\")) - -(define - (char-tex n) - (string-append - \"\\\\char\" (inexact->string n 10))) - -(define - (dashed-slur o thick dash l) - ((invoke-output o \"dashed-slur\") thick dash l)) - -(define - (dashed-slur-ps thick dash l) - (string-append - (apply string-append (map control->string l)) - (number->string thick) - \" [ \" - (if (> 1 dash) (number->string (- (* thick dash) thick)) \"0\") \" \" - (number->string (* 2 thick)) - \" ] 0 draw_dashed_slur\")) - -(define - (dashed-slur-tex thick dash l) - (string-append - \"\\\\embeddedps{\" - (dashed-slur-ps thick dash l) - \"}\")) - -(define - (empty o) - ((invoke-output o \"empty\"))) - -(define - (empty-ps) - \"\n empty\n\") - -(define - (empty-tex) - \"%\n\\\\empty%\n\") - -(define - (end-output o) - ((invoke-output o \"end-output\"))) - -(define - (end-output-ps) - \"\nshowpage\n\") - -(define - (end-output-tex) - \"\n\\\\EndLilyPondOutput\") - -(define - (experimental-on o) - ((invoke-output o \"experimental-on\"))) - -(define - (experimental-on-ps) \"\") - -(define - (experimental-on-tex) \"\\\\turnOnExperimentalFeatures\") - -(define - (finishbar o h) (empty o)) - -(define - (font i) - (string-append - \"font\" - (make-string 1 (integer->char (+ (char->integer #\\A) i))) - )) - -(define - (font-def o i s) - (empty o)) -; ((invoke-output o \"font-def\") i s)) - -(define - (font-def-ps i s) - (string-append - \"\n/\" (font i) \" {/\" - (substring s 0 (- (string-length s) 3)) - \" findfont 12 scalefont setfont} bind def\n\")) - -(define - (font-def-tex i s) - (string-append - \"\\\\font\" (font-switch-tex i) \"=\" s \"\n\")) - -(define - (font-switch o i) - ((invoke-output o \"font-switch\") i)) - -(define - (font-switch-ps i) - (string-append (font i) \" \")) - -(define - (font-switch-tex i) - (string-append - \"\\\\\" (font i) \"\n\")) - -(define - (generalmeter o num den) - ((invoke-output o \"generalmeter\") num den)) - -(define - (generalmeter-ps num den) - (string-append (number->string (inexact->exact num)) \" \" (number->string (inexact->exact den)) \" generalmeter \")) - -(define - (generalmeter-tex num den) - (string-append - \"\\\\generalmeter{\" (number->string (inexact->exact num)) \"}{\" (number->string (inexact->exact den)) \"}\")) - -(define - (header o creator generate) - ((invoke-output o \"header\") creator generate)) - -(define - (header-ps creator generate) - (string-append - \"%!PS-Adobe-3.0\n\" - \"%%Creator: \" creator generate \"\n\")) - -(define - (header-tex creator generate) - (string-append - \"%created by: \" creator generate \"\n\")) - -(define - (header-end o) - ((invoke-output o \"header-end\"))) - -(define - (header-end-ps) \"\") - -(define - (header-end-tex) \"\\\\turnOnPostScript\") - -(define - (lily-def o key val) - ((invoke-output o \"lily-def\") key val)) - -(define - (lily-def-ps key val) - (string-append - \"/\" key \" {\" val \"} bind def\n\")) - -(define - (lily-def-tex key val) - (string-append - \"\\\\def\\\\\" key \"{\" val \"}\n\")) - -(define - (maatstreep o h) - ((invoke-output o \"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)) - -(define - (placebox o x y b) - ((invoke-output o \"placebox\") x y (b o))) - -(define - (placebox-ps x y s) - (string-append - (number->string x) \" \" (number->string y) \" {\" s \"} placebox \")) - -(define - (placebox-tex x y s) - (string-append - \"\\\\placebox{\" - (number->dim-tex y) \"}{\" (number->dim-tex x) \"}{\" s \"}\")) - -(define - (repeatbar o h) (empty o)) - -(define - (rulesym o x y) - ((invoke-output o \"rulesym\") x y)) - -(define - (rulesym-ps x y) - (string-append - (number->string x) \" \" - (number->string y) \" \" - \"rulesym\")) - -(define - (rulesym-tex x y) - (string-append - \"\\\\rulesym{\" (number->dim-tex x) \"}{\" (number->dim-tex y) \"}\")) - -(define - (setbold o s) - ((invoke-output o \"text\") \"bold\" s)) - -(define - (setfinger o s) - ((invoke-output o \"text\") \"finger\" s)) - -(define - (sethuge o s) - ((invoke-output o \"text\") \"huge\" s)) - -(define - (setitalic o s) - ((invoke-output o \"text\") \"italic\" s)) - -(define - (setlarge o s) - ((invoke-output o \"text\") \"large\" s)) - -(define - (setLarge o s) - ((invoke-output o \"text\") \"Large\" s)) - -(define - (settext o s) - ((invoke-output o \"text\") \"text\" s)) - -(define - (slur o l) - ((invoke-output o \"slur\") l)) - -(define - (slur-ps l) - (string-append - (apply string-append (map control->string l)) - \" draw_slur\")) - -(define - (slur-tex l) - (string-append - \"\\\\embeddedps{\" - (slur-ps l) - \"}\")) - -(define - (stem o kern width height depth) - ((invoke-output o \"stem\") kern width height depth)) - -(define - (stem-ps kern width height depth) - (string-append (numbers->string (list kern width height depth)) - \"draw_stem\" )) - -(define - (stem-tex kern width height depth) - (string-append - \"\\\\kern\" (number->dim-tex kern) - \"\\\\vrule width \" (number->dim-tex width) - \"depth \" (number->dim-tex depth) - \"height \" (number->dim-tex height) \" \")) - -(define - (start-line o) - ((invoke-output o \"start-line\"))) - -(define - (start-line-ps) - (string-append - (urg-fix-font-ps) - \"\nstart_line {\n\")) - -(define - (start-line-tex) - (string-append - (urg-fix-font-tex) - \"\\\\hbox{%\n\")) - -(define - (stop-line o) - ((invoke-output o \"stop-line\"))) - -(define - (stop-line-ps) - \"}\nstop_line\n\") - -(define - (stop-line-tex) - \"}\\\\interscoreline\") - -(define - (text-ps f s) - (string-append \"(\" s \") set\" f \" \")) - -(define - (text-tex f s) - (string-append \"\\\\set\" f \"{\" s \"}\")) - -(define - (urg-fix-font-ps) - \"/fontA { /feta20 findfont 12 scalefont setfont} bind def fontA\n\") - -(define - (urg-fix-font-tex) - \"\\\\font\\\\fontA=feta20.afm\\\\fontA\n\") - -(define - (urg-font-switch-ps i) - \"\n/feta20 findfont 12 scalefont setfont \n\") - +; huh? +;(append %load-path 'init) +;(load-patch 'lily.scm) +(load 'init/lily.scm) "; - - diff --git a/lily/lookup.cc b/lily/lookup.cc index c763bb56e1..2ca4bdddde 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -56,7 +56,8 @@ Lookup::~Lookup () Atom Lookup::accidental (int j) const { - return afm_find (String ("accidentals") + String ("-") + to_str (j)); + Atom a = afm_find (String ("accidentals") + String ("-") + to_str (j)); + return a; } void @@ -87,6 +88,7 @@ Lookup::afm_find (String s) const Array arr; arr.push (m.code ()); a.lambda_ = (lambda_scm ("char", arr)); + a.str_ = "afm_find: " + s; a.font_ = font_; return a; } @@ -107,6 +109,7 @@ Lookup::bar (String str, Real h) const arr.push (h); Atom a = (*symtables_p_) ("bars")->lookup (str); a.lambda_ = (lambda_scm (a.str_, arr)); + a.str_ = "bar"; a.dim_.y () = Interval (-h/2, h/2); a.font_ = font_; return a; @@ -126,6 +129,7 @@ Lookup::beam (Real slope, Real width, Real thick) const Atom a; a.lambda_ = (lambda_scm ("beam", arr)); + a.str_ = "beam"; a.dim_[X_AXIS] = Interval (0, width); a.dim_[Y_AXIS] = Interval (min_y, max_y); return a; @@ -162,6 +166,7 @@ Lookup::dashed_slur (Array controls, Real thick, Real dash) const gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())), SCM_EOL)))))))))))); + a.str_ = "dashed_slur"; return a; } @@ -189,7 +194,8 @@ Atom Lookup::flag (int j, Direction d) const { char c = (d == UP) ? 'u' : 'd'; - return afm_find (String ("flags") + String ("-") + to_str (c) + to_str (j)); + Atom a = afm_find (String ("flags") + String ("-") + to_str (c) + to_str (j)); + return a; } void @@ -212,14 +218,14 @@ Lookup::rest (int j, bool o) const Atom Lookup::rule_symbol (Real height, Real width) const { - Atom bs= (*symtables_p_) ("param")->lookup ("rule"); - Array args; - args.push (height); - args.push (width); - bs.lambda_ = (lambda_scm (bs.str_, args)); - bs.dim_.x () = Interval (0, width); - bs.dim_.y () = Interval (0, height); - return bs; + Atom a = (*symtables_p_) ("param")->lookup ("rule"); + Array arr; + arr.push (height); + arr.push (width); + a.lambda_ = lambda_scm (a.str_, arr); + a.str_ = "rule_symbol"; + a.dim_.x () = Interval (0, width); + a.dim_.y () = Interval (0, height); } Atom @@ -261,22 +267,22 @@ Lookup::stem (Real y1, Real y2) const y1 = y2; y2 = t; } - Atom s; + Atom a; - s.dim_.x () = Interval (0,0); - s.dim_.y () = Interval (y1,y2); + a.dim_.x () = Interval (0,0); + a.dim_.y () = Interval (y1,y2); - Array a; + Array arr; Real stem_width = paper_l_->get_var ("stemthickness"); - a.push (-stem_width /2); - a.push (stem_width); - a.push (y2); - a.push (-y1); - - s.lambda_ = (lambda_scm ("stem", a)); - s.font_ = font_; - return s; + arr.push (-stem_width /2); + arr.push (stem_width); + arr.push (y2); + arr.push (-y1); + + a.lambda_ = lambda_scm ("stem", arr); + a.str_ = "stem"; + a.font_ = font_; } Atom @@ -285,29 +291,28 @@ Lookup::streepje (int type) const if (type > 2) type = 2; - return afm_find ("balls" + String ("-") +to_str (type) + "l"); + Atom a = afm_find ("balls" + String ("-") + to_str (type) + "l"); + return a; } Atom Lookup::text (String style, String text) const { - Array a; - - a.push (text); - Atom s = (*symtables_p_) ("style")->lookup (style); - s.lambda_ = (lambda_scm (s.str_, a)); - s.font_ = font_; + Array arr; - return s; + arr.push (text); + Atom a = (*symtables_p_) ("style")->lookup (style); + a.lambda_ = lambda_scm (a.str_, arr); + a.str_ = "text"; + a.font_ = font_; } Atom Lookup::time_signature (Array a) const { - Atom s ((*symtables_p_) ("param")->lookup ("time_signature")); - s.lambda_ = (lambda_scm (s.str_, a)); - - return s; + Atom a ((*symtables_p_) ("param")->lookup ("time_signature")); + a.lambda_ = lambda_scm (a.str_, arr); + a.str_ = "time_signature"; } /* @@ -316,8 +321,8 @@ Lookup::time_signature (Array a) const Atom Lookup::vbrace (Real &y) const { - Atom brace = (*symtables_p_) ("param")->lookup ( "brace"); - Interval ydims = brace.dim_[Y_AXIS]; + Atom a = (*symtables_p_) ("param")->lookup ( "brace"); + Interval ydims = a.dim_[Y_AXIS]; Real min_y = ydims[LEFT]; Real max_y = ydims[RIGHT]; Real step = 1.0 PT; @@ -338,14 +343,13 @@ Lookup::vbrace (Real &y) const int idx = int (rint ( (y- min_y)/step)) + 1; - Array a; - a.push (idx); - brace.lambda_ = (lambda_scm (brace.str_, a)); - brace.dim_[Y_AXIS] = Interval (-y/2,y/2); - - brace.font_ = font_; - - return brace; + Array arr; + arr.push (idx); + a.lambda_ = lambda_scm (a.str_, arr); + a.str_ = "brace"; + a.dim_[Y_AXIS] = Interval (-y/2,y/2); + a.font_ = font_; + return a; } Atom @@ -378,9 +382,9 @@ Lookup::plet (Real dy , Real dx, Direction dir) const + String_convert::int_str ( (int)dir) + " draw_plet "; - Atom s; - s.str_ = ps; - return s; + Atom a; + a.str_ = ps; + return a; } Atom @@ -408,6 +412,7 @@ Lookup::slur (Array controls) const gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())), gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())), SCM_EOL)))))))))))))); + a.str_ = "slur"; a.dim_[X_AXIS] = Interval (0, dx); a.dim_[Y_AXIS] = Interval (0 ? dy); @@ -429,6 +434,7 @@ Lookup::vbracket (Real &y) const Array arr; arr.push (y); a.lambda_ = (lambda_scm ("bracket", arr)); + a.str_ = "vbracket"; a.dim_[Y_AXIS] = Interval (-y/2,y/2); a.dim_[X_AXIS] = Interval (0,4 PT); return a; diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 85abdd931b..c94fe3e8d9 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -269,8 +269,11 @@ Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origi Paper_outputter* p = new Paper_outputter (os_p); output_header (p, header_global_p); +#if 0 + // for now; breaks -fscm output p->output_comment (_ ("outputting Score, defined at: ")); p->output_comment (origin_str); +#endif output_header (p, header_l); diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 033fbf3f06..487b3d2b9a 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -8,6 +8,7 @@ */ #include +#include #include "paper-outputter.hh" #include "paper-stream.hh" #include "molecule.hh" @@ -94,6 +95,7 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) #ifndef NPRINT if (check_debug && !monitor->silent_b ("Guile")) { + DOUT << i->str_ << "\n"; gh_display (i->lambda_); gh_newline (); } #endif @@ -139,10 +141,29 @@ Paper_outputter::output_scheme (SCM scm) // urg; temporary hack to debug scheme error #unknown if (String (output_global_ch) == "scm") { -// char* c = gh_scm2newstr (scm, NULL); -// *outstream_l_ << c << "\n"; -// free (c); - gh_display (scm); gh_newline (); + static SCM port = 0; + // urg + if (!port) + { + int fd = 1; + ofstream * of = dynamic_cast (outstream_l_->os); + if (of) + fd = of->rdbuf()->fd(); + FILE *file = fdopen (fd, "a"); + port = scm_standard_stream_to_port (file, "a", ""); + scm_display (gh_str02scm ("(load 'lily.scm)\n"), port); + } +#if 0 + *outstream_l_ << "(display ((eval "; + scm_write (scm, port); + *outstream_l_ << ") 'tex))\n"; +#else + scm_display (gh_str02scm ("(display ((eval "), port); + scm_write (scm, port); + scm_display (gh_str02scm (") 'tex))\n"), port); + scm_newline (port); + scm_fflush (port); +#endif return; } SCM str_scm = gh_call1 (ly_eval (scm), gh_eval_str (o.ch_l ()));