Help with this generative midi drum pattern

set( :rnd, 5683 )

live_loop :drums do
use_bpm 140
use_random_seed get( :rnd )

8.times do
midi :B1, channel: 10
midi :C2, channel: 10
midi :C3, channel: 10
midi :F2, channel: 10

sleep 1.3


live_loop :controller do
set( :rnd, rand_i( 200000 ))
sleep 1

Hey @soundwarrior,

what kind of help are you looking for?

Quickly reading the code I can see that you’re sending Midi notes B1, C2, C3 and F2 to all connected MIDI devices on Chanel 10 every 1.3 beats (with the BPM set to 140). With the midi function Sonic Pi will automatically send both note on and note off events (with a default of 1 beat between them) so this should act like someone hitting those notes on a piano and keeping their fingers down for 1 beat.

You also look to be playing with randomisation although you just seem to be calling set and get passing random values, setting the seed with use_random_seed but never actually doing anything that is random.

What were you intending to do? If you can let us know I’m sure we can help you towards your goal :slight_smile: