Explaining this code.
Everything used in the code is built into sonic pi, so (in theory) anyone could run it on their machine
I have a two dimensional array of arpeggios, arpeggios
(this might not be the correct musical theory term for it), and an array of synths, synths
The loop will
- grab a random arpeggio to play and a random synth to play it with
- calculate the the time each note needs to be played such that the total time it takes to play the arpeggio is
arptime
- play the arpeggio 4 times
- play a drum sample based on the index of the arpeggio being looped through
- i used
index + 1
to try and roughly simulate the 1, 2, 3, 4 in musical theory