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 (was: accidental


From: mskala
Subject: Re: converting svg glyph to path data for use in scheme (was: accidentals for just intonation)
Date: Sun, 13 Dec 2015 00:51:59 -0600 (CST)
User-agent: Alpine 2.20 (LNX 67 2015-01-07)

On Sat, 12 Dec 2015, N. Andrew Walsh wrote:
> accidentals as needed. I suppose, rather than having Lily/Scheme calculate
> prime factors on the fly at runtime, it would be easier to have a lookup
> table of the prime factorization for each integer up to a certain limit (but
> that would end up being very high, so maybe not). That's a computational
> problem for further down the road, though.

For numbers of 32 bits or so, doing prime factorization by simple-minded
trial and error on a present-day computer is cheaper than most people
realize.  It's a tight loop that fits in cache; the arithmetic may
actually be faster than a lookup table in main memory, and it's at least
unlikely to be prohibitively slow.

I think a trickier computational problem may be converting between
LilyPond's "rational number of semitones" and just-intonation's "rational
ratio of frequencies" ways to express pitch.  Because of the log function
in between, in general any number that has a representation on one of
those scales will have no exact representation on the other, and you're
forced to do some kind of rounding, or maybe abandon LilyPond's pitch
scheme for something else.  Have you decided how you want to deal with
this issue yet?

-- 
Matthew Skala
address@hidden                 People before principles.
http://ansuz.sooke.bc.ca/



reply via email to

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