]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.2.hwn1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 5 Nov 1998 23:10:46 +0000 (00:10 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 5 Nov 1998 23:10:46 +0000 (00:10 +0100)
pl 2.hwn1
- scm cleanups, chop-decimal
- scarlatti clef.

---
Generated by hanwen@cs.uu.nl using package-diff 0.62,
From = lilypond-1.1.2, To = lilypond-1.1.2.hwn1

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.2.hwn1.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
and possibly make outdirs.

--state
1.1.2
1.1.2.hwn1
++state

18 files changed:
Documentation/topdocs/README.yo
NEWS
VERSION
flower/file-path.cc
flower/include/file-path.hh
init/engraver.ly
init/lily.scm
init/lily.scm.orig [new file with mode: 0644]
lily/clef-engraver.cc
lily/clef-item.cc
lily/include/clef-engraver.hh
lily/include/clef-item.hh
lily/include/lily-guile.hh
lily/include/protected-scm.hh
lily/lily-guile.cc
lily/lookup.cc
lily/paper-outputter.cc
mf/feta-klef.mf

index 972df8af780b0b79bb07f835050b9a09bf4a4a81..39b6dc56e3e83c579fbed80af87fe21141ca2596 100644 (file)
@@ -68,7 +68,7 @@ criticism, comments, bugreports, patches, etc.
 and not to us personally.  See file(Documentation/links.yo) for more info.
 
 
-sect(DOZE)
+sect(WINDOWS 32)
 
 If you have received this file as part of a DOS/Window32 distribution
 (package()-*.zip), then it is advisable to also download the source
diff --git a/NEWS b/NEWS
index 2c48432d4635ef2fd241d70632731c216e2d0be0..b15d3c530898ddf51d95d3f7973b7c23ddea0245 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,18 @@
-pl 2.jcn2
+--- ../lilypond-1.1.2/NEWS     Thu Nov  5 20:51:37 1998
+++ b/NEWS      Fri Nov  6 00:10:46 1998
+@@ -1,6 +1,11 @@
+pl 2.hwn1
+       - scm cleanups, chop-decimal
+       - scarlatti clef.
+
+
+ pl 1.mb1
+         - Support for cautionary accidentals. , i.e. accidentals 
+-          within parantheses. Syntax: 'cis?'. Try input/test/accid.fly
+          within parentheses. Syntax: 'cis?'. Try input/test/accid.fly
+           Note that the font has changed.
+         - bf: No unnecessary warnings about time signatures
+         - Added optional second argument of \key. Set to \major or \minor pl 2.jcn2
 
 pl 2.jcn1
        - commented-out Level-2 PostScript in lily.ps (J. Buehler)
diff --git a/VERSION b/VERSION
index b3672712026b5c05d904e010f3b73480fa189e0c..41a2aa4d95c8c793ef8a2e3cde1ad87792ac8d00 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=2
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=hwn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 89c05dfb165f7791936d5263bf9ace46d2b2dadd..61dbd64e9b0ed8ccfdb9d0e0eba7a5e48bc29f54 100644 (file)
@@ -113,3 +113,16 @@ File_path::add (String s)
 {
    push (s); 
 }
+
+String
+File_path::str () const
+{
+  String s;
+  for (int i=0; i< size (); i++)
+    {
+      s = s + elem (i);
+      if (i < size () -1 )
+       s += ":";
+    }
+  return s;
+}
index d5fed491ff4ff45a895727b164fe1ba8505ae83d..69fd062c72d188d97d2402fcc9bd22bc3f8b9c88 100644 (file)
@@ -31,6 +31,7 @@ public:
 
   /// add to end of path.
   Array<String>::push;
+  String str ()const;
   void add (String str);
   void parse_path (String);
 };
