# Permutation of 4 note timing = Beatnik

**URL:** <https://in-thread.sonic-pi.net/t/permutation-of-4-note-timing-beatnik/1785>\
**Category:** Creations & Ideas\
**Created:** [December 7, 2018, 10:23pm UTC](https://in-thread.sonic-pi.net/t/permutation-of-4-note-timing-beatnik/1785 "2018-12-07T22:23:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeMac](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@JoeMac](https://in-thread.sonic-pi.net/u/JoeMac)\
**Post date:** [December 7, 2018, 10:23pm UTC](https://in-thread.sonic-pi.net/t/permutation-of-4-note-timing-beatnik/1785/1 "2018-12-07T22:23:41Z")

</div>

```ruby
# BongoRythmns
# 7 Dec 2018
# use the tabla samples
# take 4 not combinations and permutate them to derive rythmn patterns
# play the bongos in the rythmn patterns

tabla= sample_names(:tabla)
tabla=tabla.slice(9,tabla.length)

#use_bpm 90
t1=[0.25,0.25,0.25,0.25]
t2=[0.125,0.25,0.25,0.25]
t2a=t2.permutation.to_a
t3=[0.125,0.125,0.125,0.25]
t3a=t3.permutation.to_a
t4=t2a+t3a
t4=t4.push(t1)
puts t4.length,t4

live_loop :foo do
  j=tick
  sample(tabla[j],amp:0.8)
  k=((j/4).floor)%49
  t5=t4[k]
  puts k,j,t5
  t5=t5.ring
  sleep t5[j]
end

```

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [December 9, 2018, 1:44pm UTC](https://in-thread.sonic-pi.net/t/permutation-of-4-note-timing-beatnik/1785/2 "2018-12-09T13:44:15Z")

</div>

Very neat. Useful use of .permutate and .floor methods
