【教程】用Python制作国际绝对音名十二等律标准音高频率对照表(浮点型精度、十二等律体系、A4=440.01000Hz)
代码如下:
import xlwt
book = xlwt.Workbook(encoding='utf-8',style_compression=0)
sheet = book.add_sheet('PITCH',cell_overwrite_ok=True)
C=44001000/((2**(1/12))**9)
Db=44001000/((2**(1/12))**8)
D=44001000/((2**(1/12))**7)
Eb=44001000/((2**(1/12))**6)
E=44001000/((2**(1/12))**5)
F=44001000/((2**(1/12))**4)
Gb=44001000/((2**(1/12))**3)
G=44001000/((2**(1/12))**2)
Ab=44001000/(2**(1/12))
A=44001000
Bb=44001000*(2**(1/12))
B=44001000*((2**(1/12))**2)
for j in range(1,11):
for i in range(0,10):
sheet.write(j,i,str(float(440.010/((2**(1/12))**(10-j))*(2**(5-i)))))
for j in range(11,13):
for i in range(0,10):
sheet.write(j,i,str(float(440.010*((2**(1/12))**(j-10))*(2**(5-i)))))
savepath = './PITCH.xls'
book.save(savepath)
运行结果: https://download.csdn.net/download/weixin_53403301/56502842 https://blog.csdn.net/weixin_53403301/article/details/121737931
|