index 09df59503861176fb100839bfaf1687a9c9ff225..47fb08f7fd8734ca8dee631ae3ea51ed8bd23660 100644 (file)
@@ -147,7 +147,7 @@ VoiceContext = \translator {
 ScoreContext = \translator {
        \type Score_engraver;
        \name Score;
-       defaultClef = violin;
+       defaultClef = treble;
 
        \consists "Timing_engraver";
 
@@ -231,7 +231,7 @@ OrchestralScoreContext= \translator {
        markScriptPadding = "4.0";
        barColumnPriority = "-4";
        markBreakPriority = "-4";
-       defaultClef = violin;
+       defaultClef = treble;
 
        \consists "Timing_engraver";
        \consists "Bar_column_engraver";
index fa5ca909e4c07bee4cd6c7cf57a9506688513e4c..b66038f60015f51b1eadcb2bfacdb36a3ebb324c 100644 (file)
@@ -18,6 +18,8 @@
   (apply string-append 
   (map (lambda (n) (string-append (number->string n) " ")) l)))
 
+(define (chop-decimal x) (if (< (abs x) 0.001) 0.0 x))
+
 (define (number->octal-string x)
   (let* ((n (inexact->exact x))
          (n64 (quotient n 64))
@@ -34,7 +36,7 @@
 (define 
   (number->dim-tex x)
   (string-append 
-   (number->string x) "pt "))
+   (number->string (chop-decimal x)) "pt "))
 
 (define
   (control->string c)
diff --git a/init/lily.scm.orig b/init/lily.scm.orig
new file mode 100644 (file)
index 0000000..fa5ca90
--- /dev/null
@@ -0,0 +1,432 @@
+; lily.scm -- implement Scheme output routines for TeX and PostScript
+;
+;  source file of the GNU LilyPond music typesetter
+; 
+; (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+
+; 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))
+
+;;; 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 
+  (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)))
+
+;;; 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)
+  (embedded-ps-tex (beam-ps width slope thick)))
+
+(define 
+  (bracket o h)
+  ((invoke-output o "bracket") h))
+
+(define 
+  (bracket-ps h)
+  (invoke-dim1-ps "draw_bracket" h))
+
+(define 
+  (bracket-tex h)
+  (embedded-ps-tex (bracket-ps h)))
+
+(define 
+  (char o n) 
+  ((invoke-output o "invoke-char") "show" n))
+
+(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)
+  (embedded-ps-tex (dashed-slur-ps thick dash l)))
+
+(define 
+  (doublebar o h)
+  ((invoke-output o "invoke-dim1") "doublebar" h))
+
+(define 
+  (empty o) 
+  ((invoke-output o "empty")))
+
+(define 
+  (empty-ps) 
+  "\n empty\n")
+
+(define 
+  (empty-tex) 
+  "%\n\\empty%\n")
+
+(define 
+  (emptybar o h) (empty o))
+
+(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
+  (fatdoublebar o h)
+  ((invoke-output o "invoke-dim1") "fatdoublebar" h))
+
+(define
+  (finishbar o h)
+  ((invoke-output o "invoke-dim1") "finishbar" h))
+
+(define
+  (font i)
+  (string-append
+   "font"
+   (make-string 1 (integer->char (+ (char->integer #\A) i)))
+   ))
+
+(define 
+  (font-def o i s) 
+  ((invoke-output o "font-def") i s))
+;  (empty o))
+
+(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 "invoke-dim1") "maatstreep" h))
+
+(define 
+  (pianobrace o i)
+  ((invoke-output o "invoke-char") "pianobrace" i))
+
+(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)
+  ((invoke-output o "invoke-dim1") "repeatbar" h))
+
+(define
+  (repeatbarstartrepeat o h)
+  ((invoke-output o "invoke-dim1") "repeatbarstartrepeat" h))
+
+(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
+  (setdynamic o s) (empty o))
+
+(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 
+  (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))
+
+(define 
+  (slur-ps l)
+  (string-append 
+   (apply string-append (map control->string l)) 
+   " draw_slur"))
+
+(define 
+  (slur-tex l)
+  (embedded-ps-tex (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)
+  ((invoke-output o "invoke-dim1") "startrepeat" h))
+
+(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)
+  ((invoke-output o "invoke-dim1") "stoprepeat" h))
+
+(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")
+
index 83e6eff1e64eca0f498c6aea54ad934fea099a70..b7dac5052bfc2386a4c2dca6cfa3140ed1951ce3 100644 (file)
@@ -20,7 +20,6 @@
 
 Clef_engraver::Clef_engraver()
 {
-  clef_p_ = 0;
   clef_req_l_ = 0;
   clef_type_str_ = "";
   c0_position_i_ = 0;
@@ -28,6 +27,32 @@ Clef_engraver::Clef_engraver()
   octave_dir_ = CENTER;
 }
 
+struct Clef_settings {
+  char const *name;
+  char const *cleftype;
+  int position;
+} clef_settings[] = {
+  {"treble", "treble", -2},
+  {"violin", "treble", -2},
+  {"G", "treble", -2},
+  {"G2", "treble", -2},  
+  {"scarlatti", "scarlatti", 0 },
+  {"french", "treble",-4 },
+  {"soprano", "alto",-4 },
+  {"mezzosoprano", "alto",-2 },
+  {"alto", "alto",0 },
+  {"tenor", "alto",2 },
+  {"baritone", "alto",4 },
+  {"varbaritone", "bass",0 },
+  {"bass" , "bass",2 },
+  {"F", "bass", 2},
+  {"subbass", "bass",4},
+  {0,0,0}
+};
+
+
+
+
 /*
   Ugh.  Should have support for Dictionaries in mudela.
  */
@@ -46,59 +71,18 @@ Clef_engraver::set_type (String s)
     }
   else
     octave_dir_ = CENTER;
