Class Justifier

java.lang.Object
com.softsynth.jmsl.score.justify.Justifier

public class Justifier
extends java.lang.Object
Justification of Justifiables, using two pass algorithm originally published in
D. Blostein and L. Haken, "Justification of Printed Music," Communications of the ACM, Vol. 34, No. 3, March 1991, pp. 88-99.
Author:
Nick Didkovsky, (c) 2005 Nick Didkovsky, nick@didkovsky.com
  • Constructor Summary

    Constructors
    Constructor Description
    Justifier​(java.util.Vector justifiables, double width)  
  • Method Summary

    Modifier and Type Method Description
    static double calcDurationalSpacing​(double duration)
    Calculate a non-linear spacing based on duration.
    static double calcDurationalSpacing​(double spacingBase, double duration)
    0 lt base lte 1.0
    static double getDurationalSpacingBase()  
    void justify()  
    static void setDurationalSpacingBase​(double base)
    base ranges from (0 to 1].
    void shift​(double xVal)  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Justifier

      public Justifier​(java.util.Vector justifiables, double width)
  • Method Details

    • justify

      public void justify()
    • shift

      public void shift​(double xVal)
    • calcDurationalSpacing

      public static double calcDurationalSpacing​(double spacingBase, double duration)
      0 lt base lte 1.0
    • calcDurationalSpacing

      public static double calcDurationalSpacing​(double duration)
      Calculate a non-linear spacing based on duration. Uses duration spacing base
      Returns:
      base^(ln(1/L))
    • setDurationalSpacingBase

      public static void setDurationalSpacingBase​(double base)
      base ranges from (0 to 1]. Default is 0.7. Controls how much a note's duration influences its non-linear spacing. High values (like 0.9) result in layout where note duration is less important than low values (like 0.5).
    • getDurationalSpacingBase

      public static double getDurationalSpacingBase()