Class DisplayRhythm

java.lang.Object
eu.bandm.music.demoMetric.DisplayRhythm

public class DisplayRhythm extends Object
  • Field Details

    • OFFSET_LEFT

      int OFFSET_LEFT
    • OFFSET_RIGHT

      int OFFSET_RIGHT
    • Y_STEMSTART

      int Y_STEMSTART
    • Y_BASE

      int Y_BASE
    • Y_STEMEND

      int Y_STEMEND
    • Y_STEMLET_START

      int Y_STEMLET_START
    • NOTEHEADSIZE

      int NOTEHEADSIZE
    • X_DIST_DOTS

      int X_DIST_DOTS
    • BRACKET_X_OFFSET_LAST_STEM

      int BRACKET_X_OFFSET_LAST_STEM
    • BRACKET_X_OFFSET_NEXT_STEM

      int BRACKET_X_OFFSET_NEXT_STEM
    • HALF_BRACKET_LABEL_WIDTH

      int HALF_BRACKET_LABEL_WIDTH
    • WIDTH_SHORT_BEAM

      int WIDTH_SHORT_BEAM
    • HEIGHT_BRACKET_LEVEL

      int HEIGHT_BRACKET_LEVEL
    • BRACKET_HEIGHT

      int BRACKET_HEIGHT
    • HEIGHT_BEAM

      int HEIGHT_BEAM
    • Y_BEAM_DISTANCE

      int Y_BEAM_DISTANCE
    • bracket_spans_whole_duration

      boolean bracket_spans_whole_duration
    • pauses_have_stemlets

      boolean pauses_have_stemlets
    • hide_all_brackets

      boolean hide_all_brackets
    • hide_all_numerators

      boolean hide_all_numerators
  • Constructor Details

    • DisplayRhythm

      public DisplayRhythm()
  • Method Details

    • drawNoteHead_1

      public void drawNoteHead_1(Graphics2D gr, int x, int y, int radius)
      Draw the head of a "whole note". FIXME LATER replace drawing by putting in GLYPH from some musical font !?!?!
    • drawNoteHead_2

      public static void drawNoteHead_2(Graphics2D gr, int x, int y, int radius)
      Draw the head of a "half note". FIXME LATER replace drawing by putting in GLYPH from some musical font !?!?!
    • drawNoteHead_4

      public static void drawNoteHead_4(Graphics2D gr, int x, int y, int radius)
      Draw the head of a "quarter note". Also used for eighths, etc. FIXME LATER replace drawing by putting in GLYPH from some musical font !?!?!
    • drawPause_1

      public static void drawPause_1(Graphics2D gr, int x, int y)
      Draw a "whole pause", i.e. a block hanging from a ledger line. FIXME LATER replace drawing by putting in GLYPH from some musical font !?!?!
    • drawPause_half

      public static void drawPause_half(Graphics2D gr, int x, int y)
      Draw a "half pause", i.e. a block standing on a ledger line. FIXME LATER replace drawing by putting in GLYPH from some musical font !?!?!
    • drawPause_quarter

      public static void drawPause_quarter(Graphics2D gr, int x, int y)
      Draw a "quarter pause". FIXME LATER replace drawing by putting in GLYPH from some musical font !?!?!
    • drawPause_eigth

      public static void drawPause_eigth(Graphics2D gr, int x, int y, int flags)
      Draw an "eights pause", or "sixteenth", "thirty-second", etc. FIXME LATER replace drawing by putting in GLYPH from some musical font !?!?!
         
               / -5  (Sixteenth)
               |
              /
              |
             /
             |
            /  / -2  (Eighth)
            | /
           / /   (0)
           |      
          /
         |      | <-- +2 
         -2     2
        
    • paintOneMeasure

      public void paintOneMeasure(@Opt MSplitter.Result rhythm, Graphics gr, int width, @Opt @Opt List<Tuple3<Rational,Integer,Double>> tempoCurve)
      Paint the result of a MSplitter call to the given graphics output context.
      Parameters:
      gr - instance of Graphics2D}. May come from swing/gui call-back, or be provided explicitly by the user for printing to a graphics file.
      width - the width of the graphics into which the rhythm shall fit. The drawing area is assumed to start at x=0, and the constants OFFSET_RIGHT and OFFSET_LEFT will be applied to find the x-pos of the first note/pause and the start of the (imaginary) subsequent measure start. (The HEIGHT is currently fixed to approx Y_BASE + 5, where the tie arcs start.)
      tempoCurve - if not == null: assume SORTED in the first components. At most two points with the same first component. Assert starts with "0/1". Assert ends later than measure.
    • paintFeatherBeam

      public static void paintFeatherBeam(Graphics2D gr, int skip, int draw, double leftX, double leftStart, double leftInc, double leftHeight, double rightX, double rightStart, double rightInc, double rightHeight)
      Draw one single beam or bemlet from a feathered beam aggregate.
      Parameters:
      gr - graphic context for painting
      skip - number of long beams above, when painting beamlets.
      draw - number of beams or beamlets
      leftX - x coordinate of left end of beam
      leftStart - y coordinate where topmost beam of aggregate starts (Attention, y coordinates grow downward)
      leftInc - distance of tops of beams on the left side
      leftHeight - height of all beams/beamlets on the left side
      rightX - , rightStart, rightInc, rightHeight: idem