back to list

Re: Cents to Ratio

🔗Robert Walker <robertwalker@...>

6/4/2003 12:00:25 AM

HI Paul,

I did programming to find the best n-limit approximations to a cents
value, or ratio etc - probably this may be what you remember.

Since most of the ratios we are interested in in tuning are quite small,
then the coding doesn't need to be greatly optimised.

In fact, I had good success by just searching through all possible quotients.
For each one you can just look at the two nearest suitable denominator for each
denumerator above and below - easily calculated given the quotient,
to form ratios above and below the target value. Then just look through those
to find all the ones of the required type. It is fast
enough on a modern machine especially if you are only interested in numbers
less than 1000, or even 10000 say. Even fast enough in Java which is slower than c.

The javascript web page I did for this is still available at:

http://tunesmithy.netfirms.com/japplets/ratios_with_factors.htm

Users of FTS can also find prime limit ratios by a similar method using
the File | Number Options | Ratio Options | Tolerance in cents for approximate
ratios - and then enter the factors they want to use in the field below
- then all scales in fTS will be shown as the nearest approximate ratios to the desired
tolerance. To see the factorisation you just select "Show factorisation" in the
same dialog.

This will be a bit faster than the javascript page as it is in c which
is a faster language (compiled rather than interpreted).

I also did some MSDOS console apps - c source code and easily ported
to other platforms - for finding close approximations to one ratio
by another to another prime limit - e.g. 5 limit approximations to seven
limit ratios etc.

There if the number of distinct primes isn't too large then you can
also find the closest n-limit ratios quite speedily enough by simple brute force searching of the
lattice, and simple use of logs. Nothing particularly sophisticated by mathematical standards.
This is a faster method in calculation time than that javascript page - but a bit more
complex to code for.

It can be used to find all those dieses and things - which is the main
situation where you see huge numbers in tuning theory. Slows down when you get
to _really_ high numbers.

Not converted to javascript applets yet but could do some day - and maybe make
then all as windows programs too rather than console apps (easier to use in Windows).

There are much more sophisticated mathematical methods of searching a
lattice to find closest points which would be faster than either of these
methods - but I didn't go into that - would be interested
to find out more later. Did a prelimary search but couldn't quite fidn what I
needed straight away. Would really only need them for huge numbers - large powers
e.g. in the hundreds, or if you want to go up to some quite high prime limit e.g.
13 limit ratios or something.

Anyway if anyone is interested in my MSDOS console apps to find n-limit ratios
for high exponents, then I can upload them - think I did it once before but wherever they were
they have probably gone now.

BTW has anyone else yet listened to the program that Charles Lucy
posted to the tuning list? I just listened to it and enjoyed it.
You don't need to be in the UK as you can hear it re-broadcast from its
Listen Live page:
http://www.bbc.co.uk/radio4/progs/listenagain.shtml
(under "Out of tune")

Has an interview with a traditional Shakuhachi player, amongst other things
and an Arabic music singer talking about quarter tones. Also discussion of
bells.

thanks,

Robert