zIFBoards - Free Forum Hosting
Free Forums. Reliable service with over 8 years of experience.

Learn More · Register for Free
Welcome to Dozensonline. We hope you enjoy your visit.
You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, and sending personal messages. Registration is simple, fast, and completely free. (You will be asked to confirm your email address before we sign you on.)
Join our community!
If you're already a member please log in to your account to access all of our features:

Name:   Password:


Forum Rules RULES~ "Music"

Please pay respect to other people's points of view, whether you agree with them or not, and just generally try to act civiilly.

Don't post any pornography, warez, or other offensive or prohibited materials.

Postings can be about any facet of music whatsoever.

 

 Excessively-precise Approximation Of 12-edo, with rational numbers
Dan
Posted: Apr 12 2017, 05:13 AM


Dozens Disciple


Group: Members
Posts: 1,463
Member No.: 19
Joined: 8-August 05



Here is the "exact" tuning of one particular octave, calculated to the full default precision of Python's Decimal type. (Unfortunately, it does not have a dedicated Dozenal type; I suppose I should write one.)

MIDITGMFrequency (Hz)
6969440.0000000000000000000000000
706A466.1637615180899164072031298
716B493.8833012561241118307545419
7270523.2511306011972693556999870
7371554.3652619537441924975726672
7472587.3295358348151205255660277
7573622.2539674441618214727430387
7674659.2551138257398594716835221
7775698.4564628660077688907504813
7876739.9888454232687978673904191
7977783.9908719634985881713990609
8078830.6093951598902770448835779
8179880.0000000000000000000000000


But suppose that the practical constraints of instrument making require you to approximate the frequency by a rational number (with a smaller denominator than the 10^25 implied by the above decimal approximations). What then?

Continued fractions to the rescue!

MIDITGMCF Frequency (Hz)
6969[440]
706A[466, 6, 9, 2, 1, 1, 7, 4, 16, 1, 2, 21, 7, 3, 1, 2, 2, 19, 1, 2, 7, 2, 5, 11, 8, 1, 1, 2, 3, 2, 16, 17, 2, 1, 7, 13, 1, 39, 7, 2, 2]
716B[493, 1, 7, 1, 1, 3, 8, 2, 1, 1, 1, 11, 7, 4, 3, 1, 10, 1, 1, 4, 2, 1, 1, 32, 1, 6, 4, 1, 1, 2, 42, 1, 2, 1, 13, 11, 2, 3, 1, 1, 1, 1, 13, 1, 13, 1, 6, 2, 1, 3, 13, 2]
7270[523, 3, 1, 54, 1, 1, 7, 1, 2, 1, 10, 2, 3, 1, 2, 1, 3, 1, 1, 1, 8, 5, 1, 2, 1, 1, 1, 1, 5, 2, 1, 2, 2, 3, 1, 3, 1, 9, 1, 1, 1, 8, 1, 1, 1, 1, 6, 2, 1, 6, 1, 14, 2, 3, 1, 1, 1, 3, 3, 1, 1, 2]
7371[554, 2, 1, 2, 1, 4, 2, 1, 4, 11, 2, 2, 1, 1, 1, 2, 2, 9, 1, 1, 3, 17, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 135, 61, 1, 77, 3, 27, 2, 6, 1, 2, 6, 4, 1, 3]
7472[587, 3, 28, 1, 12, 2, 5, 2, 2, 1, 1, 1, 10, 1, 60, 4, 4, 1, 3, 1, 3, 1, 1, 3, 2, 2, 1, 3, 2, 10, 3, 1, 2, 3, 1, 1, 3, 1, 1, 1, 1, 1, 6, 5, 31, 1, 1, 5, 2, 1, 6, 8, 4]
7573[622, 3, 1, 15, 311, 15, 1, 3, 1244, 3, 1, 15, 361, 2, 1, 1, 1, 2, 1, 1, 2, 6, 2, 4, 1, 12, 20, 1, 1, 2, 2, 3, 6, 1, 2, 3, 1, 5, 5]
7674[659, 3, 1, 11, 2, 8, 2, 1, 4, 3, 3, 43, 1, 1, 1, 1, 1, 1, 5, 2, 1, 11, 1, 2, 25, 1, 1, 3, 2, 1, 1, 1, 2, 37, 1, 2, 4, 1, 3, 3, 2, 1, 3, 3, 1, 4, 1, 2, 5, 3, 2, 3, 3, 5, 3]
7775[698, 2, 5, 4, 7, 1, 3, 1, 2, 1, 1, 3, 9, 1, 1, 1, 11, 1, 7, 1, 2, 1, 1, 1, 3, 1, 49, 1, 4, 5, 3, 2, 1, 7, 4, 7, 2, 2, 2, 27, 2, 1, 1, 6, 1, 2, 3, 1, 30, 4, 1, 1, 1, 1, 3]
7876[739, 1, 88, 1, 1, 1, 5, 1, 2, 1, 2, 1, 1, 1, 1, 2, 14, 1, 2, 5, 7, 1, 2, 1, 1, 444, 1, 16, 1, 11, 2, 5, 1, 12, 1, 4, 3, 1, 2, 11, 2, 2, 1, 21, 2, 2, 2, 2, 6, 7]
7977[783, 1, 108, 1, 1, 4, 3, 1, 14, 3, 2, 2, 1, 3, 1, 5, 1, 1, 1, 1, 5, 1, 1, 3, 1, 1, 1, 1, 3, 180, 5, 3, 12, 10, 1, 28, 1, 1, 1, 2, 4, 1, 2, 3, 5, 1, 1, 2, 2, 9, 3, 1, 3]
8078[830, 1, 1, 1, 1, 3, 1, 1, 1, 11, 2, 7, 1, 2, 1, 1, 2, 2, 1, 3, 26, 3, 1, 2, 1, 1, 7, 1, 9, 1, 8, 3, 15, 1, 5, 2, 2, 6, 2, 10, 1, 1, 12, 2, 3, 3, 2, 1, 23, 2, 1, 1, 104]
8179[880]


To be continued...
(Pun not intended)
Top
Dan
Posted: Apr 20 2017, 04:34 AM


Dozens Disciple


Group: Members
Posts: 1,463
Member No.: 19
Joined: 8-August 05



But why limit our calculations to one octave? Here are the frequencies for all 88 notes on a standard grand piano:

MIDITGMFrequency (Hz)
212927.50000000000000000000000000
222A29.13523509488061977545019561
232B30.86770632850775698942215887
243032.70319566257482933473124919
253134.64782887210901203109829170
263236.70809598967594503284787673
273338.89087296526011384204643992
283441.20344461410874121698022013
293543.65352892912548555567190508
303646.24930283895429986671190119
313748.99942949771866176071244131
323851.91308719749314231530522362
333955.00000000000000000000000000
343A58.27047018976123955090039122
353B61.73541265701551397884431773
364065.40639132514965866946249838
374169.29565774421802406219658340
384273.41619197935189006569575347
394377.78174593052022768409287983
404482.40688922821748243396044026
414587.30705785825097111134381016
424692.49860567790859973342380239
434797.99885899543732352142488261
4448103.8261743949862846306104472
4549110.0000000000000000000000000
464A116.5409403795224791018007824
474B123.4708253140310279576886355
4850130.8127826502993173389249968
4951138.5913154884360481243931668
5052146.8323839587037801313915069
5153155.5634918610404553681857597
5254164.8137784564349648679208805
5355174.6141157165019422226876203
5456184.9972113558171994668476048
5557195.9977179908746470428497652
5658207.6523487899725692612208945
5759220.0000000000000000000000000
585A233.0818807590449582036015649
595B246.9416506280620559153772709
6060261.6255653005986346778499935
6161277.1826309768720962487863336
6262293.6647679174075602627830139
6363311.1269837220809107363715193
6464329.6275569128699297358417610
6565349.2282314330038844453752406
6666369.9944227116343989336952095
6767391.9954359817492940856995305
6868415.3046975799451385224417889
6969440.0000000000000000000000000
706A466.1637615180899164072031298
716B493.8833012561241118307545419
7270523.2511306011972693556999870
7371554.3652619537441924975726672
7472587.3295358348151205255660277
7573622.2539674441618214727430387
7674659.2551138257398594716835221
7775698.4564628660077688907504813
7876739.9888454232687978673904191
7977783.9908719634985881713990609
8078830.6093951598902770448835779
8179880.0000000000000000000000000
827A932.3275230361798328144062596
837B987.7666025122482236615090837
84801046.502261202394538711399974
85811108.730523907488384995145334
86821174.659071669630241051132055
87831244.507934888323642945486077
88841318.510227651479718943367044
89851396.912925732015537781500963
90861479.977690846537595734780838
91871567.981743926997176342798122
92881661.218790319780554089767156
93891760.000000000000000000000000
948A1864.655046072359665628812519
958B1975.533205024496447323018167
96902093.004522404789077422799948
97912217.461047814976769990290669
98922349.318143339260482102264111
99932489.015869776647285890972155
100942637.020455302959437886734088
101952793.825851464031075563001925
102962959.955381693075191469561676
103973135.963487853994352685596244
104983322.437580639561108179534311
105993520.000000000000000000000000
1069A3729.310092144719331257625038
1079B3951.066410048992894646036335
108A04186.009044809578154845599896


To be continued...
Top
Dan
Posted: Apr 21 2017, 03:23 AM


Dozens Disciple


Group: Members
Posts: 1,463
Member No.: 19
Joined: 8-August 05



What if we simply rounded each note frequency to the nearest integer number of hertz? As you would, for example, if your musical "instrument" were the Win32 Beep function?

MIDITGMFrequency (Hz)RoundedError (cents)
212927.500000000000000000000000002831.194250
222A29.1352350948806197754501956129-8.054462
232B30.86770632850775698942215887317.403916
243032.703195662574829334731249193315.641287
253134.647828872109012031098291703517.507964
263236.708095989675945032847876733713.712383
273338.89087296526011384204643992394.851006
283441.2034446141087412169802201341-8.569251
293543.653528929125485555671905084413.686286
303646.2493028389542998667119011946-9.357309
313748.99942949771866176071244131490.020157
323851.91308719749314231530522362522.896006
333955.00000000000000000000000000550.000000
343A58.2704701897612395509003912258-8.054462
353B61.73541265701551397884431773627.403916
364065.4063913251496586694624983865-10.790281
374169.2956577442180240621965834069-7.402308
384273.4161919793518900656957534773-9.842186
394377.78174593052022768409287983784.851006
404482.4068892282174824339604402682-8.569251
414587.3070578582509711113438101687-6.099461
424692.4986056779085997334238023992-9.357309
434797.99885899543732352142488261980.020157
4448103.82617439498628463061044721042.896006
4549110.00000000000000000000000001100.000000
464A116.54094037952247910180078241176.806007
474B123.4708253140310279576886355123-6.614250
4850130.81278265029931733892499681312.475946
4951138.59131548843604812439316681395.097631
5052146.83238395870378013139150691471.975158
5153155.56349186104045536818575971564.851006
5254164.81377845643496486792088051651.955001
5355174.61411571650194222268762031753.821678
5456184.99721135581719946684760481850.026096
5557195.99771799087464704284976521960.020157
5658207.65234878997256926122089452082.896006
5759220.00000000000000000000000002200.000000
585A233.0818807590449582036015649233-0.608283
595B246.94165062806205591537727092470.409022
6060261.62556530059863467784999352622.475946
6161277.1826309768720962487863336277-1.141057
6262293.66476791740756026278301392941.975158
6363311.1269837220809107363715193311-0.706732
6464329.62755691286992973584176103301.955001
6565349.2282314330038844453752406349-1.131785
6666369.99442271163439893369520953700.026096
6767391.99543598174929408569953053920.020157
6868415.3046975799451385224417889415-1.270625
6969440.00000000000000000000000004400.000000
706A466.1637615180899164072031298466-0.608283
716B493.88330125612411183075454194940.409022
7270523.2511306011972693556999870523-0.831093
7371554.3652619537441924975726672554-1.141057
7472587.3295358348151205255660277587-0.971624
7573622.2539674441618214727430387622-0.706732
7674659.2551138257398594716835221659-0.670070
7775698.4564628660077688907504813698-1.131785
7876739.98884542326879786739041917400.026096
7977783.99087196349858817139906097840.020157
8078830.60939515989027704488357798310.813944
8179880.00000000000000000000000008800.000000
827A932.3275230361798328144062596932-0.608283
837B987.76660251224822366150908379880.409022
84801046.50226120239453871139997410470.823216
85811108.73052390748838499514533411090.420724
86821174.65907166963024105113205511750.502394
87831244.50793488832364294548607712450.684376
88841318.51022765147971894336704413190.642963
89851396.91292573201553778150096313970.107910
90861479.97769084653759573478083814800.026096
91871567.98174392699717634279812215680.020157
92881661.2187903197805540897671561661-0.228027
93891760.00000000000000000000000017600.000000
948A1864.65504607235966562881251918650.320242
958B1975.53320502449644732301816719760.409022
96902093.0045224047890774227999482093-0.003741
97912217.4610478149767699902906692217-0.359990
98922349.3181433392604821022641112349-0.234459
99932489.0158697766472858909721552489-0.011038
100942637.0204553029594378867340882637-0.013429
101952793.82585146403107556300192527940.107910
102962959.95538169307519146956167629600.026096
103973135.96348785399435268559624431360.020157
104983322.4375806395611081795343113322-0.228027
105993520.00000000000000000000000035200.000000
1069A3729.3100921447193312576250383729-0.143958
1079B3951.0664100489928946460363353951-0.029099
108A04186.0090448095781548455998964186-0.003741


