import numpy as np # We consider that samples are pitched with respect to C4 (60). audio_freq = 18157 precision = 17 interval = 2 ** (1 / 12) freqz = np.zeros(120) freqz[60] = 261.6 / audio_freq for i in range(61, 120): freqz[i] = freqz[i - 1] * interval r = list(range(0, 60)) r.reverse() for i in r: freqz[i] = freqz[i + 1] / interval if (4294967295 - int(max(freqz) * 2 ** precision * 44100)) < 0: print("Not enough room in u32 for the given precision") else: for f in freqz: print("{},".format(int(f * 2 ** precision)))