diff --git a/README.md b/README.md index 4ebe44c..a9e9f94 100644 --- a/README.md +++ b/README.md @@ -2653,6 +2653,7 @@ write_to_wav_file('test.wav', frames_i) ``` ### Synthesizer +#### Plays song Popcorn by Gershon Kingsley: ```python # $ pip3 install simpleaudio import simpleaudio, math, struct diff --git a/index.html b/index.html index a5b3738..091da03 100644 --- a/index.html +++ b/index.html @@ -2254,7 +2254,7 @@ frames_i = (add_noise(a) for a 'test.wav', frames_i) -
# $ pip3 install simpleaudio
+Synthesizer
Plays song Popcorn by Gershon Kingsley:
# $ pip3 install simpleaudio
import simpleaudio, math, struct
from itertools import chain, repeat
F = 44100
@@ -2269,7 +2269,8 @@ get_frames = lambda note: get_wave(*parse_note
frames_f = chain.from_iterable(get_frames(n) for n in f'{P1}{P1}{P2}'.split(','))
frames_b = b''.join(struct.pack('<h', int(f * 30000)) for f in frames_f)
simpleaudio.play_buffer(frames_b, 1, 2, F)
-
+
#!/usr/bin/env python3
#