All but one of the A's are exact, as is expected from assigning an exact 440 Hz to one of them. The two highest C's are almost exact, off by a mere 1/26733 of a semitone. Overall, this whole-hertz tuning is very good in the middle-to-upper range, with tones being consistently accurate to with a cent.

But the bottom couple of octaves have some notes that are noticeably out of tune, by as much as 31 cents. (In this respect, the whole-hertz tuning is the opposite of period-based integer encoding, e.g., as used in the POKEY chip on Atari 8-bit machines, in which the high notes are out of tune).

If you want to be "all about that bass", you need fractional frequencies.

To be continued...
Top
Dan
Posted: Apr 21 2017, 05:16 AM


Dozens Disciple


Group: Members
Posts: 1,463
Member No.: 19
Joined: 8-August 05



One possibility is to represent the frequencies as double-precision floating-point numbers, good to 53 significant bits.

As a binary floating-point representation, this approach has the advantage that an octave is always an exact 2:1 frequency ratio.

The fractions are unwieldy, though, with denominators as high as 2^47.

MIDITGMFrequency (Hz)Fraction
212927.555/2
222A29.135235094880624100419809895505/140737488355328
232B30.8677063285077584344243459964045/140737488355328
243032.703195662574832301282809371819/70368744177664
253134.647828872109014876248412425839/140737488355328
263236.708095989675955166205231893281/140737488355328
273338.8908729652601151368350945269209/35184372088832
283441.203444614108745798869306577531/140737488355328
293543.6535289291254861535922004832943/35184372088832
303646.24930283895436509010719739369/140737488355328
313748.999429497718666896056638352895/140737488355328
323851.913087197493143653058752473159/70368744177664
333955.055
343A58.270470189761244100419809895505/70368744177664
353B61.7354126570155164344243459964045/70368744177664
364065.406391325149662301282809371819/35184372088832
374169.295657744218024876248412425839/70368744177664
384273.41619197935195166205231893281/70368744177664
394377.781745930520231368350945269209/17592186044416
404482.406889228217485798869306577531/70368744177664
414587.307057858250971535922004832943/17592186044416
424692.49860567790866509010719739369/70368744177664
434797.998858995437326896056638352895/70368744177664
4448103.826174394986283653058752473159/35184372088832
4549110.0110
464A116.540940379522484100419809895505/35184372088832
474B123.470825314031034344243459964045/35184372088832
4850130.81278265029932301282809371819/17592186044416
4951138.591315488436044876248412425839/35184372088832
5052146.83238395870385166205231893281/35184372088832
5153155.563491861040461368350945269209/8796093022208
5254164.813778456434965798869306577531/35184372088832
5355174.614115716501941535922004832943/8796093022208
5456184.99721135581726509010719739369/35184372088832
5557195.997717990874636896056638352895/35184372088832
5658207.652348789972563653058752473159/17592186044416
5759220.0220
585A233.081880759044964100419809895505/17592186044416
595B246.941650628062064344243459964045/17592186044416
6060261.62556530059862301282809371819/8796093022208
6161277.18263097687214876248412425839/17592186044416
6262293.66476791740765166205231893281/17592186044416
6363311.12698372208091368350945269209/4398046511104
6464329.62755691286995798869306577531/17592186044416
6565349.22823143300391535922004832943/4398046511104
6666369.99442271163446509010719739369/17592186044416
6767391.995435981749276896056638352895/17592186044416
6868415.30469757994513653058752473159/8796093022208
6969440.0440
706A466.16376151808994100419809895505/8796093022208
716B493.88330125612414344243459964045/8796093022208
7270523.25113060119722301282809371819/4398046511104
7371554.36526195374424876248412425839/8796093022208
7472587.32953583481515166205231893281/8796093022208
7573622.25396744416181368350945269209/2199023255552
7674659.25511382573985798869306577531/8796093022208
7775698.45646286600781535922004832943/2199023255552
7876739.98884542326886509010719739369/8796093022208
7977783.99087196349856896056638352895/8796093022208
8078830.60939515989033653058752473159/4398046511104
8179880.0880
827A932.32752303617994100419809895505/4398046511104
837B987.76660251224834344243459964045/4398046511104
84801046.50226120239452301282809371819/2199023255552
85811108.73052390748834876248412425839/4398046511104
86821174.65907166963035166205231893281/4398046511104
87831244.50793488832371368350945269209/1099511627776
88841318.51022765147975798869306577531/4398046511104
89851396.91292573201551535922004832943/1099511627776
90861479.97769084653766509010719739369/4398046511104
91871567.9817439269976896056638352895/4398046511104
92881661.21879031978053653058752473159/2199023255552
93891760.01760
948A1864.65504607235974100419809895505/2199023255552
958B1975.53320502449654344243459964045/2199023255552
96902093.0045224047892301282809371819/1099511627776
97912217.46104781497664876248412425839/2199023255552
98922349.31814333926065166205231893281/2199023255552
99932489.01586977664741368350945269209/549755813888
100942637.02045530295945798869306577531/2199023255552
101952793.8258514640311535922004832943/549755813888
102962959.9553816930756509010719739369/2199023255552
103973135.9634878539946896056638352895/2199023255552
104983322.4375806395613653058752473159/1099511627776
105993520.03520
1069A3729.31009214471944100419809895505/1099511627776
1079B3951.0664100489934344243459964045/1099511627776
108A04186.0090448095782301282809371819/549755813888


