diff options
Diffstat (limited to 'music.py')
-rw-r--r-- | music.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -314,7 +314,7 @@ def at(t): """ Returns the total intensity of music sampled at time t """ - i = bisect.bisect(music, (t, 10**9)) + i = bisect.bisect(music, (t, 2**31)) # This is actually pretty efficient ngl # Because people usually don't have that many overlapping notes ret = 0 @@ -322,9 +322,9 @@ def at(t): m = music[j] # if m[0] + m[1] > t: ret += m[4] * tone(freq(m[2], m[3]), t - m[0]) - return int(2**12 * ret) + return int(2**28 * ret) # Print out music encoded in s16 to standard output for i in range(0 * bitrate, 84 * bitrate): - sys.stdout.buffer.write(struct.pack("h", at(i / bitrate))) + sys.stdout.buffer.write(struct.pack("i", at(i / bitrate))) |