How to change the tuning to something other than A=440Hz

For equal temperament,
I wanted to know the use_cent_tuning value to change the tuning to A= 438, 439, 441, 442, 443, 444, 445 Hz, etc. and thought this would help.
Tuning Sonic Pi to 432 Hz

use_cent_tuning -31.76665363342928

Here,
a4=440*(2**(1.0/12.0))(:A4-69)
as4=440*(2
(1.0/12.0))**(:As4-69)
puts 100/(as4-a4)*(440-432)
30.576643172919564

and,
af4=440*(2**(1.0/12.0))(:Af4-69)
a4=440*(2
(1.0/12.0))**(:A4-69)
puts 100/(a4-af4)*(440-432)
32.39482499110138

None of these values were 31.76665363342928.
How is the value calculated?
Is there a summary of how to tune to each frequency?

1 Like
print midi_to_hz(:a4)

print hz_to_midi(432)  #Note for A-432
print :a4 - hz_to_midi(432)  #Difference to A-440 in semitones
1 Like

Thank you!
I was thinking about the problem in a way that made it extra complicated.