To be continued...
Top
Dan
Posted: Apr 22 2017, 11:45 PM


Dozens Disciple


Group: Members
Posts: 1,463
Member No.: 19
Joined: 8-August 05



Back to my original idea of using continued fractions. Take, for example, note 60 (Middle C), which has a frequency of 261.6255653005986346778499935 Hz. [261, 1, 1, 1, 2, 27, 3, 1, 3, 2, 1, 2, 5, 4, 1, 1, 6, 1, 1, 3, 17, 2, 1, 6, 4, 1, 2, 5, 2, 2, 1, 1, 2, 1, 1, 20, 3, 4, 3, 3, 3, 5, 1, 2, 1, 29, 1, 7, 3, 1, 1, 1, 1, 3, 3].

We could truncate this list at any point, getting the sequence of approximations 261, 262, 523/2, 785/3, 2093/8, 57296/219, 173981/665, 231277/884, 867812/3317, 1966901/7518, 2834713/10835, 7636327/29188, 41016348/156775, 171701719/656288, 212718067/813063, 384419786/1469351, 2519236783/9629169, 2903656569/11098520, 5422893352/20727689, 19172336625/73281587, 331352615977/1266514668, 681877568579/2606310923, 1013230184556/3872825591, 6761258675915/25843264469, 28058264888216/107245883467, 34819523564131/133089147936, 97697312016478/373424179339, 523306083646521/2000210044631, 1144309479309520/4373844268601, 2811925042265561/10747898581833, 3956234521575081/15121742850434, 6768159563840642/25869641432267, 17492553649256365/66861025714968, 24260713213097007/92730667147235, 41753266862353372/159591692862203, 859326050460164447/3284564524391295, 2619731418242846713/10013285266036088, 11338251723431551299/43337705588535647, 36634486588537500610/140026402031643029, 121241711489044053129/463416911683464734, 400359621055669659997/1530277137082037231, 2123039816767392353114/8114802597093650889, 2523399437823062013111/9645079734175688120, 7169838692413516379336/27404962065445027129, 9693238130236578392447/37050041799620715249, 288273744469274289760299/1101856174254445769350, 297966982599510868152746/1138906216054066484599, 2374042622665850366829521/9074199686632911161543, 7420094850597061968641309/28361505275952799969228, 9794137473262912335470830/37435704962585711130771, 17214232323859974304112139/65797210238538511099999, 27008369797122886639582969/103232915201124222230770, 44222602120982860943695108/169030125439662733330769, 159676176160071469470668293/610323291520112422223077, 523251130601197269355699987/2000000000000000000000000.

Or we could add 1 to the last element of the list, rounding the final denominator up instead of down. This gives us a different (but partially overlapping) sequence: 262, 523/2, 785/3, 1308/5, 2878/11, 59389/227, 231277/884, 405258/1549, 1099089/4201, 2834713/10835, 4801614/18353, 10471040/40023, 48652675/185963, 212718067/813063, 384419786/1469351, 597137853/2282414, 2903656569/11098520, 5422893352/20727689, 8326549921/31826209, 24595229977/94009276, 350524952602/1339796255, 1013230184556/3872825591, 1695107753135/6479136514, 7774488860471/29716090060, 34819523564131/133089147936, 62877788452347/240335031403, 132516835580609/506513327275, 621003395662999/2373634223970, 1667615562956041/6374054313232, 3956234521575081/15121742850434, 6768159563840642/25869641432267, 10724394085415723/40991384282701, 24260713213097007/92730667147235, 41753266862353372/159591692862203, 66013980075450379/252322360009438, 901079317322517819/3444156217253498, 3479057468703011160/13297849790427383, 13957983141674398012/53350990854571735, 47972738311969051909/183364107620178676, 157876198077581553739/603443313715107763, 521601332544713713126/1993694048765501965, 2523399437823062013111/9645079734175688120, 4646439254590454366225/17759882331269339009, 9693238130236578392447/37050041799620715249, 16863076822650094771783/64455003865065742378, 297966982599510868152746/1138906216054066484599, 586240727068785157913045/2240762390308512253949, 2672009605265361234982267/10213105902686977646142, 9794137473262912335470830/37435704962585711130771, 17214232323859974304112139/65797210238538511099999, 27008369797122886639582969/103232915201124222230770, 44222602120982860943695108/169030125439662733330769, 71230971918105747583278077/272263040640786955561539, 203898778281054330414363401/779353416959775155553846, 682927306761268738826368280/2610323291520112422223077.

Or we could ignore the continued fraction stuff altogether and just brute-force the denominators. To avoid any base-specific bias, I'll set the upper bound of the brute-forcing to 2520.

CODE
def approximations(x):
   x = Fraction(x)
   result = {x}
   # Continued fraction approximations.
   cf = frac_to_contfrac(x)
   for i in range(1, len(cf)):
       cf_trunc = cf[:i]
       result.add(contfrac_to_frac(cf_trunc))
       cf_trunc[-1] += 1
       result.add(contfrac_to_frac(cf_trunc))
   # Brute force
   for denominator in range(1, 2521):
       numerator = int(denominator * x)
       result.add(Fraction(numerator, denominator))
       result.add(Fraction(numerator + 1, denominator))
   return result

