Hi everybody (especially Don Simons)!

Here is the promised algorithm for horizontal spacing:
(sorry for the delay)

1. For each column (of notes starting at the same time) Ci find its
   starting time Ti and duration Di (Di = T(i+1) - Ti)
2. For each column Ci:
   a. if Di (column duration) is shorter than the shortest note in the
      column, set Di = Di / 2      (it's not a trick, it's a SONY :-))
   b. compute graphical length of the column: Li = c*sqrt(Di)
      where c is any reasonable constant; linear scaling is not
important
      in this stage.
   c. increase Li if there should be more space for lyrics or
accidentals
      of the next column.

That's all, folks.

You may ask me, how does it solve combination of triplets and quarter
notes, for example. Look at this picture:

Column:    C1      C2   C3   C4      C5
Time:      0       1/3  1/2  2/3     1
Duration:  1/3     *)   1/12 1/3
---------------------------------------
           Q            Q            Q  (quarters)
           T       T         T       T  (triplets)

   *) applying step 2.a.: (1/2 - 1/3) / 2 = 1/12

What do we need?

1. Equally spaced quarters: L1 + L2 = L3 + L4
   Obviously true: L1 = L4 = sqrt(1/3)
                   L2 = L3 = sqrt(1/12).

2. Equally spaced triplets, i.e.: L1 = L2 + L3 = L4
                            1
   L1 = L4 = sqrt(1/3) = -------
                         sqrt(3)

   L2 + L3 = sqrt(1/12) + sqrt(1/12) =

          2           2          2           1
     = -------- = --------- = --------- = -------
       sqrt(12)   sqrt(4.3)   2.sqrt(3)   sqrt(3)

BINGO!

This algorithm is very simple and will not fail in any rythmic
situation.
(I mean: the result is always reasonable in any situation.) It does not
solve correctly for example combination of different irregular values at
the same time. (For example: imagine quintuplet in upper staff and
triplet in lower staff. The result will not be extremely ugly, only the
space after the first quintuplet will be a little bit wider than should
be.)

For further discussion:
Is the step 2.a. acceptable? Look at these pictures:

  Q.          S   Q     (Q = quarter, Q. = dotted quarter, S = 8th)
  Q       Q       Q     before 2.a., equal space before and after 8th

and

  Q.         S   Q
  Q       Q      Q     after 2.a., space before 8th is shortened

Remember: the SPACE is not divided by two, only the TIME before sqrt.
The resulting space is 1/sqrt(2) times shorter.
Is this better (I think it is, my book of notography recommends it),
or not?

Any comments welcomed.

Bye,
Stanislav Kneifl.

-- 
Approved by mutex-owner

Reply via email to