Runtime error when using inset: pick

Hi, I am new to Sonic Pi and I am having trouble with samples. When I try to use the onset: pick, I get the following error message

Runtime Error: [buffer zero, line 4]
Thread death ±-> :live_loop_amenRandom
wrong number of arguments (given 0, expected 1+)
this is the code. with any value like onset: 3 it works

live_loop :amenRandom do
use_random_seed 80708
16.times do
sample :loop_amen, onset: pick, release: 0.25
sleep 0.125
end
end

Hmm. It worked fine for me on Sonic Pi 3.2.2
here is it nicely formatted. (put three back ticks on the line before and after the code to do this.

live_loop :amenRandom do
  use_random_seed 80708
  16.times do
    sample :loop_amen, onset: pick, release: 0.25
    sleep 0.125
  end
end

You use the same random seed value so you 'll always get the same sequence.

2 Likes

Try choose instead of pick?

@gabriel.dai what version of Sonic Pi are you using?

1 Like

I am using the 2.1 in ubuntu linux

same problem with the choose

Hi @gabriel.dai - unfortunately the version of Sonic Pi you’re using is 6 years old now and hugely outdated which is why you’re getting these issues.

The latest release is v3.2.2 and on this version your code will work as expected.

hy guys. I just managed to get the new version and it worked fine. thanks for the help.

3 Likes