Playing 4 bar kick and snare loop at the same time?

hi everyone i hope your all well :slight_smile:

i’m trying to play kick and snare at the same time, when played together they’ll make a 4 bar loop.
but i cant workout how to do this using threads? my code is below:
in_thread
4.times do
use_bpm 140
sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /bde-dnb30.aif”
sleep 1
sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /bde-dnb30.aif”
sleep 1
sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /bde-dnb30.aif”
sleep 1
sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /bde-dnb30.aif”
sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” sleep 0.50 sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” sleep 0.50 sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” sleep 0.50 sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” end
end
end

in_thread
4.times do
use_bpm 140
sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” sleep 0.50 sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” sleep 0.50 sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” sleep 0.50 sample “/Users/soundwarrior/Documents/reaper personal/projects/sound warrior/abis rave 140 bpm/abis rave drum samples /Snare_Tight_SP01.wav” end

if anyone could help me with this that would be great thanks respect trey :slight_smile:

Hi Trey,

When posting to the forums, there’s a way to put your code into a
separate scrollable window. It keeps the indenting, making it much
easier to understand.

On a blank line put 3 single quotes ``` (just below the escape key on
an English keyboard), then hit return and paste your code underneath
it.

There’s no problem using ‘in_thread’ when coding, but I think you will
find as you make longer songs, you are going to use ‘live_loop’ and
things like the ‘at’ command much more often than ‘in_thread’.

I’ll try put a simple examples here, showing the difference between the
three…

First, a simple in_thread using internal samples.

use_bpm 140

in_thread do
  loop do
    sample :bd_ada
    sleep 1
    sample :bd_klub
    sleep 1
    sample :bd_haus
    sleep 1
    sample :bd_klub
    sleep 1
  end
end

in_thread do
  loop do
    sample :drum_snare_hard
    sleep 1
    sample :drum_snare_soft
    sleep 1
    sample :drum_snare_hard
    sleep 1
    sample :drum_snare_hard
    sleep 1
  end
end

Next 2 live_loops with another live_loop keeping track of the four beats.

use_bpm 140

live_loop :bar do
  cue :beat
  sleep 4
end

live_loop :drums do
  sync :beat
  sample :bd_ada
  sleep 1
  sample :bd_klub
  sleep 1
  sample :bd_haus
  sleep 1
  sample :bd_klub
  sleep 1
end

live_loop :snare do
  sync :beat
  sample :drum_snare_hard
  sleep 1
  sample :drum_snare_soft
  sleep 1
  sample :drum_snare_hard
  sleep 1
  sample :drum_snare_hard
  sleep 1
end

And finally an example using the ‘at’ command.

use_bpm 140
live_loop :bar do
  sleep 4
end

define :snare do
  at [0, 2, 3] do
    sample :drum_snare_hard
  end
  
  at [1] do
    sample :drum_snare_soft
  end
end

define :drum do
  at [1, 3] do
    sample :bd_klub
  end
  
  at [0] do
    sample :bd_ada
  end
  
  at [2] do
    sample :bd_haus
  end
end


live_loop :do_snare do
  sync :bar
  snare
end

live_loop :do_drum do
  sync :bar
  drum
end

Hope that helps, and I too welcome you to forums.

Eli…

2 Likes

hi what things are the @ and bar commands used for? i couldn’t refrence to them in the tutorial. thanks for all your help :slight_smile:

Just to clarify-- the character used to format code (on an American keyboard, the key just under the ‘Esc’ key) is a ‘backtick’, not a single quote.

Thanks!
Bryan

hi thanks for your help everyone :slight_smile: