lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: converting svg glyph to path data for use in scheme


From: N. Andrew Walsh
Subject: Re: converting svg glyph to path data for use in scheme
Date: Mon, 14 Dec 2015 13:26:36 +0100

Converting cents to ratios only makes even a bit of sense if you have some preexisting music in some temperament, which you then want to approximate in just intonation. But even that isn't really something that would be served by calculation from cents and not simply determining yourself what ratios you want (because, at base, deciding which ratio you want to have is entirely arbitrary). Now, if you have some closed scale, it's simply a matter of figuring out the cents values for the notes in the scale, and then rounding your preexisting notes to the nearest one. 

But if you are using any kind of temperament at all, you're dealing at base with irrational numbers, and no computation is going to provide meaningful results unless you specify beforehand what your limits are (in which case you're specifying a closed scale, and it's thus much simpler to do the calculations in the other direction). For example, here are all the ratios in a very basic scale that fall within a quartertone of 600 cents: 11/8, 18/13, 7/5, 17/12, 10/7, 23/16, 13/9, and 16/11. Which one of those counts as a "tritone" for your scale depends almost entirely on how simple you want to keep the ratios (and if simplicity isn't necessarily your goal, there's also 352/256, 89/64, 179/128, 359/256, 181/128, 367/256, and 373/256; all of those are pure overtones). 

Saying you want to convert from cents to ratios is a self-contradictory proposition. The degree of accuracy you want depends on an a priori determination of the limits of your scale, in which case you're working from ratios regardless. 

Meanwhile, I'm teaching myself fontforge. And here I thought it was commercial software, and I already had it installed. 

Cheers,

A

On Mon, Dec 14, 2015 at 12:51 PM, Trevor Daniels <address@hidden> wrote:

David Kastrup wrote Monday, December 14, 2015 11:32 AM


> Urs Liska <address@hidden> writes:
>
>> Am 13.12.2015 um 14:09 schrieb Graham Breed:
>>> On 13/12/15 12:48, N. Andrew Walsh wrote:
>>>> Take a look at conversions.ly (sorry; mround is the equivalend
>>>> function in
>>>> the spreadsheet I use to do the same thing). Those functions will
>>>> convert
>>>> the input (given as a fraction comprising two integers) into Lily's
>>>> semitone values. That should allow you to convert between
>>>> just-intonation
>>>> ratios an the nearest note name. Urs has some comments in there
>>>> explaining
>>>> a bit how it works.
>>>
>>> Converting from ratios to cents is easy.  Converting between ratios
>>> and cents requires a function from cents to ratios.  That's a lot more
>>> difficult because information is lost.  You got us excited by
>>> suggesting that had been solved.
>>
>> Well, this is because conversion from cent to ratio isn't part of the
>> objective currently.
>
> Guile has
>
> (rationalize (inexact->exact (atan 0 -1)) #e1e-6)
>
> so you can try converting irrational numbers to ratios.  However,
> figuring out the precision to use may be tricky and there is no "prefer
> simple ratios" option.  All you have to work with is the eps argument.

One way to approach this would be via continued fractions.
These provide a means to determine the "best" rational approximations
to a real number.

The continued fractions give a list of rational approximations in
which each member is a closer approximation to the real value than
the previous members, and each is also closer than any approximation
with a smaller or equal denominator.

For example, pi = [3;7,15,1,292,1,1,...] as a continued fraction,
which gives the successive "best" rational approximations to pi of
3/1, 22/7, 333/106, 355/113, ...

Not sure how you'd determine which of the ratios was "correct" when
used for conversion from cent to ratio, though.  Maybe try a few
and see what comes out.

Trevor
_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

[Prev in Thread] Current Thread [Next in Thread]