I’m creating a drum beat using a drumset VST in Reaper
I created a function to play the hi hat part and a backbeat function
But when I try to fork them both, I get this horrible screeching sound and the error:
WARNING:root:Ran out of threads in the master clock’s ThreadPool; small thread creation delays may result. You can increase the number of threads in the pool to avoid this.
My code:
from scamp import *
import random
s = Session(tempo=100)
drums = s.new_midi_part("drums", 2)
def play_hi_hat():
i = random.uniform(0,1)
if i > 0.2:
drums.play_note(42, 1, 0.5)
else:
drums.play_note(42, 1, 0.25)
drums.play_note(42, 1, 0.25)
def play_backbeat():
drums.play_note(36,1,1)
drums.play_note(38,1,1)
while True:
s.fork(play_hi_hat)
s.fork(play_backbeat)
Even if I run the s.fork(play_hi_hat) without the other function, the screeching occurs and the error appears.