Class FeldmanVisual

java.lang.Object
eu.bandm.music.applications.feldproj.FeldmanVisual

public class FeldmanVisual extends Object
Creates a sequence of pages which come close to the original graphic notation of Morton Feldman. Use only once: construct a fresh instance for a score and call render(int,int). After completion one (a) can get the images from pages or (b) let them write to ".png" files by writeToFiles(java.io.File,java.lang.String).

The dimensions are as follows

     <---------- page width ------------------------------------>
     <---------- text width ------------------------------->
       leftMargin                                           <--->
     <--->           measureWidth                           rightMargin
          <--------><--------><--------><--------><-------->
(0,0)*-----------------------------------------------------------+  
     | > topmargin                                               |  ^
     | 0  [1]______   (<---Taktzahlen--->)        [5]            |  |
     | 1  |________|  > eventHeight  ^ :   (y grows downward!)   |  |
     | 2  |________|                 | :      |                  |  |textheight
     | 3  |________|                 | staffSkip                 |  |
     | 4   ________:_________________V_:      V     > interStaffGap 
     | 5  |________|     _    ;        :                         |  |
     | 6           :    |_|   :        :                         |  |
     | 7           :__________:        :                         |  |
     | ...                                                       |  ..
     | n*4.3                                                     |  |
     | n*4-2                                                     |  |
     | n*4-1                  |_________|                        |  |
     | n*4                                                       |  |
     | n*4+1         [author, page number etc.]                  |  V
     +-----------------------------------------------------------+
  
  • Field Details

    • score

      protected final FeldmanProjection_n score
      The score data which is rendered by this instance.
    • msgr

      final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr
    • msg

      final SimpleMessage.Sender<eu.bandm.tools.util.xml.XMLDocumentIdentifier> msg
    • backgroundColor

      @Opt final @Opt Color backgroundColor
    • voice2staff

      protected Map<Vox,Integer> voice2staff
      evident
    • staff2shortName

      protected List<@Opt String> staff2shortName
      evident
    • staff2longName

      protected List<@Opt String> staff2longName
      evident
    • subordinates

      protected Set<Integer> subordinates
      Causes that this staff is linked to the preceding (upper neighbour) staff by one "accolade" (=bracket), forming a "piano staff". Is currently only used for "harmonic" voices: Both voices are started synchronuously, an accolade is drawn, and the name of the former is centralized,
    • textWidth

      int textWidth
      See graphic at class level.
    • maxRightMargin

      public static final int maxRightMargin
      See Also:
    • rightMargin

      int rightMargin
      See graphic at class level. Is a certain percentage of pageWidth, limited by maxRightMargin.
    • pageWidth

      int pageWidth
      See graphic at class level.
    • maxLeftMargin

      public static final int maxLeftMargin
      See Also:
    • leftMargin

      int leftMargin
      See graphic at class level. Is a certain percentage of pageWidth, limited by maxLeftMargin.
    • textHeight

      int textHeight
      See graphic at class level.
    • topMargin

      public static final int topMargin
      See graphic at class level.
      See Also:
    • MEASURE_BASELINE

      protected int MEASURE_BASELINE
      The vertical positions on which the measure numbers are printed.
    • OVERLAP

      protected int OVERLAP
      How far the box which overlaps a page break overlaps the measure bar.
    • NAME_DISTANCE

      protected int NAME_DISTANCE
      How far the end of the voice name is separated from the first measure line.
    • showMeasureNumber_every

      protected final int showMeasureNumber_every
      At which distance a measure number shall be displayed. Sensible values are 4, 5, 10, etc. Set to 10_000 (or sim.) for no display.
      See Also:
    • showMeasureNumber_pageStart

      protected final boolean showMeasureNumber_pageStart
      Whether the measure number shall be displayed with every first measure on a page.
      See Also:
    • DIAMOND

      public static final String DIAMOND
      Repreents the "harmonic" modifier and the harmonic voice name. Is unicode U+25C7 = WHITE DIAMOND.
      See Also:
    • interStaffGap

      protected int interStaffGap
      Calculated value which separates staves
    • measureWidth

      protected int measureWidth
      Calculated value, evident
    • eventHeight

      protected int eventHeight
      Calculated value, evident
    • staffSkip

      protected int staffSkip
      Calculated value, from the lowest line of one staff to the lowest line of its neighbour
    • eventLineWidth

      protected int eventLineWidth
      Calculated value: linewidth for draeing the boxes of the events.
    • pages

      protected List<BufferedImage> pages
      Result = list of the images prdouced by render(int,int) .
    • iterators

      protected Map<Vox,Iterator<Event>> iterators
      evident
    • events

      protected Map<Vox,@Opt Event> events
      The next event to start in the drawing process (may be wide in the future)
    • leftStart

      protected Map<Vox,TpTop> leftStart
      The measure start just below or equal to the start of the event in events
    • rightEnd

      protected Map<Vox,TpTop> rightEnd
      The measure start just above or equal to the end of the event in events
    • openEvents

      protected Set<Event> openEvents
      The events currently tsill running when the next measure is started.
  • Constructor Details

  • Method Details

    • render

      public void render(int width, int height)
      Central Point of Service.
      Parameters:
      width - pixel width of the generated image
      height - pixel height of the generated image
    • nextEvent

      protected void nextEvent(Vox vox)
      Fill all the caches with the coordinates of the next event in the given voice.
    • yLow

      protected int yLow(Vox vox, @Opt @Opt Event e)
      Returns the top cooordinate where to draw a box for an event, or of the top line of the staff if no event given. ("Low" means "numerically low" = "graphically top" !)
    • yStaff

      protected int yStaff(int staff)
      Returns the upper (numerically lower) y-coordinate of the region of the biven staff.
    • getFrame

      public JFrame getFrame(String title)
      Constructs a top-level Swing object which presents all generated images, for immediate inspection.
    • writeToFiles

      public void writeToFiles(File dir, String stem)
      Write all generated images into files, in the ".png" format. The files will be "/_000.png", "/_0010.png", etc. Can be called after render(int,int).
    • main

      public static void main(String[] args)
      Stand-alone application, translates input file "arg[0]" and shows a swing windows with a "tabbed pane" with all the rendered pages.