]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.41
authorfred <fred>
Sun, 24 Mar 2002 20:04:46 +0000 (20:04 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:04:46 +0000 (20:04 +0000)
init/paper26.ly [new file with mode: 0644]
init/table20.ly
input/font-body.ly [new file with mode: 0644]
input/font.ly
input/font16.ly [new file with mode: 0644]
lily/staff-sym.cc
lily/tex-beam.cc

diff --git a/init/paper26.ly b/init/paper26.ly
new file mode 100644 (file)
index 0000000..4651188
--- /dev/null
@@ -0,0 +1,37 @@
+% paper20.ly
+
+\include "table26.ly"
+
+paper_twentysix = \paper {
+       linewidth = 15.0 \cm;
+       rulethickness = 0.5\pt;
+       barsize = 26.0 \pt;
+       interline = 6.5\pt;
+       notewidth = 7.15\pt; % ugh see table20 for sizes
+       wholewidth = 10.44\pt;
+       unitspace = 22.\pt;
+%      basicspace = 4.\pt;
+%      geometric = 1.414;
+       geometric = 0.;
+       basicspace = 9.\pt;
+
+       arithmetic_basicspace = 2.;
+        arithmetic_multiplier = 7.\pt;
+       
+       %
+       % three beams span two interlines, including stafflines:
+       % 2 interbeam + beam_thickness = 2 interline - staffline_thickness
+       % ( beam_thickness = 0.48 interline for now...)
+       % interbeam = interline - (beam_thickness + staffline_thickness) / 2
+       % interbeam = 3.6;
+       % ugh: interline *in fact* is rule_thickness + "interline"?
+       interbeam = 3.9;
+
+       gourlay_energybound = 100000.;
+       gourlay_maxmeasures = 12.;
+       
+       castingalgorithm = \Gourlay;
+       \symboltables { \table_twentysix }
+\include "engraver.ly"
+}
+
index 6742e056301caef27b0fd2db93aad31ce47d68bf..b641adb469482a77cc21fe79007ce268a2f1d83e 100644 (file)
@@ -67,7 +67,8 @@ table_twenty =
     % dims ignored for this table
     "param" = \table {
 %       "brace"    "\pianobrace{%}"    0.0\pt  0.0\pt  0.0\pt  0.0\pt
-        "brace"    "\pianobrace{%}"    0.0\pt  0.0\pt  40.0\pt 100.0\pt         
+       "rule" "\rulesym{%}{%}"
+       "brace"    "\pianobrace{%}"     0.0\pt  0.0\pt  40.0\pt 100.0\pt         
         "meter"        "\generalmeter{%}{%}"   0.0\pt  10.0\pt -5.0\pt 5.0\pt
         "stem" "\stem{%}{%}"
         "fill" "\hbox{}"
diff --git a/input/font-body.ly b/input/font-body.ly
new file mode 100644 (file)
index 0000000..cfb563d
--- /dev/null
@@ -0,0 +1,72 @@
+\version "0.1.7";
+FontBody=      \melodic{ 
+               \octave c';
+               \bar "|:";
+               \meter 4/4;
+               \multi 2  < { \stemup e'\longa a\breve | }
+               { \stemdown
+               c1 \clef "bass"; ''b \clef "violin"; c' a'
+               c2 \clef "alto"; g c' \clef "violin"; a'
+               } >
+               \stemboth
+               c4 g c' a' \bar ":|";
+               a\ppp-\upbow a\pp-\downbow a\p^\turn a\mp^\fermata |
+               a\mf_\fermata a\f-\stopped a\ff-\open a\fff^\trill|
+               a\fp a4.\sf a4.\sfz | % a\fz a\rf
+               [c8 c] [a' a']
+               [c a'] [a' c] |
+               [c \< d e f] [as' ges' f' e']
+               [cis' dis' c' des'] [cisis' disis' \! ceses' deses'] |
+               \clef "bass";
+                 r1 r2 r4 r8 r16 r32 r64 r128 r128 |
+               \multi 2 < { \stemup r2 r2} {\stemdown c c }>
+               \multi 2 < { \stemup ''c1 } {\stemdown r1}>             
+               \stemboth
+               \clef "violin";
+               e8_. g'8-> e16^^ g'16_^ 
+               e32 _| g'32^| g''32-\ltoe g''32-\lheel
+               e64 g'64 c4... |
+
+               \octave c'';
+               \meter 4/4;
+               \textstyle "finger";
+               c4^"1" d^"2" e^"3" f^"4" g^"5"
+               
+               % Music to the Martians!
+               < bes4^"6" e_"7" c_"8" >
+               a^"0"_"9"
+               
+               a'^\flageolet
+               \textstyle "roman";
+%{             % default abbreviations
+               c4 c4: c4:32 c4: c4 c2.
+               'a1
+               'a1:32
+               'c4:8 c': 'c4:16 c':
+%              [ 'c8:16 'c 'c 'c ] [ a a a a ]
+%              [ 'c 'f 'b e ] 
+%              [ 'c16:32 'c 'c 'c ] [ a16:32 a a a ]
+%%             % there's still some hairy beam bugfixing todo
+%%             [ c'8:16 g d 'a ]
+%%             [ c'16:32 g d 'a ]
+%%             [ 'c8:32 'f 'b e ]
+               [:32 c16 e]
+               [:32 c16 e]
+               [:16 c8 e]
+               [:16 e4 g]
+               [:16 e2 g]
+               [:16 e1 g]
+%}
+               \meter 1/2; a2 |
+               \meter 3/2; < a1.
+               { s4 \ppp \< s4 \! s4 \fff  s4 \> s4 \! s4\ppp} >
+               |
+               \meter 2/4; a2 |
+               \meter 5/4; a1.. |
+               \meter 6/8; a2. |
+               \meter 7/8; a2.. |
+               \meter 9/8; a1... |
+               \meter 12/8; a1. |
+               \meter 12/4;
+               r1. r2. r4. r8. r16. r32. r64. r64. |
+               }
index f1f1e8a00690a94f8bf0e4a716d6e2c2307bb5c2..7ec3ada7238a2fd966da20d07c414f6a6d674aae 100644 (file)
@@ -9,78 +9,8 @@ description = "This file tests the Feta music font";
 
 \version "0.1.7";
 
+\include "font-body.ly";
 \score{
-       \melodic{ 
-               \octave c';
-               \bar "|:";
-               \meter 4/4;
-               \multi 2  < { \stemup e'\longa a\breve | }
-               { \stemdown
-               c1 \clef "bass"; ''b \clef "violin"; c' a'
-               c2 \clef "alto"; g c' \clef "violin"; a'
-               } >
-               \stemboth
-               c4 g c' a' \bar ":|";
-               a\ppp-\upbow a\pp-\downbow a\p^\turn a\mp^\fermata |
-               a\mf_\fermata a\f-\stopped a\ff-\open a\fff^\trill|
-               a\fp a4.\sf a4.\sfz | % a\fz a\rf
-               [c8 c] [a' a']
-               [c a'] [a' c] |
-               [c \< d e f] [as' ges' f' e']
-               [cis' dis' c' des'] [cisis' disis' \! ceses' deses'] |
-               \clef "bass";
-                 r1 r2 r4 r8 r16 r32 r64 r128 r128 |
-               \multi 2 < { \stemup r2 r2} {\stemdown c c }>
-               \multi 2 < { \stemup ''c1 } {\stemdown r1}>             
-               \stemboth
-               \clef "violin";
-               e8_. g'8-> e16^^ g'16_^ 
-               e32 _| g'32^| g''32-\ltoe g''32-\lheel
-               e64 g'64 c4... |
-
-               \octave c'';
-               \meter 4/4;
-               \textstyle "finger";
-               c4^"1" d^"2" e^"3" f^"4" g^"5"
-               
-               % Music to the Martians!
-               < bes4^"6" e_"7" c_"8" >
-               a^"0"_"9"
-               
-               a'^\flageolet
-               \textstyle "roman";
-%{             % default abbreviations
-               c4 c4: c4:32 c4: c4 c2.
-               'a1
-               'a1:32
-               'c4:8 c': 'c4:16 c':
-%              [ 'c8:16 'c 'c 'c ] [ a a a a ]
-%              [ 'c 'f 'b e ] 
-%              [ 'c16:32 'c 'c 'c ] [ a16:32 a a a ]
-%%             % there's still some hairy beam bugfixing todo
-%%             [ c'8:16 g d 'a ]
-%%             [ c'16:32 g d 'a ]
-%%             [ 'c8:32 'f 'b e ]
-               [:32 c16 e]
-               [:32 c16 e]
-               [:16 c8 e]
-               [:16 e4 g]
-               [:16 e2 g]
-               [:16 e1 g]
-%}
-               \meter 1/2; a2 |
-               \meter 3/2; < a1.
-               { s4 \ppp \< s4 \! s4 \fff  s4 \> s4 \! s4\ppp} >
-               |
-               \meter 2/4; a2 |
-               \meter 5/4; a1.. |
-               \meter 6/8; a2. |
-               \meter 7/8; a2.. |
-               \meter 9/8; a1... |
-               \meter 12/8; a1. |
-               \meter 12/4;
-               r1. r2. r4. r8. r16. r32. r64. r64. |
-               }
        \paper{ 
            % don't change this.
            % otherwise 16pt and 20pt layouts differ.
diff --git a/input/font16.ly b/input/font16.ly
new file mode 100644 (file)
index 0000000..42b4cfe
--- /dev/null
@@ -0,0 +1,22 @@
+\header{
+title= "The Feta Font";
+subtitle = "proofsheet"; 
+enteredby =     "jcn & hwn";
+copyright =     "public domain";
+description = "This file tests the Feta music font";
+% "(Feta definitively is not an abbreviation of Font-En-TjA)";
+}
+
+\version "0.1.7";
+\include "font-body.ly"
+
+\score{
+       \FontBody
+       \paper{ 
+           % don't change this.
+           % otherwise 16pt and 20pt layouts differ.
+           linewidth = 12.5 \cm;
+           gourlay_maxmeasures =5.;
+       }
+}
+
index 4cd214b79bc36015a4ea9b5c9bd75220f1c293c7..ea4576e59bcbca41c382fb6d175c8b4584e4a8e6 100644 (file)
@@ -42,7 +42,7 @@ Molecule*
 Staff_symbol::brew_molecule_p() const
 {
   Paper_def * p = paper();
-  Atom rule  = p->lookup_l ()->rule_symbol (p->get_var ("rule_thickness"), 
+  Atom rule  = p->lookup_l ()->rule_symbol (p->get_var ("rulethickness"), 
                                            width ().length ());
   Real height = (no_lines_i_-1) * inter_note_f();
   Molecule * m = new Molecule;
index d756461a6ff784f8e979605f3fd3de83fe9d4316..f13ab2e94d9e91f803c4971cf4f83b673f43ec7a 100644 (file)
@@ -19,6 +19,8 @@
 #include "debug.hh"
 #include "lookup.hh"
 #include "misc.hh"
+#include "paper-def.hh"
+#include "string-convert.hh"
 #include "main.hh"
 
 Atom
@@ -42,7 +44,7 @@ Lookup::beam_element (int sidx, int widx, Real slope) const
 Atom
 Lookup::rule_symbol (Real height, Real width) const
 {
-  Atom bs=(*symtables_p_)("beamslopes")->lookup ("horizontal");
+  Atom bs=(*symtables_p_)("param")->lookup ("rule");
   Array<String> args;
   args.push (print_dimen (height));
   args.push (print_dimen (width));
@@ -55,24 +57,51 @@ Lookup::rule_symbol (Real height, Real width) const
 Atom 
 Lookup::beam(Real &slope, Real width, Real y_thick) const
 {
-  if (postscript_global_b)
-    {
-      return ps_beam (slope, width, y_thick);
-    }
-  else
-    return tex_beam(slope, width);
+  Atom a( postscript_global_b
+         ? ps_beam (slope, width, y_thick)
+         : tex_beam (slope, width));
+  
+  Real slope_y =slope * width; 
+  Real min_y = (0 <? slope_y )- y_thick/2;
+  Real max_y = (0 >? slope_y) + y_thick/2;
+  
+  a.dim_[X_AXIS] = Interval(0, width);
+  a.dim_[Y_AXIS] = Interval(min_y, max_y);
+  return a;
 }
 
 Atom
-Lookup::ps_beam (Real  slope, Real width, Real y_thickness)const
+Lookup::ps_beam (Real slope, Real width, Real y_thickness)const
 {
-  Atom ret;
-  String ps(String (width) + " "+ String(slope) 
-           + " " + String(y_thickness) + " draw_beam");
-  ret.tex_ = String("\\embeddedps{" + ps + "}");
-  ret.dim_[X_AXIS] = Interval(0, width);
-  ret.dim_[Y_AXIS] = Interval(0, slope * width + y_thickness);
-  return ret;
+  String ps = "\\embeddedps{\n";
+  ps += String (width) + " "+ String (slope) + " " + String (y_thickness)
+    + " draw_beam}";
+
+  /* 
+   beam parts are rarely wider than 100pt: 
+   precision of 4 yields maximum (half beam spanning half a page)
+   error of: 1%% * 3*72pt === 0.2pt = 0.07mm
+   */
+  String width_str = String_convert::precision_str (width, 4);
+  String slope_str = String_convert::precision_str (slope, 4);
+  String thick_str = String_convert::precision_str (y_thickness, 3);
+  String name = "feta-beum-" + width_str + "-" + slope_str + "-" + thick_str;
+
+  int i;
+  while ((i = name.index_i ('.')) != -1)
+    name[i]=  'x';
+
+
+  String mf = "\\embeddedmf{" + name + "}{\n";
+  mf += "input feta-beum;\n";
+  mf += "drawbeam(" + width_str + "," + slope_str + "," + thick_str + ");\n";
+  mf += "end.\n";
+  mf += "}\n";
+
+  Atom s;
+  s.tex_ = ps + mf;
+  
+  return s;
 }
 
 Atom
@@ -129,8 +158,6 @@ Lookup::tex_beam (Real &slope, Real width) const
 
   Atom ret;
   ret.tex_ = m.TeX_string();
-  ret.dim_.y() = Interval (0,width*slope);
-  ret.dim_.x() = Interval (0,width);
 
   return ret;
 }