back to list

Cents to Frequency?

🔗Jacky Ligon <jacky_ekstasis@yahoo.com>

9/19/2000 2:47:32 PM

What is the best way to convert cents measurements into pitch values?
Obviously, one must know the starting frequency. What is the best
method for both a rational and irrationally derived cents value?

Can Scala do this?

Kind Mathematical Masters, please help! Grovel, Grovel.

}: )

Thanks,

Jacky Ligon

🔗Joseph Pehrson <josephpehrson@compuserve.com>

9/19/2000 5:10:20 PM

--- In tuning@egroups.com, "Jacky Ligon" <jacky_ekstasis@y...> wrote:

http://www.egroups.com/message/tuning/13051

> What is the best way to convert cents measurements into pitch
values?
> Obviously, one must know the starting frequency. What is the best
> method for both a rational and irrationally derived cents value?
>
> Can Scala do this?

Hi Jacky!

Well, you certainly don't have to be a mathematician in order to get
Scala to do this...

All you do is give the command:

show/freq

For example, the Partch scale:

Harry Partch's 43-tone pure scale
0: 1/1 0.000 unison, perfect prime
1: 81/80 21.506 syntonic comma, Didymus comma
2: 33/32 53.273 undecimal comma
3: 21/20 84.467 minor semitone
4: 16/15 111.731 minor diatonic semitone
5: 12/11 150.637 3/4-tone, undecimal neutral
second
6: 11/10 165.004 4/5-tone, Ptolemy's second
7: 10/9 182.404 minor whole tone
8: 9/8 203.910 major whole tone
9: 8/7 231.174 septimal whole tone
10: 7/6 266.871 septimal minor third
11: 32/27 294.135 Pythagorean minor third
12: 6/5 315.641 minor third
13: 11/9 347.408 undecimal neutral third
14: 5/4 386.314 major third
15: 14/11 417.508 undecimal diminished fourth
16: 9/7 435.084 septimal major third
17: 21/16 470.781 narrow fourth
18: 4/3 498.045 perfect fourth
19: 27/20 519.551 acute fourth
20: 11/8 551.318 undecimal semi-augmented fourth
21: 7/5 582.512 septimal tritone
22: 10/7 617.488 Euler's tritone
23: 16/11 648.682 undecimal semi-diminished fifth
24: 40/27 680.449 grave fifth
25: 3/2 701.955 perfect fifth
26: 32/21 729.219 wide fifth
27: 14/9 764.916 septimal minor sixth
28: 11/7 782.492 undecimal augmented fifth
29: 8/5 813.686 minor sixth
30: 18/11 852.592 undecimal neutral sixth
31: 5/3 884.359 major sixth
32: 27/16 905.865 Pythagorean major sixth
33: 12/7 933.129 septimal major sixth
34: 7/4 968.826 harmonic seventh
35: 16/9 996.090 Pythagorean minor seventh
36: 9/5 1017.596 just minor seventh
37: 20/11 1034.996 large minor seventh
38: 11/6 1049.363 21/4-tone, undecimal neutral
seventh
39: 15/8 1088.269 classic major seventh
40: 40/21 1115.533 acute major seventh
41: 64/33 1146.727 33rd subharmonic
42: 160/81 1178.494 octave - syntonic comma
43: 2/1 1200.000 octave

After,

show/freq

becomes:

0: 261.6256 Hertz 8.00000 oct
1: 264.8959 Hertz 8.01792 oct
2: 269.8014 Hertz 8.04439 oct
3: 274.7068 Hertz 8.07039 oct
4: 279.0673 Hertz 8.09311 oct
5: 285.4097 Hertz 8.12553 oct
6: 287.7881 Hertz 8.13750 oct
7: 290.6951 Hertz 8.15200 oct
8: 294.3288 Hertz 8.16992 oct
9: 299.0006 Hertz 8.19264 oct
10: 305.2298 Hertz 8.22239 oct
11: 310.0747 Hertz 8.24511 oct
12: 313.9507 Hertz 8.26303 oct
13: 319.7646 Hertz 8.28950 oct
14: 327.0320 Hertz 8.32193 oct
15: 332.9780 Hertz 8.34792 oct
16: 336.3757 Hertz 8.36257 oct
17: 343.3836 Hertz 8.39231 oct
18: 348.8341 Hertz 8.41503 oct
19: 353.1945 Hertz 8.43296 oct
20: 359.7352 Hertz 8.45943 oct
21: 366.2758 Hertz 8.48542 oct
22: 373.7508 Hertz 8.51457 oct
23: 380.5463 Hertz 8.54057 oct
24: 387.5934 Hertz 8.56704 oct
25: 392.4383 Hertz 8.58496 oct
26: 398.6675 Hertz 8.60768 oct
27: 406.9731 Hertz 8.63743 oct
28: 411.1259 Hertz 8.65207 oct
29: 418.6009 Hertz 8.67807 oct
30: 428.1146 Hertz 8.71049 oct
31: 436.0426 Hertz 8.73696 oct
32: 441.4931 Hertz 8.75488 oct
33: 448.5010 Hertz 8.77760 oct
34: 457.8447 Hertz 8.80735 oct
35: 465.1121 Hertz 8.83007 oct
36: 470.9260 Hertz 8.84799 oct
37: 475.6828 Hertz 8.86249 oct
38: 479.6469 Hertz 8.87447 oct
39: 490.5479 Hertz 8.90689 oct
40: 498.3344 Hertz 8.92961 oct
41: 507.3950 Hertz 8.95560 oct
42: 516.7912 Hertz 8.98208 oct
43: 523.2511 Hertz 9.00000 oct

That's all there is to it. It works *both* for "irrational" tempered
scales and scales "ratio--nal"

P.S. Further elaborations can be left to our "experts..."

Best,

________ ___ ___ __
Joseph Pehrson

🔗Rick McGowan <rmcgowan@apple.com>

9/19/2000 5:19:36 PM

Jacky,

I see Joseph P posted the simple Scala commands... if that isn't sufficient for your purposes...

You might check the Tuning list archives; I think at one time I posted some old C code to do the conversion; it's a few lines of code. The program answered the question "what is the frequency C cents above a given base frequence F". You feed in the base frequency F in Hertz, and the interval C in cents above that; it gives you the resulting frequency in Hertz. If you can't find it in the archives, I can dig it out & re-post.

Rick

🔗Jacky Ligon <jacky_ekstasis@yahoo.com>

9/19/2000 6:00:04 PM

--- In tuning@egroups.com, "Joseph Pehrson" <josephpehrson@c...>
wrote:
> Well, you certainly don't have to be a mathematician in order to
get
> Scala to do this...
>
> All you do is give the command:
>
> show/freq
>

Ah, how comforting! And I'm imagining that if you set the "Set Map"
Frequency, then Scala, would base it from this. This is good! One
must love Scala! Thanks Manuel.

It pays to read the manual - just now noticed this function described
there. I guess I'm Just so focused on Cents most of the time, because
of using tuning tables.

Thanks,

Jacky Ligon

🔗Jacky Ligon <jacky_ekstasis@yahoo.com>

9/19/2000 6:02:27 PM

Thanks for the info Rick, and special thanks for making your piece
available on MP3.com - enjoyed that!

Good evening,

Jacky Ligon

--- In tuning@egroups.com, Rick McGowan <rmcgowan@a...> wrote:
> Jacky,
>
> I see Joseph P posted the simple Scala commands... if that isn't
sufficient for your purposes...
>
> You might check the Tuning list archives; I think at one time I
posted some old C code to do the conversion; it's a few lines of
code. The program answered the question "what is the frequency C
cents above a given base frequence F". You feed in the base
frequency F in Hertz, and the interval C in cents above that; it
gives you the resulting frequency in Hertz. If you can't find it in
the archives, I can dig it out & re-post.
>
> Rick

🔗Paul Erlich <PERLICH@ACADIAN-ASSET.COM>

9/19/2000 7:09:28 PM

--- In tuning@egroups.com, "Jacky Ligon" <
jacky_ekstasis@y...> wrote:
> What is the best way to convert cents measurements into pitch
values?
> Obviously, one must know the starting frequency. What is the best
> method for both a rational and irrationally derived cents value?

If s is the starting frequency, and c is the
distance in cents above that frequency (use
negative values for notes below the starting
frequency), the formula is

s*2^(c/1200).

