## Hope fully an easy question.

Jan 23, 2007 at 2:33pm

# Hope fully an easy question.

Using the info object I can obtain the sampling rate and the length of a sample loaded. If this aforementioned sample is a beat loop how would I calculate the number of beats it contains?

x=sampling rate=44100
y=length(ms)=2470.590

z=number of beats=??

Thanks guys, I not great at maths at the best of times.

Rhys

#29886
Jan 23, 2007 at 3:21pm

You need another parameter for that, namely the speed. If you have e.g. 120
bpm, you divide 60000ms (1 minute) by 120, and you get 500ms per beat. Then
divide the loop lenght by that value to see how many beats fit into that
time span.

Tobias

Am 23.1.2007 15:33 Uhr schrieb “Rhys Perkins” unter :

>
> Using the info object I can obtain the sampling rate and the length of a
> sample loaded. If this aforementioned sample is a beat loop how would I
> calculate the number of beats it contains?
>
> x=sampling rate=44100
> y=length(ms)=2470.590
>
> z=number of beats=??
>
> Thanks guys, I not great at maths at the best of times.
>
> Rhys

#94207
Jan 23, 2007 at 3:33pm

Hey Rhys,

That info won’t tell you anything about what kind of sounds the sample has. It could be a drone, it could be silence, it could be 128 really fast spazzy beats. Beat detection is a very difficult thing to do accurately – but google “beat detection” and you’re sure to find some PhD abstracts or something.

If you know your loops are in 4/4 then just divide the total time by powers of 2 (2, 4, 8, 16, etc.) and you’ll know how long (in ms) a metric “chunk” will be. Then you can multiply that by 0, 1, 2, etc to find the start point of each chunk. Add those two together and you have the end of the chunk. You might be selecting 2 beats or just an 8th note depending on the loop and will have to play around with the divisor for each sample….or organize your samples according to number of beats so that you know ahead of time. ;)

Sometimes questions like this are easier to answer if people know what you ultimately want to do with the information. What are you trying to acheive?

Cheers!

Lewis

Quote: Dr. Spankenstein wrote on Tue, 23 January 2007 06:33
—————————————————-
> Using the info object I can obtain the sampling rate and the length of a sample loaded. If this aforementioned sample is a beat loop how would I calculate the number of beats it contains?
>
> x=sampling rate=44100
> y=length(ms)=2470.590
>
> z=number of beats=??
>
> Thanks guys, I not great at maths at the best of times.
>
> Rhys
—————————————————-

#94208
Jan 23, 2007 at 3:56pm

I’m largely dealing with 4/4 jungle loops. Its a case of using them with a 16 step sequencer and dividing and having each step as a semiquaver equivalent of the whole loop.

So if I know a file has 8 beats in it then it will take 32 steps to go from beginning to end of the file and can be divided up accordingly with the option of certain beats in the loop being played back/skipped.

This number can also help to determine the number of steps in demisemiquaver division and hemidemisemiquaver division modes.

The original bpm speed of the file is not important as the bpm speed of the master metronome is used to calculate the number of beats as that is what speed the file will playback at.

Thanks again guys.

#94209
Jan 23, 2007 at 4:01pm

Actually come to think of it. There must be a way of determining the original bpm of a track just knowing the length and the sample rate?

#94210
Jan 23, 2007 at 5:09pm

Not really – the sample rate is irrelevant here; and so is the length
really. You can’t determine the bpm without analysing the track in
some way; and the length doesn’t help unless you know how many beats
it contains.

If you know length and bpm you can determine number of beats in sample.
If you know length and number of beats you can determine bpm.

You have to have at least that much data – maybe you could use
something like bonk~ to find the beats.

L

On 23 Jan 2007, at 16:01, Rhys Perkins wrote:

>
> Actually come to think of it. There must be a way of determining
> the original bpm of a track just knowing the length and the sample
> rate?

Lawrence Casserley – lawrence@lcasserley.co.uk
Lawrence Electronic Operations – http://www.lcasserley.co.uk
Colourscape Music Festivals – http://www.colourscape.org.uk

#94211
Jan 25, 2007 at 6:53am

#94212
Jan 25, 2007 at 9:44am

unless you do some kind of peak detection analysis on the file, you need to know how many bars the loop is and what time signature it uses.
for instance 3 bars of 11/4 will give you 33 basic divisions or beats, which you may want to divide into further quarters = 132 hits

then you can cut it up and reshuffle it with all the little junglist soldiers present and correct

#94213
Jan 25, 2007 at 9:45am

unless its got swing in the recording, in which case i would recommend chopping it up by hand or with recycle.

#94214
Jan 27, 2007 at 6:02am

For this example, imagine you’ve got a drum loop sample that’s 2 measures
long, containing 8 beats, and it’s 3 seconds long.

What you need to do is use a mathematical process known as Unit Conversion
or Dimensional Analysis. The process is this:

1. Figure out what kind of units you’re working with.

In this case, you’re starting with beats per second, or beats/second. How do
we know this? You’ve got 8 beats happening in a time span of 3 seconds,
being, 8 beats/3 seconds, which is equivalent to 8/3 beats/second

2. Figure out what kind of unit you want it to end up as.

You want to find out the beats per minute, or beats/minute.

3. Multiply the original unit by the conversion factor.

In this case, there are 60 seconds in 1 minute, so the conversion factor is
60 seconds / 1 minute.

60 seconds and 1 minute are equivalent, so you’re not going to change the
value of the number by multiplying it because it’s the same as multiplying
by 1. One of the properties of multiplication is that a number multiplied by
1 is equal to the original number.

To sum up:

8 beats/3 seconds * 60 seconds/1 minute = (8*60)/3 beats/minute = 160
beats/minute

William

#94215
Jan 27, 2007 at 12:15pm

So in theory if I could detect these beats using the fft object and some kind of way of detecting the quick transients then I could accept any kind of file in and have it cut up in the right way and then apply the Unit Conversion process to the detected beats?

I’m guessing again that this doesnt apply when there is a heavy swing groove applied to the original beat?

#94216
Jan 29, 2007 at 12:55pm

Rhys Perkins wrote:
> So in theory if I could detect these beats using the fft object and
> some kind of way of detecting the quick transients then I could
> accept any kind of file in and have it cut up in the right way and
> then apply the Unit Conversion process to the detected beats?

Yes

> I’m guessing again that this doesnt apply when there is a heavy swing
> groove applied to the original beat?

Why not, actually this would be the only way to detect a swing and slice
it correctly, but then you’d definitely leave the area of the subject of