Dec 11, 2006 at 12:42am
Just wondering if there’s anyway of displaying the BPM of an audio sample from the groove~ object?
Thanks in advance!
Dec 11, 2006 at 12:50am
>Just wondering if there’s anyway of displaying the BPM of an audio sample from the groove~ object?
Check out [info~], which reports information about a file loaded into a particular buffer, including the total time in ms. If you supply buffer~ with a -1 argument for length, then it will resize itself based on the sample that you load.
As long as you know how many beats are in the sample you’ve loaded, you can use this simple formula:
bpm = 60,000 / (length of the sample in ms/ # of beats in the sample)
Dec 11, 2006 at 10:53am
Hi Thanks for that, the problem is that i don’t have any control over what sample is being loaded. It’s to go onto a mixer that the user can drag and drop audio files to play! Ideally i need it to somehow be calulated from the groove~ object and not the buffer, then it shouldn’t matter what sample is being played!
Dec 11, 2006 at 5:15pm
Quote: comedydave wrote on Mon, 11 December 2006 03:53
What you’re asking for is, as far as I know, not possible. In order to calculate BPM you need to know both how long the file is, and how many beats it contains. This is why a program like Recycle will insist that you tell it how many beats are in your sample before they will let you save/export.
Another thing to keep in mind is that the [groove~] object is really just a reference to a [buffer~]. It doesn’t contain any sample information itself… it’s more of a glorified way to read audio samples out of the buffer. Likewise, the [info~] object that I mentioned in my previous post is another way of getting information from a buffer, such as the length of the sample.
One way to accomplish what you’re after would be to make a dialog box pop up when a new sample is loaded asking how many beats it is. You could store this info, along with the filename, in a coll object so that it is only asked when a brand-new sample is loaded. Or, you could require that the user put the number of beats in the filename (i.e. DrumLoop1_16.wav) and then extract that information when the file is loaded. Either way, you will somehow need to tell Max how many beats are in the file before you can get a BPM reading.
Dec 11, 2006 at 7:34pm
There are a few ways to actually analyze the audio file to extract
By doing some FFT work, detecting transients (if mainly a percussive
On Dec 11, 2006, at 10:15 AM, Dan wrote:
Associate Professor of Contemporary Music
Dec 12, 2006 at 1:43pm
Dave Hardy wrote:
The sample has to be analysed, nothing groove~ can do. You need somthing
One thing considering is to let the user tell how many beats it has.
You must be logged in to reply to this topic.