Initial commit

This commit is contained in:
Pascal Engélibert 2025-02-27 00:41:31 +01:00
commit 778fe31c38
35 changed files with 1849 additions and 0 deletions

22
level3.py Normal file
View file

@ -0,0 +1,22 @@
"""
Niveau 3
Jouer des accords
Ne pas introduire le facteur d'amplitude avant d'avoir entendu le résultat sans lui
"""
import synthlib, math
music = [
(1, [-9]),
(1, [-5]),
(1, [-2]),
(3, [-9, -5, -2])
]
sound_encoder = synthlib.SoundEncoder()
for note in music:
for t in range(note[0]*6000):
sound_encoder.write_sample(sum([0.3*math.sin(t/16000*440*2**(i/12)*2*math.pi) for i in note[1]]))