Arabseque No. 1 modified

Hmm Just had a look at your code and tried to play it. Unfortunately all of the loops in the form for i in 0 … n appear to have the value of n one larger that it should be, causing Sonic Pi to stop with an error as it tried to play a non existent element in the input lists.
eg the section starting in line 33

n3 = [:r,:Gs5,:r,:Gs5]
d3 = [1.0,0.15729166666666675,8.642281333333335,0.29228042500000073]
amps3 = [0,0.3858267716535433,0,0.7086614173228346]
in_thread do
                    for i in 0..4
                            play n3[i],amp:amps3[i]
                            sleep d3[i]
                    end
            end 

the loop iterates with i having values 0,1,2,3,4 and the last value causes an error as there are only values n3[0] … n3[3] in the input list of notes, and the same for the durations and amps values. The values that i takes is shown in the loop below

for i in 0..4
  puts i
end

gives the output in the log:

{run: 7, time: 0.0}
 ├─ 0
 ├─ 1
 ├─ 2
 ├─ 3
 └─ 4

So I reckon there are 424 values that need to be reduced by 1!

1 Like