Searching a easy way to make euclidian Rhythms


#1

Hey everyone!
There’s some easy way to make euclidian rhythms as tidal cycle do?
in this video there’s a better explenation

Thank you so much!


#2

Hi @KOSF, have you had a look at the spread command? Might be what you looking for (see the docs or the following for a practical example: https://github.com/mbutz/sonic-pi-resources/blob/master/samba-with-spread-and-at.rb)


#3

Thank you so Much @Martin, i think it’s the command i was looking for!!


#4

@Martin I’m so sorry to bother you again but I need a little bit more clarification about this:
I understand how to use euclidian rythms with sample but now I would like to achieve the same but with an arpeggio.

I tried with these but I’m achieving just rythm but the arpeggio:
"live_loop :euclid do play (scale :e3, :minor_pentatonic), release: 0.5 if (spread 3, 8).tick sleep 0.125 end"


#5

@KOSF I use the spread command a lot but haven’t ever tried using it with different notes, so I was curious to try this out.

Just ticking through the scale and thread will not play the notes in order because even though you are ticking through all the notes in the scale, the spread will only play a note on certain beats therefore not playing some notes as you tick through the scale.

To fix this, you can store the scale in a variable and make another variable to act as a counter.

You then need to put the spread as a conditional before the play (This requires adding an additional ‘end’ since the ‘if’ conditional is a block of code that needs to be closed or else you get an error).

In the conditional, a note will only play on the beats specified in the spread (when the condition equals true). Instead of ticking through the scale, you will use the counter variable to play through the ring index. It will increase each time a note is played instead of each tick which would increase even when a note is not played.

Hope that makes sense. The code is below.

sc = scale(:e3, :minor_pentatonic) #scale stored in variable
i = 0 # counter variable
live_loop :euclid do
  if (spread 3, 8).tick # Conditional will play when true
    play sc[i], release: 0.5 # plays note in ring index based on counter
    i = i + 1 # increases counter by 1 after last note is played
  end
  sleep 0.125
end

If anyone knows an easier way to do this, I’d love to hear it. I played around with .tick and .look in various combinations but could not replicate the behavior of the code above.


#6

Hi, (I’m away and have just my smart phone with me, so I can’t try out anything) instead of an extra counter: what about introducing another ‘tick(:my_spread)’?


#7

Hi @mrbombmusic! That Can Be a really good solution! I Hope there Is an implementation for something a little bit faster, but for now I think it’s perfect.
Thank you so much!


#8

Martin’s idea makes it very compact

sc = scale(:e3, :minor_pentatonic) #scale stored in variable
live_loop :euclid do
  play sc.tick(:scl), release: 0.5 if (spread 3, 8).tick 
  sleep 0.125
end

The two ticks are independent of each other


#9

That def works better! I wasn’t aware you could have multiple ticks working independent of each other. Good to know!


#10

For reference, there’s a little bit about using multiple ticks within a single live loop in Section 9.4 of the tutorial: https://sonic-pi.net/tutorial.html#section-9-4


#11

Yes I went and checked that out after @Martin mentioned it. Very helpful!

@samaaron Forgive me for going off-topic, but your experiments with combining hydra with SPi were super inspiring! Was that something that could be implemented by someone less knowledgable than yourself (ie me)? Hoping that may become a feature in the future.:pray::crossed_fingers: