Skip to content

Commit 217cf97

Browse files
committed
Audio
1 parent 63e52c5 commit 217cf97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,9 +1576,9 @@ from itertools import chain, repeat
15761576
F = 44100
15771577
S1 = '59♪,57,,59♪,54,,50♪,54,,47♪,,,'
15781578
S2 = '59♪,61,,62♪,61,,62,,59,,61♪,59,,61,,57,,59♪,57,,59,,55,,59♪,,,'
1579+
get_pause = lambda seconds: repeat(0, int(seconds * F))
15791580
sin_f = lambda i, hz: math.sin(i * 2 * math.pi * hz / F)
15801581
get_wave = lambda hz, seconds: (sin_f(i, hz) for i in range(int(seconds * F)))
1581-
get_pause = lambda seconds: repeat(0, int(seconds * F))
15821582
get_hz = lambda note: round(16.352 * 2 ** (int(note[:2]) / 12))
15831583
parse_n = lambda note: (get_hz(note), 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)

0 commit comments

Comments
 (0)