Hi is this code i’m trying to create a song in which all the instruments play random notes at the same time, what is wrong? Because they are sounding one febore the other.
from scamp import *
import random
s = Session(100)
piano = s.new_part("piano")
saxo = s.new_part("saxo")
organ = s.new_part("organ")
shakuhachi = s.new_part("shakuhachi")
timpani = s.new_part("timpani")
trumpet = s.new_part("trumpet")
trombone = s.new_part("trombone")
violin = s.new_part("violin")
while True:
pitch = int(random.uniform(62, 100))
volume = random.uniform(0.4, 1)
length = random.uniform(1/7, 8)
violin.play_note(pitch, volume, length)
pitch = int(random.uniform(23, 118))
volume = random.uniform(0.2, 1)
length = random.uniform(1/7, 4)
piano.play_note(pitch, volume, length, "staccato")
pitch = int(random.uniform(50, 77))
volume = random.uniform(0.2, 1)
length = random.uniform(1/8, 7)
saxo.play_note(pitch, volume, length)
pitch = int(random.uniform(50, 77))
volume = random.uniform(0.3, 1)
length = random.uniform(1/8, 10)
organ.play_note(pitch, volume, length)
pitch = int(random.uniform(50, 77))
volume = random.uniform(0.4, 1)
length = random.uniform(1/8, 5)
shakuhachi.play_note(pitch, volume, length)
pitch = int(random.uniform(50, 77))
volume = random.uniform(0.2, 1)
length = random.uniform(1/8, 3)
timpani.play_note(pitch, volume, length)
pitch = int(random.uniform(50, 77))
volume = random.uniform(0.2, 1)
length = random.uniform(1/8, 8)
trumpet.play_note(pitch, volume, length)
pitch = int(random.uniform(50, 77))
volume = random.uniform(0.2, 1)
length = random.uniform(1/8, 6)
trombone.play_note(pitch, volume, length)
s.fork(piano_part)
s.fork(saxo_part)
s.fork(organ_part)
s.fork(shakuhachi_part)
s.fork(timpani_part)
s.fork(trumpet_part)
s.fork(trombone_part)
s.fork(violin_part)```