On 27 Sep 2013, at 08:45, David Kastrup <d...@gnu.org> wrote: > Well, today's xkcd, at the surface more being about LilyPond's choice of > extension language, still seems somewhat on-topic here: > > <http://xkcd.com/1270/> (mark the mouse-over text)
Perhaps some mathematical abstractions can help: The set of intervals I one wants to typeset, i.e., the set of pitches expressed relative a tuning note, is a free abelian group [1]. So it looks like a finite product of copies of Z, the set of integers. There is scale degree function deg: I -> Z, setting the tuning note to 0, which is a group homomorphism: one chooses the scale degree for each generator, and extend by linearity. This function is used to find the position of the notehead in the staff system. The staff system requires there to be a section s: Z -> I, that is, a function s with the property that the function composition deg o s is the identity on Z, i.e., deg(s(k)) = k for all k in Z. This just expresses that each position k on the staff, expressed as an integer relative the tuning note, has a note value in I, denoted by s(k). When typesetting a note x in I, first find deg(x) to get its position on the staff relative the tuning note; so there should be a notehead in that position. Then y = s(deg(x)) is the note that the staff expresses in that position. The note z = x - y has degree 0: deg(z) = deg(x - y) = deg(x) - deg(y), since deg is a group homomorphism; and deg(x) - deg(y) = deg(x) - deg(s(deg(x))) = deg(x) - deg(x) since s is a section. So z should be typeset using an accidental. There can be various algorithms for that. There can be different generators for I. Traditionally, one uses the perfect fifth P5 and the octave P8. One can choose a different set of generators, for example the minor second m and the major second M. When doing microtonality, just add more generators. When computing interval values to make the music playable, different choices of free bases of I lead to a matrix equation. Hans 1. Abelian because of transposition, finitely generated as we only want to express a finite set of pitches, and torsion free, as we cannot realize finite order elements as intervals when given values. Then a finitely generated torsion free abelian group is known to be free. _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel