From 622e6ab0ae75f4ea7e2fd0f95119e4d75606d908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 31 Aug 2023 23:51:52 +0200 Subject: [PATCH] Synthesizer --- README.md | 3 +-- index.html | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8e46d52..cb224c8 100644 --- a/README.md +++ b/README.md @@ -2966,8 +2966,7 @@ parse_note = lambda note: (get_hz(note[:2]), 1/4 if '♩' in note else 1/8) get_samples = lambda note: get_wave(*parse_note(note)) if note else get_pause(1/8) samples_f = it.chain.from_iterable(get_samples(n) for n in f'{P1},{P1},{P2}'.split(',')) samples_i = array.array('h', (int(f * 30000) for f in samples_f)) -player = simpleaudio.play_buffer(samples_i, 1, 2, F) -player.wait_done() +simpleaudio.play_buffer(samples_i, 1, 2, F).wait_done() ``` diff --git a/index.html b/index.html index 61dac04..7cf85dd 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -2424,7 +2424,7 @@ parse_note = lambda note: (get_hz(note[:lambda note: get_wave(*parse_note(note)) if note else get_pause(1/8) samples_f = it.chain.from_iterable(get_samples(n) for n in f'{P1},{P1},{P2}'.split(',')) samples_i = array.array('h', (int(f * 30000) for f in samples_f)) -simpleaudio.play_buffer(samples_i, 1, 2, F) +simpleaudio.play_buffer(samples_i, 1, 2, F).wait_done() @@ -2928,7 +2928,7 @@ $ deactivate # Deactivates the activ