""" 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]]))