Skip to content

Commit 6ee3aef

Browse files
committed
Audio
1 parent 7391ac6 commit 6ee3aef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,8 +1579,8 @@ S2 = '59♪,61,,62♪,61,,62,,59,,61♪,59,,61,,57,,59♪,57,,59,,55,,59♪,,,'
15791579
get_pause = lambda seconds: repeat(0, int(seconds * F))
15801580
sin_f = lambda i, hz: math.sin(i * 2 * math.pi * hz / F)
15811581
get_wave = lambda hz, seconds: (sin_f(i, hz) for i in range(int(seconds * F)))
1582-
get_hz = lambda note: round(16.352 * 2 ** (int(note[:2]) / 12))
1583-
parse_n = lambda note: (get_hz(note), 0.25 if len(note) > 2 else 0.125)
1582+
get_hz = lambda n: round(16.352 * 2 ** (int(n) / 12))
1583+
parse_n = lambda note: (get_hz(note[:2]), 0.25 if len(note) > 2 else 0.125)
15841584
get_note = lambda note: get_wave(*parse_n(note)) if note else get_pause(0.125)
15851585
samples_f = chain.from_iterable(get_note(n) for n in f'{S1}{S1}{S2}'.split(','))
15861586
samples_b = b''.join(struct.pack('<h', int(a * 30000)) for a in samples_f)

0 commit comments

Comments
 (0)