Hello,
I downloaded a sample pack and wanted to use a 124BPM beat which has a duration of
7.741950113378685 seconds.
My code:
use_bpm 62
live_loop :metronome do
sleep 1
end
beats = "path to samplepack"
sample_beat = beats, 7
live_loop :beat, sync: :metronome do
sample sample_beat, beat_stretch: 8
sleep 8
end
live_loop :cowbell, sync: :beat do
sample :drum_cowbell
sleep 1
end
end
- question: What does the timer start at 0.9677 and not 1?
{run: 31, time: 0.0}
└─ 8.000015117157975
{run: 31, time: 0.9677, thread: :live_loop_beat}
- question:
For example I want to add a cowbell sound with sleep 1. Obviously they are going quickly out of sync due to the samples duration. How do I work with this? My current solution is to beat_stretch it to 8, sleep for 8 and change the bpm to 62 to keep the same pitch. However the sample duration is still not exactly 8 unless I change the bpm to 60 * (8 / 7.741950113378685) which doesn’t seem to be the way to go.
Additionally, how would I got about syncing a 120bpm sample with a 124bpm sample?
I just found this thread here: http://in-thread.sonic-pi.net/t/playing-external-samples-in-time-with-each-other/1407/2
I tried working with use_sample_bpm and got to this:
The beat sample has an original duration of 15 seconds and the HiHat sample has a duration of 16 seconds. How do I get them together with a cowbell in sync?
beats = "Bass/"
sample_beat = beats, 1
use_sample_bpm sample_beat, num_beats: 4
live_loop :beat do
sample sample_beat
sleep 4
end
j = 0
live_loop :hihat do
samps = "Hi Hats/"
sample samps, j
sleep sample_duration(samps,j)
end
live_loop :cowbell do
sample :drum_cowbell
sleep 0.125
end
Thanks!