def error_ratio(x, y):
   x = Fraction(x)
   y = Fraction(y)
   return max(x / y, y / x)

def best_approximations(x):
   x = Fraction(x)
   # Get a list of approximations and sort by denominator,
   # then by numerator if there are ties
   approx = list(approximations(x))
   approx.sort(key=lambda q: (q.denominator, q.numerator))
   # Build the list of best approximations
   result = []
   best_error = float('inf')
   for q in approx:
       err = error_ratio(q, x)
       if err < best_error:
           best_error = err
           # Only allow one (the best) of each denominator.
           if result and q.denominator == result[-1].denominator:
               result[-1] = q
           else:
               result.append(q)
   return result


So, for Middle C, that gives us the sequence of approximations 262, 523/2, 785/3, 1308/5, 2093/8, 30087/115, 32180/123, 34273/131, 36366/139, 38459/147, 40552/155, 42645/163, 44738/171, 46831/179, 48924/187, 51017/195, 53110/203, 55203/211, 57296/219, 116685/446, 173981/665, 231277/884, 636535/2433, 867812/3317, 1966901/7518, 2834713/10835, 4801614/18353, 7636327/29188, 41016348/156775, 171701719/656288, 212718067/813063, 384419786/1469351, 2519236783/9629169, 2903656569/11098520, 5422893352/20727689, 19172336625/73281587, 331352615977/1266514668, 681877568579/2606310923, 1013230184556/3872825591, 6761258675915/25843264469, 28058264888216/107245883467, 34819523564131/133089147936, 62877788452347/240335031403, 97697312016478/373424179339, 523306083646521/2000210044631, 1144309479309520/4373844268601, 2811925042265561/10747898581833, 3956234521575081/15121742850434, 6768159563840642/25869641432267, 10724394085415723/40991384282701, 17492553649256365/66861025714968, 24260713213097007/92730667147235, 41753266862353372/159591692862203, 859326050460164447/3284564524391295, 2619731418242846713/10013285266036088, 11338251723431551299/43337705588535647, 36634486588537500610/140026402031643029, 121241711489044053129/463416911683464734, 400359621055669659997/1530277137082037231, 2123039816767392353114/8114802597093650889, 2523399437823062013111/9645079734175688120, 7169838692413516379336/27404962065445027129, 9693238130236578392447/37050041799620715249, 288273744469274289760299/1101856174254445769350, 297966982599510868152746/1138906216054066484599, 2374042622665850366829521/9074199686632911161543, 7420094850597061968641309/28361505275952799969228, 9794137473262912335470830/37435704962585711130771, 17214232323859974304112139/65797210238538511099999, 27008369797122886639582969/103232915201124222230770, 44222602120982860943695108/169030125439662733330769, 159676176160071469470668293/610323291520112422223077, 523251130601197269355699987/2000000000000000000000000. That's a lot of fractions; which one do we pick?

For my "overly precise" approximation, I will use the first one that, when converted to a float, has the same float representation as the true value.

CODE
def overly_precise(x):
   x = Fraction(x)
   for q in best_approximations(x):
       if float(q) == float(x):
           return q


For Middle C, it's 2519236783/9629169.

To be continued...
Top
Dan
Posted: Apr 23 2017, 11:22 PM


Dozens Disciple


Group: Members
Posts: 1,463
Member No.: 19
Joined: 8-August 05



Doing this gives the fractions

MIDITGMFrequency (Hz)Fraction
212927.5000000000000000000000000055/2
222A29.13523509488061977545019561244133429/8379319
232B30.86770632850775698942215887185642553/6014135
243032.70319566257482933473124919677861669/20727689
253134.64782887210901203109829170541581010/15631023
263236.70809598967594503284787673690637681/18814315
273338.89087296526011384204643992768398401/19757808
283441.203444614108741216980220133730785217/90545469
293543.65352892912548555567190508775028987/17754097
303646.24930283895429986671190119801248267/17324548
313748.99942949771866176071244131767754862/15668649
323851.91308719749314231530522362787930556/15177879
333955.0000000000000000000000000055
343A58.27047018976123955090039122488266858/8379319
353B61.73541265701551397884431773371285106/6014135
364065.406391325149658669462498381355723338/20727689
374169.295657744218024062196583401565408727/22590286
384273.416191979351890065695753471815682861/24731368
394377.78174593052022768409287983768398401/9878904
404482.406889228217482433960440263725469437/45208228
414587.30705785825097111134381016908093281/10401144
424692.49860567790859973342380239801248267/8662274
434797.99885899543732352142488261589622679/6016628
4448103.82617439498628463061044721575861112/15177879
4549110.0000000000000000000000000110
464A116.5409403795224791018007824976533716/8379319
474B123.4708253140310279576886355742570212/6014135
4850130.81278265029931733892499682711446676/20727689
4951138.5913154884360481243931668600915313/4335880
5052146.8323839587037801313915069946867863/6448631
5153155.5634918610404553681857597768398401/4939452
5254164.81377845643496486792088053725469437/22604114
5355174.6141157165019422226876203908093281/5200572
5456184.9972113558171994668476048801248267/4331137
5557195.9977179908746470428497652589622679/3008314
5658207.65234878997256926122089452392238119/11520400
5759220.0000000000000000000000000220
585A233.08188075904495820360156492166052993/9293099
595B246.94165062806205591537727091485140424/6014135
6060261.62556530059863467784999352519236783/9629169
6161277.1826309768720962487863336600915313/2167940
6262293.66476791740756026278301391815682861/6182842
6363311.1269837220809107363715193768398401/2469726
6464329.62755691286992973584176103725469437/11302057
6565349.2282314330038844453752406908093281/2600286
6666369.99442271163439893369520951602496534/4331137
6767391.9954359817492940856995305589622679/1504157
6868415.30469757994513852244178892392238119/5760200
6969440.0000000000000000000000000440
706A466.16376151808991640720312984545091547/9749989
716B493.88330125612411183075454192970280848/6014135
7270523.25113060119726935569998702134816997/4079909
7371554.3652619537441924975726672600915313/1083970
7472587.32953583481512052556602771815682861/3091421
7573622.2539674441618214727430387768398401/1234863
7674659.25511382573985947168352213682943197/5586522
7775698.4564628660077688907504813908093281/1300143
7876739.98884542326879786739041913204993068/4331137
7977783.99087196349858817139906091179245358/1504157
8078830.60939515989027704488357792392238119/2880100
8179880.0000000000000000000000000880
827A932.32752303617983281440625969090183094/9749989
837B987.76660251224822366150908373670574279/3716034
84801046.5022612023945387113999742903656569/2774630
85811108.730523907488384995145334600915313/541985
86821174.6590716696302410511320553631365722/3091421
87831244.5079348883236429454860771536796802/1234863
88841318.5102276514797189433670443682943197/2793261
89851396.9129257320155377815009631816186562/1300143
90861479.9776908465375957347808386632820457/4481703
91871567.9817439269971763427981222358490716/1504157
92881661.2187903197805540897671562392238119/1440050
93891760.0000000000000000000000001760
948A1864.6550460723596656288125198877197533/4760772
958B1975.5332050244964473230181673670574279/1858017
96902093.0045224047890774227999482903656569/1387315
97912217.4610478149767699902906691201830626/541985
98922349.3181433392604821022641117262731444/3091421
99932489.0158697766472858909721553073593604/1234863
100942637.0204553029594378867340883853048157/1461137
101952793.8258514640310755630019253632373124/1300143
102962959.95538169307519146956167613265640914/4481703
103973135.96348785399435268559624411104832434/3541123
104983322.4375806395611081795343112392238119/720025
105993520.0000000000000000000000003520
1069A3729.3100921447193312576250388877197533/2380386
1079B3951.0664100489928946460363357341148558/1858017
108A04186.0090448095781548455998965635611419/1346297