🔗Monz <MONZ@JUNO.COM>

9/19/2000 11:20:34 PM

--- In tuning@egroups.com, "Paul Erlich" <PERLICH@A...> wrote:
> http://www.egroups.com/message/tuning/13064
>
> --- In tuning@egroups.com, "Jacky Ligon" wrote:
> > What is the best way to convert cents measurements into pitch
> > values? Obviously, one must know the starting frequency. What
> > is the best method for both a rational and irrationally
> > derived cents value?
>
> If s is the starting frequency, and c is the
> distance in cents above that frequency (use
> negative values for notes below the starting
> frequency), the formula is
>
> s*2^(c/1200).

Just for your benefit, Jacky :)

I thought I'd supplement Paul's formula with the more generalized
one:

If you leave out the first part of Paul's formula for obtaining
the frequency, you get the *ratio* (in decimal form, i.e.,
1 < ratio < 2), from:

2^(c/1200)

Cents are simply the same as 1200-tET, with the cent value
being the 1200-tET degree.

So for any ET of _n_ degrees, the decimal ratio of the pitch
at _d_ degrees is:

2^(d/n)

Likewise, to obtain the frequency for any ET degree, multiply
the starting frequency _s_ by that result:

s*2^(d/n)

Some of these, and a few other conversions, are in the theoretical
part (the first section) of my book, which you have.

The only way I know of (and use frequently) to convert the
decimal ratios into lowest-integer terms, is the brute-force
approach: I list the ratio in an Excel spreadsheet, and multiply
both terms by every integer in the whole integer series (always
up to some arbitrary stopping point) and just search the results
until I find terms with no decimal remainder.

For irrational intervals, of course, there will never be *no*
remainder. In those cases, I just look for '.999...' or .0001..'
or something like it, and precede the ratio terms with a tilde (~),
which many of us on this list have accepted to mean 'approximately'.

If any mathematicians out there can provide a better way to
find the lowest-integer equivalent of a decimal ratio, I'd
certainly like to have it explained, preferably in a format
that works with Excel or similar spreadsheets.

-monz
http://www.ixpres.com/interval/monzo/homepage.html

🔗Graham Breed <graham@microtonal.co.uk>

9/20/2000 2:55:39 AM

Monz wrote:

> If any mathematicians out there can provide a better way to
> find the lowest-integer equivalent of a decimal ratio, I'd
> certainly like to have it explained, preferably in a format
> that works with Excel or similar spreadsheets.

You can walk the Farey tree. Say you start with 1.234. You know
this is between 1/1 and 2/1. The mediant is 3/2, which is 1.5, and
this is greater than 1.234 so you then take the mediant of 1/1 and
3/2. That gives 4/3 or 1.333 which is still > 1.1234, so keep going:

lower higher mediant fraction

1/1 4/3 5/4 1.25 >
1/1 5/4 6/5 1.2 <
6/5 5/4 11/9 1.222 <
11/9 5/4 16/13 1.231 <
16/13 5/4 21/17 1.2353 >
16/13 21/17 37/30 1.12333 <
37/30 21/17 58/47 1.23404 >

And so on. It actually takes about 25 steps to get to 5617/5000,
which is the exact fraction. I have an Excel spreadsheet to do this,
but it would probably be easier for you to work it out than me to
explain how I constructed it. If you're really stuck, e-mail me off
list, and I'll send you a copy.

This gives ever closer approximations, so it's even more useful if
you don't want an exact answer.

There's a clever algorithm you can use to get the < and > condition,
and so decide which way to walk the tree. I can't remember the
details, but I found testing for <> the target to be less
computationally intensive, when you're calculating all the fractions
anyway.

🔗John Thaden <jjthaden@flash.net>

9/20/2000 7:36:08 AM

May I take you up on your offer to send the excel file? Thanks!

🔗Paul H. Erlich <PERLICH@ACADIAN-ASSET.COM>

9/20/2000 10:34:52 AM

Monz wrote,

>If any mathematicians out there can provide a better way to
>find the lowest-integer equivalent of a decimal ratio, I'd
>certainly like to have it explained,

Two were explained on the list in the last week.

>preferably in a format
>that works with Excel or similar spreadsheets.

Hmm . . . Excel does have a built-in function for this . . .