]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.8
authorfred <fred>
Tue, 5 Nov 1996 14:41:53 +0000 (14:41 +0000)
committerfred <fred>
Tue, 5 Nov 1996 14:41:53 +0000 (14:41 +0000)
paper.cc

index a0e533f62636a47dc84caec9623cdc6a650d443e..89f9a9fe5ca47c011d03d46b1cf5dbf27d805719 100644 (file)
--- a/paper.cc
+++ b/paper.cc
@@ -1,16 +1,33 @@
+#include <math.h>
+
 #include "paper.hh"
 #include "debug.hh"
 #include "lookupsyms.hh"
 #include "dimen.hh"
 #include "textdb.hh"
 
+double log2(double x) {
+    return log(x)  /log(2.0);
+}
+
+
+// golden ratio
+const Real PHI = (1+sqrt(5))/2;
+
+// see  Roelofs, p. 57
+Real
+Paperdef::duration_to_dist(Real d)
+{
+    return whole_width * pow(geometric_, log2(d));
+}
+
 Paperdef::Paperdef()
 {
-    linewidth = convert_dimen(15,"cm");                // in cm for now
-    whole_width= convert_dimen(2,"cm");
     lookup_ = new Lookup();
     parse();
-    
+    linewidth = convert_dimen(15,"cm");                // in cm for now
+    whole_width= 6*note_width();
+    geometric_ = PHI;
 }
 
 void