How to play several partterns in sequence?

Hi there:

I have a groove,and want to add a bass line to that.

Bass line will have many patterns,it’s too long to put in the same ring/array.

So, i divided it into parts as follow :

# Bass Patterns = bpt

bpt1 = (ring :Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:B3,:Gs3)
bpt2 = (ring :Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:E4,:Ds4)
live_loop :bass do
  use_synth :fm
  use_bpm 120
  use_synth_defaults amp: 0.2,pan: -0.2,release: 0.4
  use_transpose -12
  tick
  play bpt1
  play bpt2
  sleep e
end

Of course,it din’t worked like that…

Want to play these patterns one after another,acording with their numbers.

How can i do this ?

Once again,thank for your attention.

One possible method (of many)…

Eli…

bpt1 = (ring :Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:B3,:Gs3)
bpt2 = (ring :Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:Cs4,:E4,:Ds4)

use_synth :fm
use_bpm 120
use_synth_defaults amp: 0.2,pan: -0.2,release: 0.4
use_transpose -12

live_loop :bass do
  bpt1.each do |x|
    play x, amp: 2
    sleep 1
  end
  bpt2.each do |x|
    play x, amp: 2
    sleep 1
  end
end

Of course the real fun starts when you mess it around… :slight_smile:

with_fx :ixi_techno do
  with_fx :reverb do
    
    live_loop :bass do
      bpt1.each do |x|
        play x, amp: 2
        sleep [0.5,0.25].choose
      end
      bpt2.each do |x|
        play x, amp: 2
        sleep [0.5,0.25].choose
      end
    end
    
  end
end
1 Like

I realize this might not be the answer you are looking for, but if you are concerned about the length of the rings being too long, you might look into the knit function which can be found in the language section of the help tutorials.

knit is like a ring but it takes a pair of arguments. The first is the value you want, the second is the number of times you want that value to happen in a row.

bpt = (knit, :Cs4, 6, :B3, 1, :Gs3, 1, :Cs4, 6, :E4, 1, :Ds4, 1) 

The above is a combination of both of the bass line patterns you had combined into one as a knit

Below would be a way you could then play through the knit using the original code you included.

bpt = (knit, :Cs4, 6, :B3, 1, :Gs3, 1, :Cs4, 6, :E4, 1, :Ds4, 1)

live_loop :bass do
  use_synth :fm
  use_bpm 120
  use_synth_defaults amp: 0.2,pan: -0.2,release: 0.4
  use_transpose -12
  play bpt.tick
  sleep 1
end

This might be a bit much if you have a lot of different bass line patterns you plan on using, but it is still a great tool if you plan on having a lot of repeated notes in a ring.

2 Likes

Hi mrbom :

Your hint is great,and in combination with the previous reply

in this same post,wil give some great compositional resources.

I readed about knit,it explains what it does,but not how to use it.

If it had show this syntax that you’re using, i would had understood.

Thank you for your help !

1 Like

Hi Eli :

Am a bit late on my reply,

but fortunately i had other reply;

and i combined them both :

# Note Durations

w = 4
h = 2
q = 1
e = 0.5
s = 0.25
r = 0.25

use_bpm 100
cue :click
use_debug false

es1 = "C:/Users/gwb70/Documents/My Samples/musicradar samples/167-free-krautrock-samples/100bpm/Beats"
es2 = "C:/Users/gwb70/Documents/My Samples/musicradar samples/167-free-krautrock-samples/100bpm/Synths"

r1 = (ring 2, 3)


live_loop :loop1 do
  use_bpm 30
  use_sample_defaults beat_stretch: 2, num_slices: 8,
    cutoff: 100,release: 0.25
  sample es1,1, slice: r1.tick
  sleep s
end


live_loop :loop2 do
  
  use_bpm 30
  with_fx :slicer,phase: 0.25, wave: 0, mix: 1.0 do
    use_sample_defaults rate: 0.5,finish: 0.125,
      beat_stretch: 2,amp: 0.5
    sample es2,1,rate: 0.5,rpitch:[3,5].ring.tick
    sleep q
  end
end

# Set Synth Bass

use_synth :fm
use_bpm 120
use_synth_defaults amp: 0.2,pan: -0.2,release: 0.4
use_transpose -12

# Bass Patterns = bpt

bpt1 = (knit, :Cs4, 6, :B3, 1, :Gs3, 1, :Cs4, 6, :E4, 1, :Ds4, 1)
bpt2 = (knit, :Cs4, 6, :B3, 1, :Gs3, 1, :Fs4, 6, :E4, 1, :B3,  1)

live_loop :bass do
  bpt1.each do |x|
    play x
    sleep s
  end
  bpt2.each do |x|
    play x
    sleep s
  end
end
  • Notice that am using an array for a sample too (r1)

So,i tried this same technique for 2 arrays with the same sample;

let’s say (r1,r2) :

# External Sample = es

es1 = "C:/Users/gwb70/Documents/My Samples/musicradar samples/167-free-krautrock-samples/100bpm/Beats"

r1 = (ring 2, 3)
r2 = (ring 2, 4)

use_sample_defaults beat_stretch: 2, num_slices: 8,
  cutoff: 100,release: 0.25

live_loop :loop1 do
  use_bpm 30
  sample es1,1, slice: r1.tick(:r1)
  r1.each do |x|
    play x
    sleep s
  end
  sample es1,1, slice: r2.tick(:r2)
  r2.each do |x|
    play x
    sleep s
  end

But it dind’t work so well with samples,if you know some way to deal with this issue…

Anyway,am already greatiful for your post,it helped me a lot.:grin:

Thank you !

Hmmm… I’m guessing you are trying to create a new beat from an existing
sample… so I’m going to throw in some code, and see if it helps you… the sample
beat can be downloaded here… (right click bar and ‘save as’).

And here is some code (similar to yours), to chop up the beats.
It actually sounds quite cool… :slight_smile:

And to change the beat completely, try this:

r1 = (ring 3, 5)
r2 = (ring 2, 4)

The second example shows how to combine the 2 tricks.

Eli…

# "C:/samples/MK03.wav"

r1 = (ring 2, 3)
r2 = (ring 2, 4)

use_sample_defaults beat_stretch: 2, num_slices: 8,
  cutoff: 100,release: 0.25


live_loop :loop1 do
  use_bpm 30
  r1.each do |x|
    sample "C:/samples/MK03.wav", slice: x
    sleep 0.25
  end
  r2.each do |x|
    sample "C:/samples/MK03.wav", slice: x
    sleep 0.25
  end
end
# "C:/samples/MK03.wav"

r1 = (ring 2, 3)
r2 = (ring 2, 4)

use_sample_defaults beat_stretch: 2, num_slices: 8,
  cutoff: 100,release: 0.25


live_loop :loop1 do
  use_bpm 30
  
  if one_in(4) then
    r1 = (ring 3, 5)
    r2 = (ring 2, 4)
  else
    r1 = (ring 2, 3)
    r2 = (ring 2, 4)
  end
  r1.each do |x|
    sample "C:/samples/MK03.wav", slice: x
    sleep 0.25
  end
  r2.each do |x|
    sample "C:/samples/MK03.wav", slice: x
    sleep 0.25
  end
end
4 Likes

Yeah !!! that’s the idea:

Record variations from a unique sample,and build a whole structure

from it.Thank you very much,again !!!:smiley::grin:

I’m glad I saw this. I was about to ask how to do just this.