-  if (s == "treble" ||
-      s == "violin" ||
-      s == "G" || s == "G2")
-    {
-      clef_type_str_ = "violin";
-      clef_position_i_ = -2;
-    }
-  else if (s == "french")
-    {
-      clef_type_str_ = "violin";
-      clef_position_i_ = -4;
-    }
-  else if (s == "soprano")
-    {
-      clef_type_str_ = "alto";
-      clef_position_i_ = -4;
-    }
-  else if (s == "mezzosoprano")
-    {
-      clef_type_str_ = "alto";
-      clef_position_i_ = -2;
-    }
-  else if (s == "alto")
-    {
-      clef_type_str_ = "alto";
-      clef_position_i_ = 0;
-    }
-  else if (s == "tenor")
-    {
-      clef_type_str_ = "alto";
-      clef_position_i_ = 2;
-    }
-  else if (s == "baritone")
-    {
-      clef_type_str_ = "alto";
-      clef_position_i_ = 4;
-    }
-  else if (s == "varbaritone")
-    {
-      clef_type_str_ = "bass";
-      clef_position_i_ = 0;
-    }
-  else if (s == "bass" || s == "F")
-    {
-      clef_type_str_ = "bass";
-      clef_position_i_ = 2;
-    }
-  else if (s == "subbass")
+
+  bool found = 0;
+  for (Clef_settings *c = clef_settings; !found && c->name; c++)
     {
-      clef_type_str_ = "bass";
-      clef_position_i_ = 4;
-    }
-  else 
+      if (c->name == s)
+       {
+         clef_type_str_ = c->cleftype;
+         clef_position_i_ = c->position;
+         found = 1;
+       }
+      }
+  if (!found)
     {
       switch(toupper (s[0]))
        {
@@ -106,7 +90,7 @@ Clef_engraver::set_type (String s)
          clef_type_str_ = "bass";
          break;
        case  'G':
-         clef_type_str_ = "violin";
+         clef_type_str_ = "treble";
          break;
        case 'C': 
          clef_type_str_ = "alto";
@@ -116,15 +100,17 @@ Clef_engraver::set_type (String s)
        }
       clef_position_i_ = 2 * (s[1] - '0') - 6;
     }
-  if (clef_type_str_ == "violin")
+
+  if (clef_type_str_ == "treble")
     c0_position_i_ = clef_position_i_ - 4;
   else if (clef_type_str_ == "alto")
     c0_position_i_ = clef_position_i_;
   else if (clef_type_str_ == "bass")
     c0_position_i_ = clef_position_i_ + 4;
+  else if (clef_type_str_ == "scarlatti")
+    c0_position_i_ = 0;
   else
     assert (false);
-
       
   c0_position_i_ -= (int) octave_dir_ * 7;
   
@@ -151,7 +137,11 @@ Clef_engraver::acknowledge_element (Score_element_info info)
     {
       create_clef();
       if (!clef_req_l_)
-       clef_p_->default_b_ = true;
+       for (int i=0; i < clef_p_arr_.size (); i++)
+         {
+           clef_p_arr_[i]->default_b_ = true;
+         }
+
     }
 
   /* ugh; should make Clef_referenced baseclass */
@@ -183,7 +173,9 @@ Clef_engraver::do_creation_processing()
   if (clef_type_str_.length_i ())
     { 
       create_clef();
-      clef_p_->default_b_ = false;
+       for (int i=0; i < clef_p_arr_.size (); i++)
+
+           clef_p_arr_[i]->default_b_ = false;
     }
 }
 
@@ -204,34 +196,61 @@ Clef_engraver::do_try_request (Request * r_l)
 void
 Clef_engraver::create_clef()
 {
-  if (!clef_p_)
+  if (clef_type_str_ == "scarlatti")
     {
-      clef_p_ = new Clef_item;
-      clef_p_->break_priority_i_ = -2; // ugh
-      announce_element (Score_element_info (clef_p_,clef_req_l_));
+      while (clef_p_arr_.size () < 2)
+       {
+         Clef_item *ct= new Clef_item;
+         ct->break_priority_i_ =  -2; // UGH
+         announce_element (Score_element_info (ct, clef_req_l_));
+         clef_p_arr_.push (ct);
+       }
+      clef_p_arr_[0]->symbol_ = "treble";
+      clef_p_arr_[0]->y_position_i_ = 4;
+      clef_p_arr_[1]->symbol_ = "bass";
+      clef_p_arr_[1]->y_position_i_ = -4;
+    }
+  else
+    {
+      if (!clef_p_arr_.size ())
+       {
+         Clef_item *c= new Clef_item;
+         c->break_priority_i_ = -2; // ugh
+         announce_element (Score_element_info (c, clef_req_l_));
+         clef_p_arr_.push (c);
+       }
+
+      for (int i=0; i < clef_p_arr_.size (); i++)
+       {
+         clef_p_arr_[i]->symbol_ = clef_type_str_;
+         clef_p_arr_[i]->y_position_i_ = clef_position_i_;
+         clef_p_arr_[i]->octave_dir_ = octave_dir_;
+       }
     }
-  clef_p_->read (*this);
 }
 
+
 void
 Clef_engraver::do_process_requests()
 {
   if (clef_req_l_)
     {
       create_clef();
-      clef_p_->default_b_ = false;
+      for (int i=0; i < clef_p_arr_.size (); i++)
+       clef_p_arr_[i]->default_b_ = false;
     }
 }
 
 void
 Clef_engraver::do_pre_move_processing()
 {
-  if (clef_p_)
+  for (int i=0; i <clef_p_arr_.size (); i++)
     {
-      typeset_element (clef_p_);
-      clef_p_ = 0;
+      typeset_element (clef_p_arr_[i]);
     }
+  clef_p_arr_.clear ();
 }
+
 void
 Clef_engraver::do_post_move_processing()
 {
@@ -241,11 +260,9 @@ Clef_engraver::do_post_move_processing()
 void
 Clef_engraver::do_removal_processing()
 {
-  if (clef_p_)
+  if (clef_p_arr_.size ())
     {
-      clef_p_->unlink ();      
-      delete clef_p_;
-      clef_p_ =0;
+      assert (false);
     }
 }
 
index 285d904a099bdfc45a0ca707b1b5a4c0cd851bd8..fd6e971b42e9f12f0a395a01be131a2c3f5091e0 100644 (file)
@@ -28,29 +28,26 @@ Clef_item::do_pre_processing()
     }
 }
 
