Initial commit
This commit is contained in:
commit
778fe31c38
35 changed files with 1849 additions and 0 deletions
22
level3.py
Normal file
22
level3.py
Normal 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]]))
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue