Class BeamRenderer

java.lang.Object
com.softsynth.jmsl.score.BeamRenderer

public class BeamRenderer
extends java.lang.Object
A class with static methods to draw Beams across a Vector of Notes.
New broken secondary beam direction algorithm 2015-05-21. Search for lowest duration in beam group. For each note in beam group, assign it a number like so: starting with first note = 1, divide lowest duration into its duration, and advance a counter by that much. Then assign next note to ++counter and repeat for every note. For each odd note, secondary beam points right, for each even numbered note, secondary beam points left.
Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String copyright  
  • Constructor Summary

    Constructors
    Constructor Description
    BeamRenderer()  
  • Method Summary

    Modifier and Type Method Description
    static void calcStemDirection​(java.util.Vector notes)  
    static boolean containsDursBiggerThanEighth​(Track t, int start, int end)  
    static RunRange findDurationRun​(java.util.Vector notes, int startIndex, int duration)
    duration in terms of 8th, 16th, 32, 64, 128 .
    Durations match upwards, ie, if scanning for 16th, then notes with 16, 32, 64, 128 durs match
    beamsBreak flag true if you want beams on consecutive non-rest notes only.
    static void renderBeams​(java.awt.Graphics g, double zoom, java.util.Vector notes)  
    static void setStemDirection​(java.util.Vector notes)  

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • BeamRenderer

      public BeamRenderer()
  • Method Details

    • renderBeams

      public static void renderBeams​(java.awt.Graphics g, double zoom, java.util.Vector notes)
    • calcStemDirection

      public static void calcStemDirection​(java.util.Vector notes)
    • setStemDirection

      public static void setStemDirection​(java.util.Vector notes)
    • findDurationRun

      public static RunRange findDurationRun​(java.util.Vector notes, int startIndex, int duration)
      duration in terms of 8th, 16th, 32, 64, 128 .
      Durations match upwards, ie, if scanning for 16th, then notes with 16, 32, 64, 128 durs match
      beamsBreak flag true if you want beams on consecutive non-rest notes only. False if you want beams to cross rests.
    • containsDursBiggerThanEighth

      public static boolean containsDursBiggerThanEighth​(Track t, int start, int end)