Skip to content

Instantly share code, notes, and snippets.

View Palladiumm's full-sized avatar

palladdiumm Palladiumm

View GitHub Profile
@Palladiumm
Palladiumm / notes.py
Created March 22, 2021 20:50
generate_notes
# до ре ми фа соль ля си
freq_array = np.array([261.63, 293.66, 329.63, 349.23, 392.00, 440.00, 493.88])
def generate_tones(duration):
tones = []
for freq in freq_array:
# np.array нужен для преобразования данных под формат 16 бит (dtype=np.int16)
tone = np.array(generate_sample(freq, duration, 1.0), dtype=np.int16)
tones.append(tone)
return tones