The largest denominator is 90545469 (approximately 2**26.43), which is much better than the 2**47 obtained from using the float representation directly.

One problem though is that not all of the octaves are an exact 2:1 ratio. The ratio between notes 12 semitones apart ranges from 6787424391224759/3393712195612380 (1.999999999999999705337417447) to 8351705719714069/4175852859857034 (2.000000000000000239472039260). Though this is difference is so small that nobody would ever be able to hear it, I would like to exactly preserve the one "just" ratio that this irrational tuning has.

To be continued...
Top
Dan
Posted: Apr 24 2017, 02:43 AM


Dozens Disciple


Group: Members
Posts: 1,463
Member No.: 19
Joined: 8-August 05



Let's scale down everything to MIDI octave 0 (just below the threshold of human hearing).

NoteFrequency (Hz)Fractions
08.175798915643707677861669/82910756, 2134816997/261114176, 2519236783/308133408, 2903656569/355152640, 5635611419/689304064
18.661957218027252270790505/31262046, 600915313/69374080, 1565408727/180722288
29.177023997418987690637681/75257260, 946867863/103178096, 1815682861/197850944
39.722718241315029768398401/79031232
410.3008611535271853682943197/357537408, 3725469437/361665824, 3730785217/362181876, 3853048157/374051072
510.913382232281371775028987/71016388, 908093281/83209152
611.562325709738575801248267/69298192, 6632820457/573657984
712.249857374429665383877431/31337298, 589622679/48133024, 5552416217/453263744
812.978271799373285196982639/15177879, 2392238119/184326400
913.7555/4
1014.56761754744031244133429/16758638, 2166052993/148689584, 4545091547/311999648, 8877197533/609378816
1115.433853164253879185642553/12028270, 3670574279/237826176


We need to pick one tuning of each note in this octave. Then all other octaves can be obtained by multiplying by 2.

But since this will cancel out the factors of 2 in the denominator, we don't necessarily want to use the smallest denominator. For this purpose, I'll use an "octave-neutral" measure of complexity from another thread about Just Intonation, where "complexity" is defined as the product of odd factors in the numerator and denominator.

NoteFrequency (Hz)Fraction
08.1757989156437072903656569/355152640
18.661957218027252600915313/69374080
29.1770239974189871815682861/197850944
39.722718241315029768398401/79031232
410.3008611535271853853048157/374051072
510.913382232281371908093281/83209152
611.562325709738575801248267/69298192
712.249857374429665589622679/48133024
812.9782717993732852392238119/184326400
913.7555/4
1014.56761754744031244133429/16758638
1115.433853164253879185642553/12028270


I wonder if we can do better, though.

Feel free to chime in.
Top
Piotr
Posted: May 12 2017, 05:46 PM


Unregistered









Another option is to base on a just ratio for 1, 5, 7 or 11 steps. Here is a version with 18/17 for 1 step:

1/1
18/17
324/289
5832/4913
104976/83521
1889568/1419857
24137569/17006112
1419857/944784
83521/52488
4913/2916
289/162
17/9
2/1

Of course, using 4/3 for 5 steps or 3/2 for 7 steps gives us Pythagorean tuning.

Another option is to don't want equal-temperament. Here are ratios of a well-temperament:
C 1/1
C# 256/243
D 28/25
D# 32/27
E 5/4
F 4/3
F# 45/32
G 3/2
G# 128/81
A 375/224
A# 16/9
B 15/8
C 2/1

F#-C# is tempered by schisma down. Therefore the remaining Pythagorean comma becomes syntonic comma. This comma is distributed between G-D, D-A and A-E, about 7 cents down each. This ensures that C-E-G is pure, as well as G-B. Since EDOs are commonly used to approximate just ratios (and not the other way around), this well-temperament can be approximated by 171edo. Schisma is tempered, and syntonic/Pythagorean comma is mapped to 3 steps (about 21 cents). This interval is simply split in 3 to give 1 step (about 7 cents) of tempering to G-D, D-A and A-E. This is equal to 19-edo fifth as a coincidence.

