User:Moiree
From C64-Wiki
Jump to navigationJump to searchSID ADSR times[edit | edit source]
tv_clock_rates = {"PAL": 0.985248, "NTSC": 1.022727} attack_ms = [2, 8, 16, 24, 38, 56, 68, 80, 100, 250, 500, 800, 1000, 3000, 5000, 8000] decay_ms = [6, 24, 48, 72, 114, 168, 204, 240, 300, 750, 1500, 2400, 3000, 9000, 15000, 24000] assert(len(attack_ms) == len(decay_ms) == 16) def tv_time(t, mhz): return (t / mhz) print( """{|{{prettytable}} |- ! !!colspan=2| PAL !!colspan=2| NTSC |- !value !! Attack !! Decay / Release !! Attack !! Decay / Release |- ! !!colspan=4 align="center"| [ms] |-""") for i in range(0, 16): print("| {:-2d}".format(i), end=" || ") print("{:5.4f}".format(tv_time(attack_ms[i], tv_clock_rates["PAL"])), end=" || ") print("{:5.4f}".format(tv_time(decay_ms[i], tv_clock_rates["PAL"])), end=" || ") print("{:5.4f}".format(tv_time(attack_ms[i], tv_clock_rates["NTSC"])), end=" || ") print("{:5.4f}".format(tv_time(decay_ms[i], tv_clock_rates["NTSC"])), end="\n|-\n") print("|}")
PAL | NTSC | |||
---|---|---|---|---|
value | Attack | Decay / Release | Attack | Decay / Release |
[ms] | ||||
0 | 2.0299 | 6.0898 | 1.9556 | 5.8667 |
1 | 8.1198 | 24.3593 | 7.8222 | 23.4667 |
2 | 16.2396 | 48.7187 | 15.6444 | 46.9333 |
3 | 24.3593 | 73.0780 | 23.4667 | 70.4000 |
4 | 38.5690 | 115.7069 | 37.1556 | 111.4667 |
5 | 56.8385 | 170.5154 | 54.7556 | 164.2667 |
6 | 69.0182 | 207.0545 | 66.4889 | 199.4667 |
7 | 81.1978 | 243.5935 | 78.2222 | 234.6667 |
8 | 101.4973 | 304.4919 | 97.7778 | 293.3334 |
9 | 253.7432 | 761.2297 | 244.4445 | 733.3335 |
10 | 507.4864 | 1522.4593 | 488.8890 | 1466.6671 |
11 | 811.9783 | 2435.9349 | 782.2224 | 2346.6673 |
12 | 1014.9729 | 3044.9186 | 977.7780 | 2933.3341 |
13 | 3044.9186 | 9134.7559 | 2933.3341 | 8800.0023 |
14 | 5074.8644 | 15224.5932 | 4888.8902 | 14666.6706 |
15 | 8119.7830 | 24359.3491 | 7822.2243 | 23466.6729 |