From 6c138628317be8c3b61c1006bc9c3072a001427f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 2 Feb 2019 08:53:24 +0100 Subject: [PATCH] Audio --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7812670..02c5917 100644 --- a/README.md +++ b/README.md @@ -1579,7 +1579,7 @@ S2 = '59♪,61,,62♪,61,,62,,59,,61♪,59,,61,,57,,59♪,57,,59,,55,,59♪,,,' get_pause = lambda seconds: repeat(0, int(seconds * F)) sin_f = lambda i, hz: math.sin(i * 2 * math.pi * hz / F) get_wave = lambda hz, seconds: (sin_f(i, hz) for i in range(int(seconds * F))) -get_hz = lambda n: round(16.352 * 2 ** (int(n) / 12)) +get_hz = lambda n: 16.352 * 2 ** (int(n) / 12) parse_n = lambda note: (get_hz(note[:2]), 0.25 if len(note) > 2 else 0.125) get_note = lambda note: get_wave(*parse_n(note)) if note else get_pause(0.125) samples_f = chain.from_iterable(get_note(n) for n in f'{S1}{S1}{S2}'.split(','))