Okay, enough explanation, here are Hz values in my custom fixed point format with 1 sign bit, 31 integer bits and 32 fractional bits:

C 264
C# 278.12345679
D 295.68
D# 312.88888889
E 330
F 352
F# 371.25
G 396
G# 417.18518519
A 441.96428571
A# 469.33333333
B 495
C 528

Note that I used C264/G396 instead of A440. Why? I wanted to choose an audio frequency so that G tone (my favorite one) could be represented exactly periodically (therefore giving exact square wave) with any octave. In other words, G tone * power of 2. I picked 396Hz because it still gives integer Hz 2 octaves lower and it's also divisible by 3 so you could conveniently get C value as 264 if C-G is 3/2.

EDIT: If you want to calculate fractional approximations, you can also use this tool:https://www.dropbox.com/s/4x5mggp4y1ykpj3/f...oncalc.sb2?dl=0
Open this file inhttps://scratch.mit.edu/projects/editor/?tip_bar=home
Top
davidk
Posted: Nov 15 2017, 06:47 PM


Casual Member


Group: Members
Posts: 132
Member No.: 1,157
Joined: 25-October 15



Piotr

do you realise you posted the imperial system?
https://hypertextbook.com/facts/2003/DanielleDaly.shtml

using Pi as 22/7

C 264 84
D 295.68 94.08
E 330 105
F 352 112
G 396 126
A 441.9642857 140.625
B 495 157.5
C 528 168
Top
Harold
Posted: Nov 21 2017, 11:10 PM


Casual Member


Group: Members
Posts: 52
Member No.: 1,275
Joined: 25-December 16



QUOTE (davidk @ Nov 15 2017, 06:47 PM)
Piotr

do you realise you posted the imperial system?
https://hypertextbook.com/facts/2003/DanielleDaly.shtml

using Pi as 22/7

C 264 84
D 295.68 94.08
E 330 105
F 352 112
G 396 126
A 441.9642857 140.625
B 495 157.5
C 528 168

Hertz is an imperial unit? Since when? As far as I've ever known it has always been SI. There is no imperial unit of frequency. Since frequencies are not given in radian per second, the value of π does not play a role.
Top
Kodegadulo
Posted: Nov 22 2017, 12:59 AM


Obsessive poster


Group: Moderators
Posts: 4,188
Member No.: 606
Joined: 10-September 11



QUOTE (Harold @ Nov 21 2017, 11:10 PM)
There is no imperial unit of frequency.

RPM, anyone?
Top
davidk
Posted: Nov 24 2017, 10:12 AM


Casual Member


Group: Members
Posts: 132
Member No.: 1,157
Joined: 25-October 15



The numbers will decimalise

For Harold

C 264 1000
E 330 1250
F 352 1333.333333
G 396 1500
B 495 1875
C 528 2000

left out the two tricky ones

528 is a naturally occurring number the foot is just a unit of conversion.

Nothing is more natural and harmonic to us than musical scales.

Ever seen anyone play the spreadsheet?
https://www.youtube.com/watch?v=q7l1QJWLWXE

sorry about the ad, can't get rid of it.
Top
Double sharp
Posted: Nov 24 2017, 10:24 AM


Dozens Disciple


Group: Members
Posts: 1,401
Member No.: 1,150
Joined: 19-September 15



Since when did frequencies measured in hertz have anything to do with lengths measured in feet, even if the actual numerical values happen to be a factor of ten from each other?
Top
davidk
Posted: Nov 24 2017, 12:28 PM


Casual Member


Group: Members
Posts: 132
Member No.: 1,157
Joined: 25-October 15



They are both naturally occurring numbers, it must be just a coincidence,these numbers 528 264 13.333

It's just that 528 and 13.333 occur in the imperial when you use 100/99 as an adjustment factor and this happens in the musical numbers as well.
it seems a rather unlikely coincidence.
Top
Double sharp
Posted: Nov 24 2017, 12:34 PM


Dozens Disciple


Group: Members
Posts: 1,401
Member No.: 1,150
Joined: 19-September 15



A rather likely coincidence, if you ask me, considering how Piotr did not use the of A4 = 440 Hz (and thus G4 ~ 392 Hz), but instead tinkered with it to give G4 = 396 Hz (which, being 11-smooth, provides ample opportunity for the sorts of numbers you are interested in to pop up). So all that needed to be done was a quick multiplication by 4/3 to get a just perfect fourth up to 528 Hz, some blithe disregard for units, and there you have an extremely likely and extremely meaningless coincidence.
Top
davidk
Posted: Nov 24 2017, 02:23 PM


Casual Member


Group: Members
Posts: 132
Member No.: 1,157
Joined: 25-October 15



https://hypertextbook.com/facts/2003/DanielleDaly.shtml

which is why i looked for some corroboative evidence

it was not hard to find.

I never knew C could be 264 Hz

it could be meaningless but I just find it very interesting since 5280 crops up all over the place, especially in eclipse calculations and natural number calculations.



Top
Double sharp
Posted: Nov 24 2017, 03:07 PM


Dozens Disciple


Group: Members
Posts: 1,401
Member No.: 1,150
Joined: 19-September 15



QUOTE (davidk @ Nov 24 2017, 02:23 PM)
I never knew C could be 264 Hz

It could, but the pitch of Middle C has varied so much throughout history (examples from 223.75 Hz to 338.35 Hz are listed at that page, ranging from about modern Middle A to Middle E-half-sharp) that I don't see why 264 is any more interesting as a value than 256, 261.625 (the modern standard), or 250.65 (Mozart's pitch).
Top
davidk
Posted: Nov 24 2017, 07:16 PM


Casual Member


Group: Members
Posts: 132
Member No.: 1,157
Joined: 25-October 15



Double sharp

So if we have 264 hz is an octave higher going to be 528 hz?

