:loop_breakbeat bpm!

I’m going slightly ragged here for some reason. Very simple question for a very simple loop. What on earth is the bpm of the breakbeat sample?

puts sample_duration :loop_breakbeat
gives 1.9047619047619047
ie it takes just under 2 seconds at the default bpm of 60

if you use

use_bpm 60 #default bpm

live_loop :x do
  sample :loop_breakbeat, beat_stretch: 2 #just tweeks the loop tempo very slightly
  sleep 2
end

live_loop :metro do
  play 84,release: 0.2
  sleep 1
end

then this will run at 60 bpm, as the accompanying metro loop which beeps once per second shows

if you play the loop without stretching then its bpm is about 63 bpm (60*2/1.9047619047619047) as the test below will verify

use_bpm 60 #default ie play breakbeat at natural rate
live_loop :xy do
  sample :loop_breakbeat
  sleep sample_duration :loop_breakbeat
end
live_loop :metro2 do # this loop running at 63bpm
  use_bpm 63
  play 84,release: 0.2
  sleep 1
end
1 Like

You can also use use_sample_bpm if you don’t actually need to know the bpm number itself. Include the num_beats: option to specify how many beats you want count during the loop. I have found this option works better to even out the sleep values without stretching the beat or rounding off the bpm.

use_sample_bpm :loop_amen, num_beats: 4

live_loop :amenLoop do
  sample :loop_amen
  sleep 4
end

1 Like

Thank you!

beat_stretch I tried already - it’s odd that it only takes integer values, so there must be some cool stuff under the hood. But yes, it doesn’t actually work well on my underpowered little netbook.

I figured 63 by trial and error, but worried in case it was for some reason actually fractional & would eventually unsync.

use_sample_bpm is the one yes thank you! It works now I’ve added num_beats as you suggested and tweaked playing blocks. It turned out my problem was caused by my two thread loops having different lengths. It works as intended as soon as I match all of them up. I’ve still got a different problem but that’s not to do with :loop_breakbeat.

1 Like

I’m not quite sure what you mean by this. At least for me, the following all produce different results:

sample :loop_amen, beat_stretch: 0.9
sample :loop_amen, beat_stretch: 1.1
sample :loop_amen, beat_stretch: 1.01

Am I misunderstanding something?