lilypond-devel
[Top][All Lists]

Re: Towards a new pitch representation

 From: Felipe Gonçalves Assis Subject: Re: Towards a new pitch representation Date: Fri, 31 Dec 2010 06:59:51 -0300

```2010/12/31 Hans Aberg <address@hidden>:
> On 30 Dec 2010, at 23:16, Felipe Gonçalves Assis wrote:
>
> I made a proposal for a representation, and there is Haskell code available
> if you are interested.
>

Hi Hans. I would very much appreciate that code. I should remark
that your emails are what inspired me to start this. I take this opportunity
to thank you for everything.

> In it, the staff positions are expressed by a linear combinations of a
> sequence of seconds m, M, n_0, ..., n_k (whatever names you want to give
> them). If one only has a minor second m and a major second M, then sharps
> raise with the interval M - m and the flats lower with that interval.
>
> So I generalized this as to compute for any set of accidentals. The
> algorithm will depend on the typesetting preferences, but it is possible to
> compute them without any reference to pitches at all.
>

So, my idea is the same, except that I use the differences between the
seconds, so that the degree is just the coefficient of the major second,
and the calculation of accidentals is simpler (again, see notes on section
2.1 of towards123.txt).

>
> Rational numbers are not sufficient for the theoretically given: one must be
> able to take roots, for example when computing meantone values.
>

Firstly, I repeat that the use of rational numbers would be algebraically
equivalent to integers, so this does not come to the theoretical discussion
here, it would be just convenient with regards to backwards compatibility.

Secondly, taking roots does not change the situation. You can represent
that just using one more integer in your representation for each root.

Finally, we are primarily concerned with notation here, so the fact that we
represent a sharp by +1/2 does not forbid you to write a midi engraver that
implements your favourite temperament (as close as midi can get to that).

> So, for the exact given values, I added those roots. This suffices, as one
> is never going to add the numbers of the intervals - interval addition
> correspond to multiplication of numbers. The implementation representation I
> chose was as a prime factorization - a map from prime numbers to rational
> numbers. This seems to work well, as one is typically just working with a
> few small prime numbers.
>

Oh, I see. That is actually what I was talking about in towards123 when
I pointed the isomorphism between Z^(inf) and Q*, but that sounds like
unnecessary trouble to go with, even though it might look beautiful in

> But when working with inexact intervals, like in pitch bends or given s
> cents, etc., this proved inconvenient.
>
> So I added an inexact part, a floating point number (double). The
> representation is thus (r, x), where r is the exact number above, and x a
> floating point number. When x = 1.0, the representation is considered exact.
>

That is fine. But once more I remark that we are interested here in notation.
What you are attaining is to represent frequencies in a way that is virtually
always exact for music concerns (which looks quite promising, by the way).

Thank you very much for all the thoughts you have put in this.

Cheers,
Felipe

```