| 1 |
# Part of SAASound copyright 1998-2018 Dave Hooper <[email protected]> |
| 2 |
# |
| 3 |
# freqdat.py |
| 4 |
# You can use this to generate an alternative SAAFreq.dat |
| 5 |
# |
| 6 |
# By default, the SAA-1099 generator will compute a frequency table at runtime |
| 7 |
# but you can set the SAA_FIXED_CLOCKRATE define flag and supply your own (fixed, |
| 8 |
# precompiled) frequency table named SAAFreq.dat |
| 9 |
# |
| 10 |
# This is not super-useful for general-purpose computing devices (e.g PCs), but is |
| 11 |
# useful for embedded or low-capability devices, or for hardware-based implementations |
| 12 |
# |
| 13 |
# To use this simply run the file and pipe the output into src/SAAFreq.dat |
| 14 |
|
| 15 |
BASE = 8000000 |
| 16 |
SCALE = 4096 |
| 17 |
|
| 18 |
for octave in range(0,8): |
| 19 |
for offset in range(0,256): |
| 20 |
f = 2 * SCALE * (BASE/8000000) * 15625 * (2**octave) / (511-offset) |
| 21 |
print(int(f), ',') |