and in decimal notation will F be `1333.333r?

using this notation Dylan's 'blowing in the wind' first line

How many roads must a man walk down, before you call him a man

in 4/4 time would be for the chords

4000, 5333.33r, 4000, 5333.33r, 4000, 5333.33r, 6000.

where 4000 is 4 beats of 1000.

and in imperial notation

3960,5280,3960,5280,3960,5280,5940.

i have always had a sort of 'feeling' that these numbers, in particular 5280 are naturally occurring not invented. i can't explain it rationally yet but the evidence is building up.


Some coincidences going on here.

5940/60 = 99

so base 100 =6000. sexigesimal
Top
Double sharp
Posted: Nov 24 2017, 11:01 PM


Dozens Disciple


Group: Members
Posts: 1,401
Member No.: 1,150
Joined: 19-September 15



Yes, since 528 = 2 * 264, and because the perfect fourth is 4/3 in just intonation. In 12-tone equal temperament it is 2^(5/12) ~ 1.33484 instead. But you can't simply multiply 4 beats of "1000" to make "4000", because multiplying a frequency that way just means a note two octaves higher, and furthermore these chords are surely not individual notes but perfect triads.
Top
davidk
Posted: Nov 26 2017, 09:56 AM


Casual Member


Group: Members
Posts: 132
Member No.: 1,157
Joined: 25-October 15



yes musically it does not work, i see what you mean.

It would be great if 4000 resolved into a triad that works but it does not seem to.

Mathematically it does as a pythagorean triple but not musically that i can see but it is close.

Not sure what note 1666.666r 440hz is in the Piotr system but he seems to have deliberately excluded it but C 1000 and F 1333.333 are there.

C 1000 264
F 1333 352
? 1667 440
Total 4000 1056

Mathematically the whole thing is very harmonious but not sure it would be worth listening to!!

Piotr has also used fractional notation,.

Is fibonacci in the musical scale?

Piotr said 'Another option is to base on a just ratio for 1, 5, 7 or 11 steps. Here is a version with 18/17 for 1 step:'

This option must be close to fibonacci because 34 and 55 turn up in it although 55 needs a bit of finding.

This is how the construction of the system I am talking about appears as fractional notation - decimals are very impressive when they appear but ancient maths did not do decimals. The system goes further, and is more complex, than the imperial using primes to 17. It is 3,5,7,11,13,17, using 2 to the power 10 as the spine of the system.

The imperial finishes at prime 11 with prime 7 removed via Pi as 22/7.

22/7 works with Piotr system even if musically it is meaningless.

Dan's calculations

'One possibility is to represent the frequencies as double-precision floating-point numbers, good to 53 significant bits.

As a binary floating-point representation, this approach has the advantage that an octave is always an exact 2:1 frequency ratio'

This seems to have been the ancient way - floating point numbers - very complex but they used it.

Dan's calculations reveal the imperial system across the whole scale, it is quite remarkable to me, at any rate.

The problem is that although the Babylonian's left evidence they used a base 60 floating point system how could they have designed such a complex system. The obvious answer is - well they just couldn't have.

Not unless it is a naturally occurring system and they discovered bits of it, they don't seem to be using base 17 but base 11 seems to be probable. This thread is giving me some hope.
Top
davidk
Posted: Nov 27 2017, 10:59 AM


Casual Member


Group: Members
Posts: 132
Member No.: 1,157
Joined: 25-October 15



Using Dan's analysis it is possible to demonstrate the system that seems to be working at Stonehenge.

Line 105 99 3520 (1760 x 2) Two miles in yards

3520/99 = 35.55555556 A

3520/105 = 33.52380952 B

A-B = 2.031746032

A/2.031746032 = 17.5

B/2.031746032 = 16.5

The unit between is 17 and this translates to 102.This is what Thom discovered.

At Stonehenge the Aubrey circumference is 89760 not my numbers and verified to two independent sources.

89760 is 17 x 5280.

So the system goes beyond the imperial system quite naturally.

Double sharp raised the point that 256hz could just as easily be C but this again produces the same result using base 8.

256/8 = 32 264 /8 = 33 the base unit of the imperial system. 32 is also a root of the imperial system

5280 / 32 = 165 or 10 chains if imperial feet are used.

Hz on feet are irrelevant just the numbers and their relationships are under consideration here and the question is why is this happening? They appear to be naturally occurring. The origin of the units is a different question.

the system being looked at is this one

99 102 105 stated as 16.5, 17 and 17.5 so all x 6.

The suggestion is that the imperial system 5280 works with a base unit of 0.99 imperial feet to produce a base 100 system of 5333.333r units.

So the units for each number will be 0.99, 1.02 and 1.05.

the mile will pro rata giving 5280, 5440 and 5600 ( There is that Stonehenge Aubrey circle number again)

5280/.99 = 5333.3333r ( the imperial system)
5440/1.02 = 5333.3333r ( Thom's system)
5600 / 1.05 = 5333.3333r ( the roman system) According to Anne Macaulay)

Thom discovered a unit of 2.72 feet 0.17 x 16 feet
1.02 feet is 6 x 0.17 feet the same system exactly.

What unit works with 5333.333 feet?
It is base 100 so 100 x 0.12 of a foot and this is 12 inches.

This is one of the key observations concerning the imperial system.

It is a base 100 unit on a base 99 system ( naturally occurring possibly?)

The question always posed is one of insufficient evidence but in this case very persuasive evidence can be produced in the form of the Scottish Mile 5920 feet.

Pro rata measurements are 18.5 111 and 5920 producing a calculation of 111 x 0.12 feet = 1.11 feet.

5920 / 1.11 = 5333.333r

Note: Anne Macaulay wrote a book called 'Megalithic Measures and Rythms'

She was a gifted musician and investigated the natural fibonacci rythms in the stone circle survey drawings of Alexander Thom.

It is worth a read if you can get hold of a copy. It has become a collector's item.
https://www.amazon.co.uk/Megalithic-Measure...lithic+measures
Top
« Next Oldest | Music Notation | Next Newest »
DealsFor.me - The best sales, coupons, and discounts for you

Topic Options



Hosted for free by zIFBoards* (Terms of Use: Updated 2/10/2010) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.0548 seconds · Archive