+/*
+  FIXME
+*/
 Clef_item::Clef_item()
 {
   breakable_b_ =true;
   default_b_ = false;
   change_b_ = true;
   octave_dir_ = CENTER;
-  symbol_ = "violin";
+  symbol_ = "treble";
   y_position_i_ = -2;
   
   // Ugh: This should be const, I guess.
-  octave_marker_td_p_.set_p (new Text_def());
+  octave_marker_td_p_.set_p (new Text_def());// UGH!
   octave_marker_td_p_->text_str_ = "8";
   octave_marker_td_p_->style_str_ = "italic";
 }
 
 
-void
-Clef_item::read (Clef_engraver const &k)
-{
-  symbol_ = k.clef_type_str_;
-  y_position_i_ = k.clef_position_i_;
-  octave_dir_ = k.octave_dir_;
-}
+
 
 Molecule*
 Clef_item::brew_molecule_p() const
index 813a15339361c6a0d29150244dc1fb10b73b0e76..ca827b1583032d70ca3289546031b3c058fa2cb0 100644 (file)
@@ -17,7 +17,7 @@
 
 /// where is c-0 in the staff?
 class Clef_engraver : public  Engraver {
-  Clef_item *clef_p_;
+  Link_array<Clef_item> clef_p_arr_;
   Clef_change_req * clef_req_l_;
   void create_clef();
   void read_req (Clef_change_req*);
index 54c5bf1a0ce268bacb747ebf74168ab18e515505..10a3f21409924cd83c4173c77d594d154a55ba51 100644 (file)
@@ -38,7 +38,6 @@ public:
   DECLARE_MY_RUNTIME_TYPEINFO;
   SCORE_ELEMENT_CLONE(Clef_item);
   Clef_item();
-  void read (Clef_engraver const&);
 };
 
 #endif // CLEFITEM_HH
index f4c468c65e57f0443bf7050f3a53715b9ff7b1e6..a992a28fc1de85c6ae449d3c1a7d582a867a66fc 100644 (file)
 
 #include "config.hh"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef HAVE_LIBGUILE
-extern "C" { 
-#include <guile/gh.h> 
-}
-#else
-typedef long SCM;
-#endif
+#include <guile/gh.h>
+#include <libguile.h>
 
 SCM ly_append (SCM a, SCM b);
 SCM ly_eval (SCM a);
 SCM ly_func_o (char const* name);
 SCM ly_lambda_o ();
 SCM ly_list1 (SCM a);
-SCM ly_list2(SCM a, SCM b);
 SCM ly_quote ();
+SCM ly_quote_scm (SCM s);
 
-#ifdef __cplusplus
-}
-#endif
 
 #include "array.hh"
 #include "scalar.hh"
+
 SCM lambda_scm (String str, Array<int> args_arr);
 SCM lambda_scm (String str, Array<Real> args_arr);
 SCM lambda_scm (String str, Array<Scalar> args_arr);
index e83593a5376863ac670f5d344d3606be8768a439..5fa1f568ce07dd3ca4c58ccf636c1f72977e897d 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef PROTECTED_SCM_HH
 #define PROTECTED_SCM_HH
 
