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 msk...@ansuz.sooke.bc.ca People before principles. http://ansuz.sooke.bc.ca/ _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user