From the help for Tune Smithy
Skip navigation Overview Seeds etc User guide Main Window Musical note intervals Scales Midi in Analyse sound
Contents
Hide Contents
Cents and ratios Ratios with factors Mean tone in cents More applets at Music and Virtual Flowers

Find the closest ratios for a scale - or convert to other notations

Cents or ratios Decimal Hertz Cents or n-et

Scale (single value or entire scale):

Scale in cents (display only):

1/1 in Hz (middle C = 261.62556 Hz, A = 440)

Decimal places

upper lower both closest

Prime or composite factors to test
(leave blank to test all ratios) see also more options (below)

Closest Ratios

Result of factorisation

Closest ratios As cents

Cents diffs from scale values

Tolerance cents, Max quotient
How far from closest numerator to search for each denominator steps (0 for no limit)

Enter a single value in the Scale box to see successive ratio approximations to it. Shows ratios with increasing quotients until a ratio is reached within the specified tolerance.

You can also enter an entire scale in the Scale box. If there is more than one entry, only the most accurate ratio for each entry gets shown in the Ratios box. However, you can then scroll down this page to see the successive ratio approximations for each scale degree to see all the other ratios found for each entry.

You can also use this applet to convert an entire scale betweenn the various notations. Enter the entire scale into the Scale box as before, then change the selection for the notation. Choose how many decimal places you want to see. Values in hertz are shown with two extra decimal places, and decimals are shown with four extra decimal places. When converting to n-et, the tolerance is used a tenth of the tolerance selected for the scale results. All n-ets are checked up to 1200-et, and the best one used.

To convert to cents, just enter the scale in the selected notation and the scale in cents gets shown below.

The n-et notation works like this: 7//17 means the 7th degree of seventeen equal temperament - so this is short for . 7/17 * 1200 cents. So - a fractional mutliple of 1200 cents.

For the cents or ratios use a '/' when you want to enter a ratio. All other values are understood to be in cents. So you don't need to enter the decimal point - this is just to make it quicker to enter values by hand in the applet. Note - the standard SCALA notation requires all cents values to include a decimal point.

For the n-et notation then when entering data by hand / is understood as // when n-et notation is selected. Annything else is understood as centvs.

Set the tolerance to the minimum difference you want between the ratio and the cents value. Note that if you set the max quotient high, and the tolerance low, then the calculation will be slow, - this script isn't particularly speedy as it goes through the quotients one at a time testing them all. Also, it is written in javascript, which is a slow language because it is "interpreted" (each instruction gets parsed every time it is used, rather than it all being done at once in advance of the calculation in a separate build step when the program gets made)..

You can show the approximations found above the desired value only (positive cents diffs), below it only, both (i.e. both those sequences, interleaved - shown in order of the size of the quotient) or the closest ones. The difference between both, and closest, is that with closest the absolute values of the cents diffs keep decreasing each time, while with both, the positive values decrease, the negative ones do also, but sometimes a negative cents diff may be larger than the previous positive one or vice versa.

To halt the calculation, and try again, use your browser STOP button. The calculation may well be slow if you set the tolerance low as the method used is rather inefficient. It is just one that is easy to code and works for the small ratios of most interest in scale design.

More options for the list of primes

List the primes you want to appear in the ratios for the Primes (or composite factors) field - e.g. 2 3 5 7 for 7-limit ratios - or if you want to see all approximations whatever their factors, leave the primes field blank.

You can also set a maximum power for a prime, do it like this: " 2^8 3^5 " to set max powers of 2^8 and 3^5. This means that three can only be used up to the eighth power in the ratio, and three only up to the fifth power.

To exclude a prime, show it as a negative number. E.g. use -7 to search for all numbers except those divisible by 7. This can be combined with the positive primes, e.g. use 3 -9 to allow any multiple of 3, except for those that are a multiple of 9 (not sure why one would want to do it, but it comes for free!).

To set a maximum power for a prime, do it like this: "2^8 3^5" to set max powers of 2^8 and 3^5.

Entries in this field can also be composite. So for instance, if you enter 6 as a value, you will find ratios with denumerator or denumerator a multiple of 6 .

Note to programmers: You are welcome to modify this code and copy it, and use it in your own web pages or programs - it is free source. Use View Source in your browser, and cut and paste. No restrictions, and no need to acknowledge the author anywhere including in your code - also of course also, no warranties of fitness for any purpose. 

Successive ratio approximations for each degree of the scale

Ratios for degree 1

Factorisation 1

As cents

Cents diffs

Ratios for degree 2

Factorisation 2

As cents

Cents diffs

Ratios for degree 3

Factorisation 3

As cents

Cents diffs

Ratios for degree 4

Factorisation 4

As cents

Cents diffs

Ratios for degree 5

Factorisation 5

As cents

Cents diffs

Ratios for degree 6

Factorisation 6

As cents

Cents diffs

Ratios for degree 7

Factorisation 7

As cents

Cents diffs

Ratios for degree 8

Factorisation 8

As cents

Cents diffs

Ratios for degree 9

Factorisation 9

As cents

Cents diffs

Ratios for degree 10

Factorisation 10

As cents

Cents diffs

Ratios for degree 11

Factorisation 11

As cents

Cents diffs

Ratios for degree 12

Factorisation 12

As cents

Cents diffs

Ratios for degree 13

Factorisation 13

As cents

Cents diffs

Ratios for degree 14

Factorisation 14

As cents

Cents diffs

Ratios for degree 15

Factorisation 15

As cents

Cents diffs

Ratios for degree 16

Factorisation 16

As cents

Cents diffs

Ratios for degree 17

Factorisation 17

As cents

Cents diffs

Ratios for degree 18

Factorisation 18

As cents

Cents diffs

Ratios for degree 19

Factorisation 19

As cents

Cents diffs

Ratios for degree 20

Factorisation 20

As cents

Cents diffs

Ratios for degree 21

Factorisation 21

As cents

Cents diffs

Ratios for degree 22

Factorisation 22

As cents

Cents diffs

Ratios for degree 23

Factorisation 23

As cents

Cents diffs

Ratios for degree 24

Factorisation 24

As cents

Cents diffs

Ratios for degree 25

Factorisation 25

As cents

Cents diffs

Ratios for degree 26

Factorisation 26

As cents

Cents diffs

Ratios for degree 27

Factorisation 27

As cents

Cents diffs

Ratios for degree 28

Factorisation 28

As cents

Cents diffs

Ratios for degree 29

Factorisation 29

As cents

Cents diffs

Ratios for degree 30

Factorisation 30

As cents

Cents diffs

Ratios for degree 31

Factorisation 31

As cents

Cents diffs

Ratios for degree 32

Factorisation 32

As cents

Cents diffs