-#include "lily-guile.hh"
+#include <guile/gh.h>
 
 /*
   Mix GUILE GC with C++ ctors and dtors. 
index e4be91228884f7b5d70ce481bbc78d9a73e8faab..6b1d186714bdf72006b83ed3be838dc2ec6f3273 100644 (file)
@@ -4,6 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include <stdio.h>
 #include "lily-guile.hh"
 #include "main.hh"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 SCM
 ly_append (SCM a, SCM b)
 {
@@ -28,15 +26,15 @@ ly_list1 (SCM a)
 }
 
 SCM
-ly_list2(SCM a, SCM b)
+ly_quote ()
 {
-  return gh_call2 (gh_eval_str ("list"), a, b);
+  return gh_eval_str ("'quote");
 }
 
 SCM
-ly_quote ()
+ly_quote_scm (SCM s)
 {
-  return gh_eval_str ("'quote");
+  return gh_list (ly_quote (), s, SCM_UNDEFINED);
 }
 
 SCM
@@ -54,14 +52,11 @@ ly_lambda_o ()
 SCM
 ly_func_o (char const* name)
 {
-  char buf[200];
+  char buf[200];               // ugh.
   snprintf (buf, 200, "'(%s o)", name);
   return gh_eval_str (buf);
 }
 
-#ifdef __cplusplus
-}
-#endif
 
 SCM
 lambda_scm (String str, Array<int> args_arr)
index 8e1f4f1702ee700565280f6d3faabce9193a3ecd..5fe4ba780204a3f12a3f042b124ee75f4b1f5a44 100644 (file)
@@ -150,30 +150,40 @@ Lookup::clef (String st) const
   return afm_find (String ("clefs") + String ("-") + st);
 }
 
+SCM
+offset2scm (Offset o)
+{
+  return gh_list (gh_double2scm (o[X_AXIS]), gh_double2scm(o[Y_AXIS]), SCM_UNDEFINED);
+}
+
 Atom
 Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
 {
   assert (controls.size () == 8);
-
-  Real dx = controls[3].x () - controls[0].x ();
-  Real dy = controls[3].y () - controls[0].y ();
+  Offset d = controls[3] - controls[0];
+  
+  Real dx = d[X_AXIS];
+  Real dy = d[Y_AXIS];
 
   Atom a;
   a.font_ = font_;
   a.dim_[X_AXIS] = Interval (0, dx);
   a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
 
-  // (lambda (o) (dashed-slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2))))
-  a.lambda_ =  (
-    ly_append (ly_lambda_o (), 
-    ly_list1 (ly_append (ly_func_o ("dashed-slur"),
-    gh_cons (gh_double2scm (thick), gh_cons (gh_double2scm (dash),
-    ly_list1 (ly_list2 (ly_quote (),
-    gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
-    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))))))))))));
+  SCM sc[4];
+  for (int i=0; i<  4; i++)
+    {
+      sc[i] =  offset2scm (controls[i]);
+    }
+
+  // (lambda (o) (dashed-slur o thick dash '(stuff))
+  a.lambda_ = gh_list (gh_append3 (ly_lambda_o (),
+                                 ly_func_o ("dashed-slur"),
+                                 gh_list (gh_double2scm (thick),
+                                          gh_double2scm (dash),
+                                          ly_quote_scm (gh_list (sc[0], sc[1], sc[2], sc[3], SCM_UNDEFINED)),
+                                          SCM_UNDEFINED)
+                                 ), SCM_UNDEFINED);
 
   a.str_ = "dashed_slur";
   return a;
@@ -373,8 +383,6 @@ Lookup::hairpin (Real width, bool decresc, bool continued) const
     + to_str (continued ? height/2 : 0) + 
     + " draw_"  + String (decresc ? "de" : "") + "cresc\n";
   a.str_ = ps;
-
-
   a.dim_.x () = Interval (0, width);
   a.dim_.y () = Interval (-2*height, 2*height);
   a.font_ = font_;
@@ -385,8 +393,7 @@ Atom
 Lookup::plet (Real dy , Real dx, Direction dir) const
 {
   String ps;
-  
-  
+    
   ps += String_convert::double_str (dx) + " " 
     + String_convert::double_str (dy) + " "
     + String_convert::int_str ( (int)dir) +
@@ -407,21 +414,32 @@ Lookup::slur (Array<Offset> controls) const
   Real dx = controls[3].x () - controls[0].x ();
   Real dy = controls[3].y () - controls[0].y ();
   Atom a;
-  // (lambda (o) (slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2) .. )))
-  a.lambda_ =  (
-               ly_append (ly_lambda_o (), 
-                          ly_list1 (ly_append (ly_func_o ("slur"),
-                                               ly_list1 (ly_list2 (ly_quote (),
-                                                                   gh_cons (ly_list2 (gh_double2scm (controls[5].x ()), gh_double2scm (controls[5].y ())),
-                                                                            gh_cons (ly_list2 (gh_double2scm (controls[6].x ()), gh_double2scm (controls[6].y ())),
-                                                                                     gh_cons (ly_list2 (gh_double2scm (controls[7].x ()), gh_double2scm (controls[7].y ())),
-                                                                                              gh_cons (ly_list2 (gh_double2scm (controls[4].x ()), gh_double2scm (controls[4].y ())),
-                                                                                                       gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())),
-                                                                                                                gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
-                                                                                                                         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))))))))))))));
+
+  SCM scontrols [8];
+  int indices[] = {5,6,7,4,1,2,3,0};
+
+  for (int i= 0; i < 8; i++)
+    scontrols[i] = offset2scm (controls[indices[i]]);
+
+
+  a.lambda_ =
+    gh_append2 (ly_lambda_o (),
+               gh_list (gh_append2 (ly_func_o ("slur"),
+                                    gh_list (ly_quote_scm (gh_list (scontrols[0],
+                                                                    scontrols[1],
+                                                                    scontrols[2],
+                                                                    scontrols[3],
+                                                                    scontrols[4],
+                                                                    scontrols[5],
+                                                                    scontrols[6],
+                                                                    scontrols[7],
+                                                                    SCM_UNDEFINED)),
+                                             SCM_UNDEFINED)
+                                    ),
+                        SCM_UNDEFINED)
+               );
+
+
   a.str_ = "slur";
 
   a.dim_[X_AXIS] = Interval (0, dx);
index 487b3d2b9ae3d6a6d9f1118e73812c5685bf5980..bb7d6e3bfb8305e4cda9edbad140c27541e86cd4 100644 (file)
@@ -132,13 +132,7 @@ void
 Paper_outputter::output_scheme (SCM scm)
 {
   String o = String ("\'") + output_global_ch;
-#ifndef NPRINT
-  if (check_debug && !monitor->silent_b ("Guile"))
-    {
-      gh_display (scm); gh_newline ();
-    }
-#endif
-  // urg; temporary hack to debug scheme error #unknown
+
   if (String (output_global_ch) == "scm")
     {
       static SCM port = 0;
@@ -153,31 +147,23 @@ Paper_outputter::output_scheme (SCM scm)
          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 ()));
-  char* c = gh_scm2newstr (str_scm, NULL);
-#ifndef NPRINT
-  if (check_debug && !monitor->silent_b ("Guile"))
+  else
     {
-      gh_display (str_scm); gh_newline ();
+      SCM str_scm = gh_call1 (ly_eval (scm), gh_eval_str (o.ch_l ()));
+      char* c = gh_scm2newstr (str_scm, NULL);
+      *outstream_l_ << c;
+      free (c);
     }
-#endif
-  *outstream_l_ << c;
-  free (c);
 }
-
 void
 Paper_outputter::output_string (String str)
 {
@@ -214,8 +200,8 @@ void
 Paper_outputter::start_line ()
 {
   SCM scm =
-    ly_append (ly_lambda_o (),
-    ly_list1 (ly_append (ly_func_o ("start-line"), SCM_EOL)));
+    gh_append2 (ly_lambda_o (),
+               gh_list (ly_func_o ("start-line"), SCM_UNDEFINED));;
 
   output_scheme (scm);
 }
index 2e846acb431d9c87428f131056a3f0ba1f47bd5d..db42af1a36a1c9469870fe8000497c4de0f3d30a 100644 (file)
@@ -301,13 +301,13 @@ def draw_gclef (expr exact_center, reduction)=
 enddef;
 
 
-fet_beginchar("G clef", "violin", "violinclef")
+fet_beginchar("G clef", "treble", "trebleclef")
        if test = 1:
                draw_staff(-1,3);
        fi;
        draw_gclef((1.7 interline#,0), 1.0);
 fet_endchar;
-fet_beginchar("G clef", "violin_change", "cviolinclef")
+fet_beginchar("G clef", "treble_change", "ctrebleclef")
        draw_gclef((1.3 interline#,0), .8);
 fet_endchar;