Class GraphartScharen

java.lang.Object
eu.bandm.music.top.SvgSource
eu.bandm.music.top.GraphartScharen

public class GraphartScharen extends SvgSource
Renders graphical art according to a dynamic score, based on a project by DKR and ML from 1980, called "Graphart Scharen".
The main example score is sig/examples/tscore/scharen0.tscore.

Score format is as follows:

   SCORE x PARS y 
      T      0              20            1'20             2'10
   VOX a     0,0/           %,99          /                99,0
   // main param is position, integer from 0 to 99
   // rendering makes viewport interpretation, eg. 20--70      -> 0 --1024
   //                                              scoreCoord  -> physCoord
             "-" means: hold value until next explicit value (is default)
             "/" means: start linear interpolation


    P  orient 
    // orientation: CURRENTLY only 0 or 90.

    P  num  3          
    // number of lines >=2, NOT INTERPOLATING

    P  dist
    // distance 0.0 to 99.9999, same scale as position, etc.

    P  width
    // linewidth, scale=position*100 
    P  len  20          
    // same units as position

    P  color 0,0,99/                      0,99,0-/
    // color is integer RGB, 99 is full, 0 is not present
    // Defaults to naive complement of background color.

    P  alpha 0-/
   // alpha is transparency, 0 is opaque, 99 is invisible

   sequential source order of voices defines the (decreasing) visibility z-stacking 
   viewport will be defined when rendering
       <x1, x2, y1, y2, size> TO <0, width, 0, height> 
 
Sensible extension would be:
  • arbitrary rotation, dynamic
  • selectable background color
(for comments on dynamic svg see docu of superclass)

Coordinate System is the usual peculiar one:
     (0,0)------------------>
      |
      |       (x,y)========  \
      |       =============  / dist
      |       =============
      |       \____len____/
      V
 
Code generation scheme of one(1) sheaf:
 [g]
   [g]
     [g]
       [line x="0" .." /]
       [line x="1*dist" .." ]
          [animate "x" from "1*dist" to "1*dist'" fill="freeze" .. /]  // <---DIST
       [/line]
       [line x="2*dist" .." ]
          [animate attributeName="x" from="2*dist" to="2*dist'" begin=".." end=".."  .. /]
          [set attributeName="len" to="0" begin=".."/]      // <-- NUM. when it decreases
          [set attributeName="len" to="100" begin=".."/]    //     .. increases
       [/line]
       [animateTransform attributeName="transform"
         type="scale" from="1 len/100" to="1 len'/100" .. /]     // <-- LEN 
     [/g]
     [animateTransform attributeName="transform"
       type="translate" from="x 0" to="x' 0" .. /]             // <-- X
   [/g]
   [animateTransform attributeName="transform"
     type="translate" from="0 y" to="0 y'" .. /]             // <-- Y
   [animate attributeType="CSS" attributeName="stroke-width"
     from="x 0" to="x' 0" begin=".." dur=".." /]             // <-- WIDTH
   [animate attributeType="CSS" attributeName="stroke"
     from="x 0" to="x' 0" .. /]                              // <-- COLOR
   [animate attributeType="CSS" attributeName="stroke-opacity"
     from="1.0" to="0.01" .. /]                              // <-- ALPHA
 [/g]