]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/misc.cc
Merge with master
[lilypond.git] / lily / misc.cc
index c64983d8642fd224cdd32392ec719e9281c384c5..6837df0d744838c4eff0978318902ff3d6324e6c 100644 (file)
@@ -56,6 +56,14 @@ peak_around (Real epsilon,  Real threshold, Real x)
   return max (- epsilon * (x - threshold) / ((x + epsilon)  * threshold), 0.0);
 }
 
+/*
+  0 at 0,  1 at standard_x, and increasing thereafter. 
+ */
+Real
+convex_amplifier (Real standard_x, Real increase_factor, Real x)
+{
+  return (exp (increase_factor * x / standard_x) - 1.0) / (exp (increase_factor) - 1.0); 
+}
 
 string
 camel_case_to_lisp_identifier (string in)